Fixes to avoid struct assignment, which can result is unaligned access (use memcpy).

pull/303/head
David Garske 2023-10-04 14:35:21 -07:00
parent 241f55415c
commit e9f89db538
1 changed files with 2 additions and 1 deletions

View File

@ -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);