aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorPauli <pauli@openssl.org>2021-04-15 10:35:08 +1000
committerPauli <pauli@openssl.org>2021-04-21 09:27:51 +1000
commit3f700d4b95f249308e03c0f1fcb3c9620dad94fe (patch)
tree9ca0fe64fb49a905f9cf708f02366d8a8024f069 /crypto
parente27fea4640defe3adc9309a4b573101055228ef3 (diff)
downloadopenssl-3f700d4b95f249308e03c0f1fcb3c9620dad94fe.tar.gz
pem: remove references to EVP_sha1()
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14881)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/pem/pvkfmt.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/crypto/pem/pvkfmt.c b/crypto/pem/pvkfmt.c
index 432fd34618..51d3ec476b 100644
--- a/crypto/pem/pvkfmt.c
+++ b/crypto/pem/pvkfmt.c
@@ -795,16 +795,19 @@ static int derive_pvk_key(unsigned char *key,
const unsigned char *pass, int passlen)
{
EVP_MD_CTX *mctx = EVP_MD_CTX_new();
+ EVP_MD *md = EVP_MD_fetch(NULL, SN_sha1, NULL);
int rv = 1;
- if (mctx == NULL
- || !EVP_DigestInit_ex(mctx, EVP_sha1(), NULL)
+ if (md == NULL
+ || mctx == NULL
+ || !EVP_DigestInit_ex(mctx, md, NULL)
|| !EVP_DigestUpdate(mctx, salt, saltlen)
|| !EVP_DigestUpdate(mctx, pass, passlen)
|| !EVP_DigestFinal_ex(mctx, key, NULL))
rv = 0;
EVP_MD_CTX_free(mctx);
+ EVP_MD_free(md);
return rv;
}
#endif