aboutsummaryrefslogtreecommitdiffstats
path: root/src/crypto/sha1-internal.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2014-03-11 14:33:05 (GMT)
committerJouni Malinen <j@w1.fi>2014-03-11 14:44:22 (GMT)
commit09eef142eabb14d3f4242af7aafb909dd9cda9b8 (patch)
tree6a35dcabc85904959a8cf0d4b37bb05a06a72371 /src/crypto/sha1-internal.c
parent9b3e2ad3a7bd8a4d1aeed97c3c6a216dcd741dc8 (diff)
downloadhostap-09eef142eabb14d3f4242af7aafb909dd9cda9b8.zip
hostap-09eef142eabb14d3f4242af7aafb909dd9cda9b8.tar.gz
hostap-09eef142eabb14d3f4242af7aafb909dd9cda9b8.tar.bz2
Use internal FIPS 186-2 PRF if needed
Previously, EAP-SIM/AKA/AKA' did not work with number of crypto libraries (GnuTLS, CryptoAPI, NSS) since the required FIPS 186-2 PRF function was not implemented. This resulted in somewhat confusing error messages since the placeholder functions were silently returning an error. Fix this by using the internal implementation of FIP 186-2 PRF (including internal SHA-1 implementation) with crypto libraries that do not implement this in case EAP-SIM/AKA/AKA' is included in the build. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'src/crypto/sha1-internal.c')
-rw-r--r--src/crypto/sha1-internal.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/crypto/sha1-internal.c b/src/crypto/sha1-internal.c
index 10bf153..24bc3ff 100644
--- a/src/crypto/sha1-internal.c
+++ b/src/crypto/sha1-internal.c
@@ -19,6 +19,7 @@ typedef struct SHA1Context SHA1_CTX;
void SHA1Transform(u32 state[5], const unsigned char buffer[64]);
+#ifdef CONFIG_CRYPTO_INTERNAL
/**
* sha1_vector - SHA-1 hash for data vector
* @num_elem: Number of elements in the data vector
@@ -38,6 +39,7 @@ int sha1_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)
SHA1Final(mac, &ctx);
return 0;
}
+#endif /* CONFIG_CRYPTO_INTERNAL */
/* ===== start - public domain SHA1 implementation ===== */