From: Shane Lontis Date: Tue, 9 Mar 2021 04:44:51 +0000 (+1000) Subject: Add ossl_pkcs5_pbkdf2_hmac_ex symbol X-Git-Tag: openssl-3.0.0-alpha14~226 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e17fb006187c1b745eb72474efb3ad797e2a4dc;p=thirdparty%2Fopenssl.git Add ossl_pkcs5_pbkdf2_hmac_ex symbol Partial fix for #12964 Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/14473) --- diff --git a/crypto/evp/p5_crpt2.c b/crypto/evp/p5_crpt2.c index d55199cccf8..183c1f6074a 100644 --- a/crypto/evp/p5_crpt2.c +++ b/crypto/evp/p5_crpt2.c @@ -19,10 +19,11 @@ #include "crypto/evp.h" #include "evp_local.h" -int pkcs5_pbkdf2_hmac_ex(const char *pass, int passlen, - const unsigned char *salt, int saltlen, int iter, - const EVP_MD *digest, int keylen, unsigned char *out, - OSSL_LIB_CTX *libctx, const char *propq) +int ossl_pkcs5_pbkdf2_hmac_ex(const char *pass, int passlen, + const unsigned char *salt, int saltlen, int iter, + const EVP_MD *digest, int keylen, + unsigned char *out, + OSSL_LIB_CTX *libctx, const char *propq) { const char *empty = ""; int rv = 1, mode = 1; @@ -82,8 +83,8 @@ int PKCS5_PBKDF2_HMAC(const char *pass, int passlen, const unsigned char *salt, int saltlen, int iter, const EVP_MD *digest, int keylen, unsigned char *out) { - return pkcs5_pbkdf2_hmac_ex(pass, passlen, salt, saltlen, iter, digest, - keylen, out, NULL, NULL); + return ossl_pkcs5_pbkdf2_hmac_ex(pass, passlen, salt, saltlen, iter, digest, + keylen, out, NULL, NULL); } diff --git a/include/crypto/evp.h b/include/crypto/evp.h index 5dd0db3bae6..751b330b43a 100644 --- a/include/crypto/evp.h +++ b/include/crypto/evp.h @@ -828,10 +828,11 @@ const EVP_CIPHER *evp_get_cipherbyname_ex(OSSL_LIB_CTX *libctx, const EVP_MD *evp_get_digestbyname_ex(OSSL_LIB_CTX *libctx, const char *name); -int pkcs5_pbkdf2_hmac_ex(const char *pass, int passlen, - const unsigned char *salt, int saltlen, int iter, - const EVP_MD *digest, int keylen, unsigned char *out, - OSSL_LIB_CTX *libctx, const char *propq); +int ossl_pkcs5_pbkdf2_hmac_ex(const char *pass, int passlen, + const unsigned char *salt, int saltlen, int iter, + const EVP_MD *digest, int keylen, + unsigned char *out, + OSSL_LIB_CTX *libctx, const char *propq); # ifndef FIPS_MODULE /* diff --git a/providers/implementations/kdfs/scrypt.c b/providers/implementations/kdfs/scrypt.c index 12c57bb1a40..2bbea0c7ccf 100644 --- a/providers/implementations/kdfs/scrypt.c +++ b/providers/implementations/kdfs/scrypt.c @@ -493,15 +493,15 @@ static int scrypt_alg(const char *pass, size_t passlen, X = (uint32_t *)(B + Blen); T = X + 32 * r; V = T + 32 * r; - if (pkcs5_pbkdf2_hmac_ex(pass, passlen, salt, saltlen, 1, sha256, (int)Blen, - B, libctx, propq) == 0) + if (ossl_pkcs5_pbkdf2_hmac_ex(pass, passlen, salt, saltlen, 1, sha256, + (int)Blen, B, libctx, propq) == 0) goto err; for (i = 0; i < p; i++) scryptROMix(B + 128 * r * i, r, N, X, T, V); - if (pkcs5_pbkdf2_hmac_ex(pass, passlen, B, (int)Blen, 1, sha256, keylen, - key, libctx, propq) == 0) + if (ossl_pkcs5_pbkdf2_hmac_ex(pass, passlen, B, (int)Blen, 1, sha256, + keylen, key, libctx, propq) == 0) goto err; rv = 1; err: