Skip to content

Commit

Permalink
Fixes to avoid struct assignment, which can result is unaligned acces…
Browse files Browse the repository at this point in the history
…s (use memcpy).
  • Loading branch information
dgarske committed Oct 11, 2023
1 parent 241f554 commit e9f89db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/tpm2_wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,8 @@ int wolfTPM2_SetAuthSession(WOLFTPM2_DEV* dev, int index,

/* define the symmetric algorithm */
session->authHash = tpmSession->authHash;
session->symmetric = tpmSession->handle.symmetric;
XMEMCPY(&session->symmetric, &tpmSession->handle.symmetric,
sizeof(TPMT_SYM_DEF));

/* fresh nonce generated in TPM2_CommandProcess based on this size */
session->nonceCaller.size = TPM2_GetHashDigestSize(WOLFTPM2_WRAP_DIGEST);
Expand Down

0 comments on commit e9f89db

Please sign in to comment.