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:32:43 +0000 (14:32 +0200)
commit7e35458b511f042d9a37d49227b01096c444e575
treec7bffc1a142a8d17851b16ac858024d74af3ba19
parente0c5184a56b6580127b39774f9e4e0f2caef696e
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)
crypto/x509/x_pubkey.c
test/enginetest.c
test/evp_extra_test.c