From: Jouni Malinen Date: Sat, 17 Oct 2015 17:21:24 +0000 (+0300) Subject: tests: Add TEST_FAIL() condition to omac1_aes_vector() X-Git-Tag: hostap_2_6~1492 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc4f3d6ea781af9129c2a662c249355557cf0ec1;p=thirdparty%2Fhostap.git tests: Add TEST_FAIL() condition to omac1_aes_vector() This enables more error path testing. Signed-off-by: Jouni Malinen --- diff --git a/src/crypto/aes-omac1.c b/src/crypto/aes-omac1.c index 375db5735..864251634 100644 --- a/src/crypto/aes-omac1.c +++ b/src/crypto/aes-omac1.c @@ -48,6 +48,9 @@ int omac1_aes_vector(const u8 *key, size_t key_len, size_t num_elem, const u8 *pos, *end; size_t i, e, left, total_len; + if (TEST_FAIL()) + return -1; + ctx = aes_encrypt_init(key, key_len); if (ctx == NULL) return -1; diff --git a/src/crypto/crypto_openssl.c b/src/crypto/crypto_openssl.c index 7dd1a8f0b..9e344d1de 100644 --- a/src/crypto/crypto_openssl.c +++ b/src/crypto/crypto_openssl.c @@ -898,6 +898,9 @@ int omac1_aes_vector(const u8 *key, size_t key_len, size_t num_elem, int ret = -1; size_t outlen, i; + if (TEST_FAIL()) + return -1; + ctx = CMAC_CTX_new(); if (ctx == NULL) return -1;