aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2017-12-27 21:19:32 (GMT)
committerJouni Malinen <j@w1.fi>2017-12-27 21:21:37 (GMT)
commit85c12a62ee167946cecbc065f78d4bb674de16ca (patch)
tree69238502f468d989a919b9313084fa0e50232e36
parentcc3e7bfc3c567fd5bf15b9c7a1e97e5d046f37ea (diff)
downloadhostap-85c12a62ee167946cecbc065f78d4bb674de16ca.zip
hostap-85c12a62ee167946cecbc065f78d4bb674de16ca.tar.gz
hostap-85c12a62ee167946cecbc065f78d4bb674de16ca.tar.bz2
GnuTLS: Implement sha{256,384,512}_vector() using libgcrypt
Replace the internal SHA256 implementation with the one from libgcrypt and also add the SHA384 and SHA512 versions. Signed-off-by: Jouni Malinen <j@w1.fi>
-rw-r--r--hostapd/Android.mk1
-rw-r--r--hostapd/Makefile1
-rw-r--r--src/crypto/crypto_gnutls.c20
-rw-r--r--wpa_supplicant/Android.mk1
-rw-r--r--wpa_supplicant/Makefile1
5 files changed, 19 insertions, 5 deletions
diff --git a/hostapd/Android.mk b/hostapd/Android.mk
index 6a62d39..c185aed 100644
--- a/hostapd/Android.mk
+++ b/hostapd/Android.mk
@@ -651,7 +651,6 @@ OBJS += src/crypto/sha1-internal.c
endif
LIBS += -lgcrypt
LIBS_h += -lgcrypt
-CONFIG_INTERNAL_SHA256=y
CONFIG_INTERNAL_RC4=y
CONFIG_INTERNAL_DH_GROUP5=y
endif
diff --git a/hostapd/Makefile b/hostapd/Makefile
index cb146da..456c9b4 100644
--- a/hostapd/Makefile
+++ b/hostapd/Makefile
@@ -689,7 +689,6 @@ SHA1OBJS += ../src/crypto/sha1-internal.o
endif
LIBS += -lgcrypt
LIBS_h += -lgcrypt
-CONFIG_INTERNAL_SHA256=y
CONFIG_INTERNAL_RC4=y
CONFIG_INTERNAL_DH_GROUP5=y
endif
diff --git a/src/crypto/crypto_gnutls.c b/src/crypto/crypto_gnutls.c
index aca7792..3fe774c 100644
--- a/src/crypto/crypto_gnutls.c
+++ b/src/crypto/crypto_gnutls.c
@@ -1,6 +1,6 @@
/*
* WPA Supplicant / wrapper functions for libgcrypt
- * Copyright (c) 2004-2009, Jouni Malinen <j@w1.fi>
+ * Copyright (c) 2004-2017, Jouni Malinen <j@w1.fi>
*
* This software may be distributed under the terms of the BSD license.
* See README for more details.
@@ -72,6 +72,24 @@ int sha1_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)
}
+int sha256_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)
+{
+ return gnutls_digest_vector(GCRY_MD_SHA256, num_elem, addr, len, mac);
+}
+
+
+int sha384_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)
+{
+ return gnutls_digest_vector(GCRY_MD_SHA384, num_elem, addr, len, mac);
+}
+
+
+int sha512_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)
+{
+ return gnutls_digest_vector(GCRY_MD_SHA512, num_elem, addr, len, mac);
+}
+
+
void * aes_encrypt_init(const u8 *key, size_t len)
{
gcry_cipher_hd_t hd;
diff --git a/wpa_supplicant/Android.mk b/wpa_supplicant/Android.mk
index 12e0bb9..ed3dd73 100644
--- a/wpa_supplicant/Android.mk
+++ b/wpa_supplicant/Android.mk
@@ -1051,7 +1051,6 @@ OBJS += src/crypto/sha1-internal.c
endif
LIBS += -lgcrypt
LIBS_p += -lgcrypt
-CONFIG_INTERNAL_SHA256=y
CONFIG_INTERNAL_RC4=y
CONFIG_INTERNAL_DH_GROUP5=y
endif
diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
index 2ec011f..e60a05c 100644
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -1095,7 +1095,6 @@ SHA1OBJS += ../src/crypto/sha1-internal.o
endif
LIBS += -lgcrypt
LIBS_p += -lgcrypt
-CONFIG_INTERNAL_SHA256=y
CONFIG_INTERNAL_RC4=y
CONFIG_INTERNAL_DH_GROUP5=y
endif