mirror of https://github.com/wolfSSL/wolfBoot.git
F-9768: rot: scrub NV auth and session state at exit
The TPM NV auth copy and the HMAC session state lived on the stack until process teardown. Zeroize both at the common exit label after the TPM device is unloaded, on success and error paths alike.pull/892/head
parent
483facf339
commit
b97d94deeb
|
|
@ -204,6 +204,11 @@ exit:
|
|||
wolfTPM2_UnloadHandle(&dev, &tpmSession.handle);
|
||||
wolfTPM2_Cleanup(&dev);
|
||||
|
||||
/* Scrub the NV auth copy and the session state from the stack on
|
||||
* every exit path. */
|
||||
wc_ForceZero(&nv, sizeof(nv));
|
||||
wc_ForceZero(&tpmSession, sizeof(tpmSession));
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue