i2b_PVK(): Use Encrypt, not Decrypt
authorRichard Levitte <levitte@openssl.org>
Tue, 26 Nov 2019 11:40:16 +0000 (12:40 +0100)
committerRichard Levitte <levitte@openssl.org>
Wed, 27 Nov 2019 19:34:13 +0000 (20:34 +0100)
commitd4f094a04a3a89319f5bf9277e79bd8d77ba10fa
tree60ae3dec872c612e5d6a7be8ff12b84fe98181fe
parent40d422fd3a685c3e1e62ab37eda1189567d000b5
i2b_PVK(): Use Encrypt, not Decrypt

We used EVP_EncryptInit_ex() to initialise, but EVP_DecryptUpdate()
and EVP_DecryptFinal_ex() to actually perform encryption.  This worked
long ago, when the Encrypt and Decrypt variants were the same, but
doesn't now (actually haven't for a very long time).

This shows how seldom PVK is actually used.

Fixes #9338

Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/10521)
crypto/pem/pvkfmt.c