summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-08-03 21:09:26 +0200
committerRichard Levitte <levitte@openssl.org>2020-08-07 04:13:28 +0200
commitdca51418b0186c1d829b04ce89990148fbedbf9c (patch)
tree9e09b28a1ec43688a6dbffefeceeead0d897e744
parent37d398c180cd30f69a9d122af4734852309b55a5 (diff)
PEM: Fix i2b_PvK to use EVP_Encrypt calls consistently
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12574)
-rw-r--r--crypto/pem/pvkfmt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/pem/pvkfmt.c b/crypto/pem/pvkfmt.c
index 3745a1c1e3..95d1ff5a94 100644
--- a/crypto/pem/pvkfmt.c
+++ b/crypto/pem/pvkfmt.c
@@ -859,9 +859,9 @@ static int i2b_PVK(unsigned char **out, const EVP_PKEY *pk, int enclevel,
if (!EVP_EncryptInit_ex(cctx, EVP_rc4(), NULL, keybuf, NULL))
goto error;
OPENSSL_cleanse(keybuf, 20);
- if (!EVP_DecryptUpdate(cctx, p, &enctmplen, p, pklen - 8))
+ if (!EVP_EncryptUpdate(cctx, p, &enctmplen, p, pklen - 8))
goto error;
- if (!EVP_DecryptFinal_ex(cctx, p + enctmplen, &enctmplen))
+ if (!EVP_EncryptFinal_ex(cctx, p + enctmplen, &enctmplen))
goto error;
}