Skip to content

Commit

Permalink
Fix for wolfTPM2_GetRng not properly returning an initialized WC_RNG.
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarske committed Nov 28, 2023
1 parent 119b6f2 commit 3d28d90
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/tpm2_wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -4519,12 +4519,13 @@ int wolfTPM2_NVDelete(WOLFTPM2_DEV* dev, TPM_HANDLE authHandle,
#ifndef WOLFTPM2_NO_WOLFCRYPT
struct WC_RNG* wolfTPM2_GetRng(WOLFTPM2_DEV* dev)
{
WC_RNG* rng = NULL;
if (dev) {
#ifdef WOLFTPM2_USE_WOLF_RNG
return &dev->ctx.rng;
(void)TPM2_GetWolfRng(&rng);
#endif
}
return NULL;
return rng;
}
#endif

Expand Down

0 comments on commit 3d28d90

Please sign in to comment.