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 nonce from TPM hardware #216

Merged
merged 3 commits into from
Jul 1, 2022
Merged

Conversation

dgarske
Copy link
Contributor

@dgarske dgarske commented Jun 30, 2022

  • Fixes for nonce from TPM hardware (when using no wolfCrypt RNG WOLFTPM2_USE_HW_RNG).
  • Add support for custom packet buffer
  • Add lock count tracking
  • Add crypto callback support for seeding RNG with TPM.

@dgarske dgarske self-assigned this Jun 30, 2022
@dgarske dgarske requested a review from embhorn June 30, 2022 23:44
@dgarske dgarske assigned embhorn and unassigned dgarske Jun 30, 2022
Copy link
Member

@embhorn embhorn left a comment

Choose a reason for hiding this comment

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

Test success with
./configure CFLAGS="-DWOLFTPM2_USE_WOLF_RNG" && make

src/tpm2.c Outdated
ret = wc_LockMutex(&ctx->hwLock);
if (ret != 0)
return TPM_RC_FAILURE;
if (++ctx->lockCount == 1) {
Copy link
Member

Choose a reason for hiding this comment

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

Operations inside conditionals should be avoided due to potential compiler optimization issues. Applies to other lines below also.

src/tpm2.c Show resolved Hide resolved
@dgarske dgarske requested a review from embhorn July 1, 2022 15:51
Copy link
Member

@embhorn embhorn left a comment

Choose a reason for hiding this comment

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

Great!

@embhorn embhorn merged commit ea97653 into wolfSSL:master Jul 1, 2022
@dgarske dgarske deleted the tpm_rng branch July 1, 2022 16:38
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