X509_PUBKEY_dup: Do not just up-ref the EVP_PKEY
authorTomas Mraz <tomas@openssl.org>
Fri, 22 Oct 2021 12:22:57 +0000 (14:22 +0200)
committerTomas Mraz <tomas@openssl.org>
Mon, 25 Oct 2021 12:34:29 +0000 (14:34 +0200)
commit1461059fe97b9abfb1c5414b314790f0bd65e0a0
tree541f79513db529724cf5e02891d815fb86bbe4fd
parentc5eae99ae7a9efaf2f554221638b9f0d13761c79
X509_PUBKEY_dup: Do not just up-ref the EVP_PKEY

We try EVP_PKEY_dup() and if it fails we re-decode it using the
legacy method as provided keys should be duplicable.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16648)

(cherry picked from commit 7e35458b511f042d9a37d49227b01096c444e575)
crypto/x509/x_pubkey.c
test/enginetest.c
test/evp_extra_test.c