-
Notifications
You must be signed in to change notification settings - Fork 62
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
Added tests for keyblob buffer export/import and support for getting sizes #315
Conversation
src/tpm2_wrap.c
Outdated
return BUFFER_E; | ||
} | ||
sz = 0; | ||
|
||
/* Write size marker for the public part */ | ||
XMEMCPY(buffer + sz, &key->pub.size, sizeof(key->pub.size)); |
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.
+ sz
can be removed here since its always zero now.
src/tpm2_wrap.c
Outdated
TPM2_PrintBin(privBuffer, *privBufferSz); | ||
printf("Getting %d bytes for private buffer\n", (int)*privBufferSz); | ||
#endif | ||
|
||
return sz; |
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.
sz
never changes. Could remove it and just return success here.
wolftpm/tpm2_wrap.h
Outdated
@@ -3168,11 +3168,13 @@ WOLFTPM_API int wolfTPM2_GetKeyBlobAsBuffer(byte *buffer, word32 bufferSz, | |||
|
|||
\brief Marshal data from a keyblob to a binary buffer. This can be | |||
stored to disk for loading in a separate process or after power | |||
cycling. | |||
cycling. If either buffer is NULL then the size will be returned for | |||
each part. | |||
|
|||
\return Positive integer (size of the output) |
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.
Returns is zero on success
Added support for getting the keyblob sizes. ZD 16675