Skip to content

Commit 3fa612f

Browse files
anhudgarske
authored andcommitted
Fix build errors when defining FREESCALE_MMCAU
1 parent 9ed0018 commit 3fa612f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

wolfcrypt/src/aes.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3609,6 +3609,7 @@ static WARN_UNUSED_RESULT int wc_AesDecrypt(
36093609
return wc_AesSetKey(aes, userKey, keylen, iv, dir);
36103610
}
36113611
#elif defined(FREESCALE_MMCAU)
3612+
#define NEED_SOFTWARE_AES_SETKEY
36123613
int wc_AesSetKey(Aes* aes, const byte* userKey, word32 keylen,
36133614
const byte* iv, int dir)
36143615
{
@@ -4991,6 +4992,7 @@ int wc_AesSetIV(Aes* aes, const byte* iv)
49914992
#ifdef HAVE_AES_DECRYPT
49924993
int wc_AesCbcDecrypt(Aes* aes, byte* out, const byte* in, word32 sz)
49934994
{
4995+
int ret;
49944996
int offset = 0;
49954997
byte* iv;
49964998
byte temp_block[AES_BLOCK_SIZE];
@@ -5009,7 +5011,9 @@ int wc_AesSetIV(Aes* aes, const byte* iv)
50095011
while (blocks--) {
50105012
XMEMCPY(temp_block, in + offset, AES_BLOCK_SIZE);
50115013

5012-
wc_AesDecrypt(aes, in + offset, out + offset);
5014+
ret = wc_AesDecrypt(aes, in + offset, out + offset);
5015+
if (ret != 0)
5016+
return ret;
50135017

50145018
/* XOR block with IV for CBC */
50155019
xorbuf(out + offset, iv, AES_BLOCK_SIZE);

0 commit comments

Comments
 (0)