]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
GnuTLS: Implement sha{256,384,512}_vector() using libgcrypt
authorJouni Malinen <j@w1.fi>
Wed, 27 Dec 2017 21:19:32 +0000 (23:19 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 27 Dec 2017 21:21:37 +0000 (23:21 +0200)
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>
hostapd/Android.mk
hostapd/Makefile
src/crypto/crypto_gnutls.c
wpa_supplicant/Android.mk
wpa_supplicant/Makefile

index 6a62d3928519616538d00f77158cdd3f3e91680e..c185aed280809d20d4ce7c98314c1fdd46cfb86e 100644 (file)
@@ -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
index cb146dabd2c877a38c09aef55a850485a170e023..456c9b4385632b6a31ee531a797a89e80d7cf0ed 100644 (file)
@@ -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
index aca7792d1a1557eb35ff327a348360e6ec3f0fe1..3fe774c5cef32f337aa22d6d3783135340475700 100644 (file)
@@ -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;
index 12e0bb94ce75e6fe78482077a83850bf863f091b..ed3dd734e300276648fb3b2675bba543eb3def1a 100644 (file)
@@ -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
index 2ec011fc55e292f0d82273eeb945bacf57fe93e5..e60a05c95533f64c8fd9d65c4088e55628b0b9a6 100644 (file)
@@ -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