Skip to content

Commit 23363d7

Browse files
committed
Address review: set keyInstalled in FREESCALE_LTC/MMCAU key setup (F-6151)
The keyInstalled guard added to the shared aes.c mode functions is set by every in-aes.c key-schedule branch except FREESCALE_LTC and FREESCALE_MMCAU. Their wc_AesSetKeyLocal installs the key but left keyInstalled at 0, so any guarded AES mode that falls through to a shared aes.c path returned an error after a valid key setup on those ports. Set keyInstalled at the key-install point in both branches, matching the other ports fixed earlier in this PR.
1 parent 5482e84 commit 23363d7

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

wolfcrypt/src/aes.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4650,6 +4650,7 @@ static WARN_UNUSED_RESULT int wc_AesDecrypt(Aes* aes, const byte* inBlock,
46504650

46514651
aes->rounds = keylen/4 + 6;
46524652
XMEMCPY(aes->key, userKey, keylen);
4653+
aes->keyInstalled = 1;
46534654

46544655
#if defined(WOLFSSL_AES_COUNTER) || defined(WOLFSSL_AES_CFB) || \
46554656
defined(WOLFSSL_AES_OFB) || defined(WOLFSSL_AES_XTS) || \
@@ -5158,6 +5159,8 @@ static WARN_UNUSED_RESULT int wc_AesDecrypt(Aes* aes, const byte* inBlock,
51585159
#endif
51595160
wolfSSL_CryptHwMutexUnLock();
51605161

5162+
aes->keyInstalled = 1;
5163+
51615164
ret = wc_AesSetIV(aes, iv);
51625165
}
51635166

0 commit comments

Comments
 (0)