From ba8d1962c753e4973690fc2c4de5aec099d6c67b Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 9 Nov 2018 09:26:01 -0800 Subject: [PATCH] Fix for test case `wc_AesInit` with bad argument. Adds bad arg check for API in FIPS mode. --- wolfcrypt/src/aes.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index b7ee99a22..8e1d9677e 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -233,11 +233,14 @@ #endif /* HAVE_AES_DECRYPT */ #endif /* HAVE_AESCCM && HAVE_FIPS_VERSION 2 */ - int wc_AesInit(Aes* aes, void* h, int i) + int wc_AesInit(Aes* aes, void* h, int i) { - (void)aes; + if (aes == NULL) + return BAD_FUNC_ARG; + (void)h; (void)i; + /* FIPS doesn't support: return AesInit(aes, h, i); */ return 0;