Fix async issue with AES set key trying to use a NULL IV.

This commit is contained in:
David Garske 2017-08-07 17:47:59 -07:00
parent d195009dcb
commit f27b3a83aa

View File

@ -2144,7 +2144,8 @@ static void wc_AesDecrypt(Aes* aes, const byte* inBlock, byte* outBlock)
#if defined(WOLFSSL_ASYNC_CRYPT) && defined(WC_ASYNC_ENABLE_AES) #if defined(WOLFSSL_ASYNC_CRYPT) && defined(WC_ASYNC_ENABLE_AES)
if (aes->asyncDev.marker == WOLFSSL_ASYNC_MARKER_AES) { if (aes->asyncDev.marker == WOLFSSL_ASYNC_MARKER_AES) {
XMEMCPY(aes->asyncKey, userKey, keylen); XMEMCPY(aes->asyncKey, userKey, keylen);
XMEMCPY(aes->asyncIv, iv, AES_BLOCK_SIZE); if (iv)
XMEMCPY(aes->asyncIv, iv, AES_BLOCK_SIZE);
} }
#endif /* WOLFSSL_ASYNC_CRYPT */ #endif /* WOLFSSL_ASYNC_CRYPT */