aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hostapd/Android.mk2
-rw-r--r--hostapd/Makefile2
-rw-r--r--src/crypto/crypto_openssl.c10
-rw-r--r--wpa_supplicant/Android.mk2
-rw-r--r--wpa_supplicant/Makefile2
5 files changed, 18 insertions, 0 deletions
diff --git a/hostapd/Android.mk b/hostapd/Android.mk
index eee13e3..73caa88 100644
--- a/hostapd/Android.mk
+++ b/hostapd/Android.mk
@@ -676,7 +676,9 @@ ifdef NEED_FIPS186_2_PRF
SHA1OBJS += src/crypto/fips_prf_internal.c
endif
endif
+ifneq ($(CONFIG_TLS), openssl)
SHA1OBJS += src/crypto/sha1-pbkdf2.c
+endif
ifdef NEED_T_PRF
SHA1OBJS += src/crypto/sha1-tprf.c
endif
diff --git a/hostapd/Makefile b/hostapd/Makefile
index f1154ab..c58cc79 100644
--- a/hostapd/Makefile
+++ b/hostapd/Makefile
@@ -667,7 +667,9 @@ ifdef NEED_FIPS186_2_PRF
SHA1OBJS += ../src/crypto/fips_prf_internal.o
endif
endif
+ifneq ($(CONFIG_TLS), openssl)
SHA1OBJS += ../src/crypto/sha1-pbkdf2.o
+endif
ifdef NEED_T_PRF
SHA1OBJS += ../src/crypto/sha1-tprf.o
endif
diff --git a/src/crypto/crypto_openssl.c b/src/crypto/crypto_openssl.c
index 77ea735..66cf840 100644
--- a/src/crypto/crypto_openssl.c
+++ b/src/crypto/crypto_openssl.c
@@ -688,3 +688,13 @@ int crypto_hash_finish(struct crypto_hash *ctx, u8 *mac, size_t *len)
return -1;
}
+
+
+int pbkdf2_sha1(const char *passphrase, const u8 *ssid, size_t ssid_len,
+ int iterations, u8 *buf, size_t buflen)
+{
+ if (PKCS5_PBKDF2_HMAC_SHA1(passphrase, os_strlen(passphrase), ssid,
+ ssid_len, 4096, buflen, buf) != 1)
+ return -1;
+ return 0;
+}
diff --git a/wpa_supplicant/Android.mk b/wpa_supplicant/Android.mk
index c45a510..94a3d96 100644
--- a/wpa_supplicant/Android.mk
+++ b/wpa_supplicant/Android.mk
@@ -1064,8 +1064,10 @@ endif
ifdef CONFIG_NO_WPA_PASSPHRASE
L_CFLAGS += -DCONFIG_NO_PBKDF2
else
+ifneq ($(CONFIG_TLS), openssl)
SHA1OBJS += src/crypto/sha1-pbkdf2.c
endif
+endif
ifdef NEED_T_PRF
SHA1OBJS += src/crypto/sha1-tprf.c
endif
diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
index cf525ac..7a6d8a3 100644
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -1091,8 +1091,10 @@ endif
ifdef CONFIG_NO_WPA_PASSPHRASE
CFLAGS += -DCONFIG_NO_PBKDF2
else
+ifneq ($(CONFIG_TLS), openssl)
SHA1OBJS += ../src/crypto/sha1-pbkdf2.o
endif
+endif
ifdef NEED_T_PRF
SHA1OBJS += ../src/crypto/sha1-tprf.o
endif