-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for CSharp SetCustomExtension
#239
Conversation
wolftpm/tpm2_wrap.h
Outdated
defined(HAVE_OID_ENCODING) | ||
|
||
#ifndef WOLFTPM2_NUM_CUSTOM_EXT | ||
#define WOLFTPM2_NUM_CUSTOM_EXT 16 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can’t we get the defaults from wolfCrypt?
wolftpm/tpm2_wrap.h
Outdated
typedef struct WOLFTPM2_CSR { | ||
#if defined(WOLFSSL_ASN_TEMPLATE) && defined(WOLFSSL_CUSTOM_OID) && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer these defines to be outside the typedef although I realize it works this way too.
wrapper/CSharp/wolfTPM-tests.cs
Outdated
@@ -540,6 +540,8 @@ public void TryGenerateCSRCustomOID() | |||
Assert.That(rc, Is.GreaterThan(0)); | |||
|
|||
Console.WriteLine("CSR PEM {0} bytes", rc.ToString()); | |||
var writer = new BinaryWriter(File.OpenWrite("csr.pem")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be handy. Any issue running it over and over?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Glad you like it.!
If you used over and over then it would probably write all the things to the same file? I would think the writer needs to fall out of scope and then the garbage collector would then close the file?
I can break this out to its own function. Then it could fall out of scope and it would make things clearer.
Please do not merge. Still waiting for customer feedback. |
SetCustomExtension
I have tested @dgarske 's lastest change. It works as expected and I approve. |
Going to go ahead and merge. I believe this fix solves things for the customer. |
Tested with the CSharp wrapper tests and inspected the CSR.
Fixes ZD14713