From: Jouni Malinen Date: Mon, 5 Jan 2015 15:27:08 +0000 (+0200) Subject: OpenSSL: Fix pbkdf2_sha1() wrapper X-Git-Tag: hostap_2_4~533 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a90c7d91a0e57f3a6d93549dab9f7f86a7349051;p=thirdparty%2Fhostap.git OpenSSL: Fix pbkdf2_sha1() wrapper This was supposed to use the iterations parameter from the caller instead of the hardcoded 4096. In practice, this did not have problems for normal uses since that 4096 value was used in all cases. Signed-off-by: Jouni Malinen --- diff --git a/src/crypto/crypto_openssl.c b/src/crypto/crypto_openssl.c index b4c59d180..69fcf9bed 100644 --- a/src/crypto/crypto_openssl.c +++ b/src/crypto/crypto_openssl.c @@ -693,11 +693,11 @@ int pbkdf2_sha1(const char *passphrase, const u8 *ssid, size_t ssid_len, #if OPENSSL_VERSION_NUMBER < 0x00908000 if (PKCS5_PBKDF2_HMAC_SHA1(passphrase, os_strlen(passphrase), (unsigned char *) ssid, - ssid_len, 4096, buflen, buf) != 1) + ssid_len, iterations, buflen, buf) != 1) return -1; #else /* openssl < 0.9.8 */ if (PKCS5_PBKDF2_HMAC_SHA1(passphrase, os_strlen(passphrase), ssid, - ssid_len, 4096, buflen, buf) != 1) + ssid_len, iterations, buflen, buf) != 1) return -1; #endif /* openssl < 0.9.8 */ return 0;