]> git.ipfire.org Git - thirdparty/openssl.git/commit
fix function pointer type mismatch in PEM_X509_INFO_read_bio_ex
authorNikola Pajkovsky <nikolap@openssl.org>
Tue, 19 May 2026 08:50:02 +0000 (10:50 +0200)
committerNeil Horman <nhorman@openssl.org>
Thu, 25 Jun 2026 12:12:29 +0000 (08:12 -0400)
commit0e8f2844ed3e6c8fde0e5da0db6322735eb6593f
tree75fcafb61df833d7c8642b53ccad45ebbed29906
parentb3003ff1ecac4118d5779f4917c684d83c9c091a
fix function pointer type mismatch in PEM_X509_INFO_read_bio_ex

PEM_X509_INFO_read_bio_ex stored d2i_X509, d2i_X509_AUX, d2i_X509_CRL
or d2i_AutoPrivateKey -- each with a distinct, type-specific signature
returning X509*, X509_CRL* or EVP_PKEY* -- in a single d2i_of_void*
variable and dispatched through it:

    d2i = (D2I_OF(void))d2i_X509;
    ...
    d2i(pp, &p, len)

Replace the function-pointer dispatch with an enum tag
(pem_info_type) and a switch that calls each typed d2i_* directly
with the correctly type.

Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Milan Broz <mbroz@openssl.org>
MergeDate: Thu Jun 25 12:12:53 2026
(Merged from https://github.com/openssl/openssl/pull/31523)
crypto/pem/pem_info.c