mirror of
https://github.com/openssl/openssl.git
synced 2025-03-07 19:38:33 +08:00
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)
This commit is contained in:
parent
37d398c180
commit
dca51418b0
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user