Fix i2d_PKCS8PrivateKey_nid_bio() regression.
authorShane Lontis <shane.lontis@oracle.com>
Wed, 5 May 2021 06:58:37 +0000 (16:58 +1000)
committerShane Lontis <shane.lontis@oracle.com>
Mon, 10 May 2021 03:23:50 +0000 (13:23 +1000)
commitd29d7a7ff22e8e3be1c8bbdb8edd3ab9c72ed021
tree0ccdd13e9d8c5d229523a6317e2ead4568e9a21a
parent333b31e3000ff009cdc48bf45d9af687031f7688
Fix i2d_PKCS8PrivateKey_nid_bio() regression.

This method ignores the nid and could end up saving out the private key unencrypted

In earlier alpha releases OSSL_num_encoders() returned 0 for this test
case, which then meant that the legacy path was run, and the key was
then correctly encrypted.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15152)
crypto/pem/pem_pk8.c
test/evp_extra_test2.c