Skip to content

Commit 681a75d

Browse files
fix for AES-GCM use with petalinux
1 parent d87bb14 commit 681a75d

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

wolfcrypt/src/aes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9802,7 +9802,7 @@ int wc_AesInit(Aes* aes, void* heap, int devId)
98029802
aes->heap, devId);
98039803
#endif /* WOLFSSL_ASYNC_CRYPT */
98049804

9805-
#ifdef WOLFSSL_AFALG
9805+
#if defined(WOLFSSL_AFALG) || defined(WOLFSSL_AFALG_XILINX_AES)
98069806
aes->alFd = WC_SOCK_NOTSET;
98079807
aes->rdFd = WC_SOCK_NOTSET;
98089808
#endif

wolfcrypt/src/port/af_alg/afalg_aes.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ static int wc_AesSetup(Aes* aes, const char* type, const char* name, int ivSz, i
7171
aes->rdFd = WC_SOCK_NOTSET;
7272
return WC_AFALG_SOCK_E;
7373
}
74+
#ifdef WOLFSSL_AFALG_XILINX_AES
75+
ForceZero(key, sizeof(aes->msgBuf));
76+
#else
7477
ForceZero(key, sizeof(aes->key));
78+
#endif
7579

7680
/* set up CMSG headers */
7781
XMEMSET((byte*)&(aes->msg), 0, sizeof(struct msghdr));

0 commit comments

Comments
 (0)