Skip to content

Commit 230ebc6

Browse files
committed
only zero sensitive portion of member
1 parent 4ed5d47 commit 230ebc6

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/tpm2_wrap.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,8 +1615,6 @@ static int wolfTPM2_EncryptSecret_RSA(WOLFTPM2_DEV* dev, const WOLFTPM2_KEY* tpm
16151615

16161616
wc_FreeRsaKey(&rsaKey);
16171617
wc_FreeRng(&rng);
1618-
TPM2_ForceZero(&rsaKey, sizeof(rsaKey));
1619-
TPM2_ForceZero(&rng, sizeof(rng));
16201618

16211619
if (rc > 0) {
16221620
rc = (rc == secret->size) ? 0 /* success */ : BUFFER_E /* fail */;
@@ -5897,7 +5895,7 @@ int wolfTPM2_LoadSymmetricKey(WOLFTPM2_DEV* dev, WOLFTPM2_KEY* key, int alg,
58975895

58985896
exit:
58995897

5900-
TPM2_ForceZero(&loadExtIn, sizeof(loadExtIn));
5898+
TPM2_ForceZero(&loadExtIn.inPrivate, sizeof(loadExtIn.inPrivate));
59015899

59025900
if (rc != TPM_RC_SUCCESS) {
59035901
#ifdef DEBUG_WOLFTPM
@@ -6139,7 +6137,7 @@ int wolfTPM2_LoadKeyedHashKey(WOLFTPM2_DEV* dev, WOLFTPM2_KEY* key,
61396137
(word32)key->handle.hndl);
61406138
#endif
61416139

6142-
TPM2_ForceZero(&createIn, sizeof(createIn));
6140+
TPM2_ForceZero(&createIn.inSensitive, sizeof(createIn.inSensitive));
61436141

61446142
return rc;
61456143
}

0 commit comments

Comments
 (0)