Skip to content

Commit e6e2304

Browse files
committed
Fix Fenrir F-1758/F-1759/F-1760: ECDH output cleanup on return
1 parent d81d7f5 commit e6e2304

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/tpm2_wrap.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4560,6 +4560,7 @@ int wolfTPM2_ECDHGen(WOLFTPM2_DEV* dev, WOLFTPM2_KEY* privKey,
45604560
ecdhOut.pubPoint.size);
45614561
#endif
45624562

4563+
TPM2_ForceZero(&ecdhOut, sizeof(ecdhOut));
45634564
return rc;
45644565
}
45654566

@@ -4609,6 +4610,7 @@ int wolfTPM2_ECDHGenZ(WOLFTPM2_DEV* dev, WOLFTPM2_KEY* privKey,
46094610
printf("TPM2_ECDH_ZGen: zPt %d\n", ecdhZOut.outPoint.size);
46104611
#endif
46114612

4613+
TPM2_ForceZero(&ecdhZOut, sizeof(ecdhZOut));
46124614
return rc;
46134615
}
46144616

@@ -4699,6 +4701,7 @@ int wolfTPM2_ECDHEGenZ(WOLFTPM2_DEV* dev, WOLFTPM2_KEY* parentKey,
46994701
printf("TPM2_ZGen_2Phase: zPt %d\n", outZGen2Ph.outZ2.size);
47004702
#endif
47014703

4704+
TPM2_ForceZero(&outZGen2Ph, sizeof(outZGen2Ph));
47024705
return rc;
47034706
}
47044707

0 commit comments

Comments
 (0)