aboutsummaryrefslogtreecommitdiffstats
path: root/src/crypto/sha1-internal.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-11-29 19:01:33 (GMT)
committerJouni Malinen <j@w1.fi>2015-11-29 19:01:33 (GMT)
commit07555778a77200e850be528fdb5c0f9d215f22e8 (patch)
treeb0f1b694ee8fc1d37d4ce14370a3878132c24238 /src/crypto/sha1-internal.c
parent089e7ca372cee1bc48835ff3e9993f8070b23160 (diff)
downloadhostap-07555778a77200e850be528fdb5c0f9d215f22e8.zip
hostap-07555778a77200e850be528fdb5c0f9d215f22e8.tar.gz
hostap-07555778a77200e850be528fdb5c0f9d215f22e8.tar.bz2
Add TEST_FAIL() support for internal hash functions
md4_vector(), md5_vector(), sha1_vector(), and sha256_vector() already supported TEST_FAIL() with the OpenSSL crypto implementation, but the same test functionality is needed for the internal crypto implementation as well. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/crypto/sha1-internal.c')
-rw-r--r--src/crypto/sha1-internal.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/crypto/sha1-internal.c b/src/crypto/sha1-internal.c
index 24bc3ff..f6658e6 100644
--- a/src/crypto/sha1-internal.c
+++ b/src/crypto/sha1-internal.c
@@ -33,6 +33,9 @@ int sha1_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)
SHA1_CTX ctx;
size_t i;
+ if (TEST_FAIL())
+ return -1;
+
SHA1Init(&ctx);
for (i = 0; i < num_elem; i++)
SHA1Update(&ctx, addr[i], len[i]);