When using PEM_read_bio_PrivateKey_ex() the public key is optional
authorTomas Mraz <tomas@openssl.org>
Wed, 26 Oct 2022 09:29:49 +0000 (11:29 +0200)
committerTomas Mraz <tomas@openssl.org>
Fri, 25 Nov 2022 09:33:04 +0000 (10:33 +0100)
commite7a7aa783485d2756557b6caa848cb3104fe4f56
treee666a6b5b3d1a21c1ef75bee7a6ef5041bde59d6
parente2cf38527338bdd2afea82cc16432963dd9747a2
When using PEM_read_bio_PrivateKey_ex() the public key is optional

Fixes #19498

However the private key part is not optional which was
mishandled by the legacy routine.

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

(cherry picked from commit adb408dc791e83f59f3a86bd90d8e804c814ac30)
crypto/pem/pem_pkey.c