Skip to content

Commit d81d7f5

Browse files
committed
Fix Fenrir F-2159: wolfTPM2_SetAuthSession nonce handling
1 parent d20af38 commit d81d7f5

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/tpm2_wrap.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,6 +1187,8 @@ int wolfTPM2_SetAuthSession(WOLFTPM2_DEV* dev, int index,
11871187

11881188
/* Capture TPM provided nonce */
11891189
session->nonceTPM.size = tpmSession->nonceTPM.size;
1190+
if (session->nonceTPM.size > (UINT16)sizeof(session->nonceTPM.buffer))
1191+
session->nonceTPM.size = (UINT16)sizeof(session->nonceTPM.buffer);
11901192
XMEMCPY(session->nonceTPM.buffer, tpmSession->nonceTPM.buffer,
11911193
session->nonceTPM.size);
11921194

0 commit comments

Comments
 (0)