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

Fixes for TPM private key import with custom seed #281

Merged
merged 4 commits into from
Jul 20, 2023

Conversation

dgarske
Copy link
Contributor

@dgarske dgarske commented Jul 19, 2023

  • Fix for import of private key with seed.
  • Added new API wolfTPM2_ImportPrivateKeyBuffer for importing private key ECC/RSA in either PEM or DER(ASN.1).

ZD 16249

…rtPrivateKeyBuffer` for importing private key ECC/RSA in either PEM or DER(ASN.1). ZD16249
@dgarske dgarske self-assigned this Jul 19, 2023
@dgarske dgarske marked this pull request as ready for review July 19, 2023 20:22
@dgarske dgarske requested a review from jpbland1 July 19, 2023 20:22
src/tpm2_wrap.c Outdated
#else
(void)dev;
(void)in;
(void)salt;
rc = NOT_COMPILED_IN;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wolfTPM2_EncryptSalt is always returning NOT_COMPILED_IN, I think this rc = NOT_COMPILED_IN is from the old code and you just missed deleting this line

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually now that I look at it why was that else macro removed? if WOLFTPM2_NO_WOLFCRYPT is defined rc will be undefined before return, you could probably change it to int rc = NOT_COMPILED_IN; at the start of the function

Copy link
Contributor

@jpbland1 jpbland1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check my comment on wolfTPM2_EncryptSalt

@dgarske dgarske requested a review from jpbland1 July 20, 2023 19:28
Copy link
Contributor

@jpbland1 jpbland1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compiled and ran

@jpbland1 jpbland1 merged commit 5e173bc into wolfSSL:master Jul 20, 2023
1 check passed
@dgarske dgarske deleted the tpm_import branch December 29, 2023 17:43
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