From 1430ba9b7ed82716703d92233f26a7d3d02547a4 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 16 Aug 2009 14:15:36 +0300 Subject: [PATCH] OpenSSL: Use library version of SHA256 There is no need to use the internal SHA256 implementation when using OpenSSL. --- src/crypto/crypto_openssl.c | 7 +++++++ wpa_supplicant/Makefile | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/crypto/crypto_openssl.c b/src/crypto/crypto_openssl.c index 7b5a4d2ec..fceefb12c 100644 --- a/src/crypto/crypto_openssl.c +++ b/src/crypto/crypto_openssl.c @@ -102,6 +102,13 @@ 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 openssl_digest_vector(EVP_sha256(), num_elem, addr, len, mac); +} + + void * aes_encrypt_init(const u8 *key, size_t len) { AES_KEY *ak; diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile index 78daca509..311b53787 100644 --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile @@ -732,7 +732,6 @@ OBJS_p += ../src/crypto/crypto_openssl.o ifdef NEED_FIPS186_2_PRF OBJS += ../src/crypto/fips_prf_openssl.o endif -CONFIG_INTERNAL_SHA256=y endif ifeq ($(CONFIG_TLS), gnutls) OBJS += ../src/crypto/crypto_gnutls.o