EVP: Modify EVP_PKEY_export() to handle legacy EVP_PKEYs
authorRichard Levitte <levitte@openssl.org>
Sat, 15 May 2021 05:45:31 +0000 (07:45 +0200)
committerMatt Caswell <matt@openssl.org>
Thu, 20 May 2021 11:57:36 +0000 (12:57 +0100)
commitf33c04b8de06aa3df22f776e3c26ad0277ed815f
tree9cafa1ea0dd319652d258f5c3c82c63574e553b4
parentbed7437b00734ee463de3c6fd6851458fa8c6cb0
EVP: Modify EVP_PKEY_export() to handle legacy EVP_PKEYs

We use a fake EVP_KEYMGMT import function with the newly modified
EVP_PKEY_ASN1_METHOD export_to function to pass the exported
OSSL_PARAM array directly to the EVP_PKEY_export() callback instead of
exporting to an actual provided key and then getting the OSSL_PARAM
array from there, just to throw away that key again.

Fixes #15290

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15293)
crypto/evp/pmeth_gn.c