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

Secure Boot (Root of Trust) - Part 2 #289

Merged
merged 2 commits into from
Aug 11, 2023
Merged

Conversation

dgarske
Copy link
Contributor

@dgarske dgarske commented Aug 10, 2023

  • Fix for wolfTPM2_EncryptSecret to not loose error code.
  • Avoid using heap (malloc/free) for ecc_point.

@dgarske dgarske assigned dgarske and jpbland1 and unassigned dgarske Aug 10, 2023
@dgarske dgarske requested a review from jpbland1 August 11, 2023 18:47
src/tpm2_wrap.c Outdated
@@ -1063,6 +1068,9 @@ static int wolfTPM2_EncryptSecret_ECC(WOLFTPM2_DEV* dev, const WOLFTPM2_KEY* tpm
XMEMSET(&eccKeyPriv, 0, sizeof(eccKeyPriv));
XMEMSET(&pubPoint, 0, sizeof(pubPoint));
XMEMSET(&secretPoint, 0, sizeof(secretPoint));
XMEMSET(&r, 0, sizeof(r));
Copy link
Contributor

Choose a reason for hiding this comment

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

r is already pointer type, does de-referencing here point XMEMSET to the buffer or a pointer to the buffer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch (this was r directly, then I changed to avoid altering code from r. to r->. I think the behavior is the same. Point to start of array vs pointer to first element in array (same). Pushed fix.

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.

Reviewed and re-ran the rot example

@jpbland1 jpbland1 merged commit 456424d into wolfSSL:master Aug 11, 2023
1 check passed
@dgarske dgarske deleted the secure_rot2 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