Skip to content

Commit e763ccd

Browse files
committed
F-7282 - Clear the private blob when the outer wrap fails
1 parent 7188dec commit e763ccd

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/tpm2_wrap.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3413,6 +3413,10 @@ static int SensitiveToPrivate(TPM2B_SENSITIVE* sens, TPM2B_PRIVATE* priv,
34133413
(void)useIv;
34143414
rc = NOT_COMPILED_IN;
34153415
#endif
3416+
/* a failed wrap leaves the marshalled sensitive area in the clear */
3417+
if (rc != 0 && priv != NULL) {
3418+
TPM2_ForceZero(priv, sizeof(*priv));
3419+
}
34163420
return rc;
34173421
}
34183422

0 commit comments

Comments
 (0)