EVP: Adapt EVP_PKEY2PKCS8() to better handle provider-native keys
authorRichard Levitte <levitte@openssl.org>
Fri, 25 Sep 2020 18:02:56 +0000 (20:02 +0200)
committerRichard Levitte <levitte@openssl.org>
Fri, 13 Nov 2020 08:20:12 +0000 (09:20 +0100)
commit31a6b52f6db009c639c67387a707dd235f29a430
treee4edb9558f820f21021e46d01d2a40a22de5bd03
parent0bb450fe2fa9597ce8206cdd8177c5bd9aa15786
EVP: Adapt EVP_PKEY2PKCS8() to better handle provider-native keys

It doesn't downgread the keys to legacy any more.  Instead, it uses
OSSL_ENCODER to encode the key to DER, and d2i_PKCS8_PRIV_KEY_INFO()
to make a PKCS8_PRIV_KEY_INFO structure from that.

Fixes #12990

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12995)
crypto/evp/evp_pkey.c