Skip to content
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

Merged
merged 2 commits into from
Dec 8, 2023

Conversation

dgarske
Copy link
Contributor

@dgarske dgarske commented Dec 6, 2023

Added support for getting the keyblob sizes. ZD 16675

@dgarske dgarske assigned dgarske and embhorn and unassigned dgarske Dec 6, 2023
@dgarske dgarske requested a review from embhorn December 8, 2023 18:22
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));
Copy link
Member

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;
Copy link
Member

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.

@@ -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)
Copy link
Member

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

@dgarske dgarske requested a review from embhorn December 8, 2023 20:00
@embhorn embhorn merged commit 233bd33 into wolfSSL:master Dec 8, 2023
1 check passed
@dgarske dgarske deleted the keyblob_tests branch December 29, 2023 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants