From 0d5a77234806fd9f4adb07a54421f69da95be667 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Tue, 19 Dec 2017 11:49:30 -0700 Subject: [PATCH 1/2] revert macro to allow AES keywrap and AES XTS with ARM assembly --- wolfcrypt/src/aes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index 114ddc4d7..f44bcf4f4 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -27,7 +27,7 @@ #include #include -#if !defined(NO_AES) && !defined(WOLFSSL_ARMASM) +#if !defined(NO_AES) #include #include From 89e57f41597ba5cbfb33200450bfaa768a28d2a3 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Tue, 19 Dec 2017 11:55:40 -0700 Subject: [PATCH 2/2] protect against AES-CCM copy to smaller local buffer --- wolfcrypt/src/aes.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index f44bcf4f4..9acbaa54f 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -7348,7 +7348,8 @@ int wc_AesCcmEncrypt(Aes* aes, byte* out, const byte* in, word32 inSz, /* sanity check on arguments */ if (aes == NULL || out == NULL || in == NULL || nonce == NULL - || authTag == NULL || nonceSz < 7 || nonceSz > 13) + || authTag == NULL || nonceSz < 7 || nonceSz > 13 || + authTagSz > AES_BLOCK_SIZE) return BAD_FUNC_ARG; XMEMCPY(B+1, nonce, nonceSz); @@ -7416,7 +7417,8 @@ int wc_AesCcmDecrypt(Aes* aes, byte* out, const byte* in, word32 inSz, /* sanity check on arguments */ if (aes == NULL || out == NULL || in == NULL || nonce == NULL - || authTag == NULL || nonceSz < 7 || nonceSz > 13) + || authTag == NULL || nonceSz < 7 || nonceSz > 13 || + authTagSz > AES_BLOCK_SIZE) return BAD_FUNC_ARG; o = out;