Skip to content

Curl segfaults when failing to get public key from SSL certificate #16468

@tysg

Description

@tysg

Version: 8.12.0

current_pkey = X509_get0_pubkey(current_cert);

X509_get0_pubkey can fail and return null
https://docs.openssl.org/1.1.1/man3/X509_get_pubkey/#return-values

In this case, curl will segfault at

type_name = EVP_PKEY_get0_type_name(current_pkey);

$ openssl x509 -in /tmp/cert.pem  -pubkey
Error getting public key
4017346E477F0000:error:03000072:digital envelope routines:X509_PUBKEY_get0:decode error:../crypto/x509/x_pubkey.c:458:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions