X509_GET_PUBKEY_PARAMETERS(3ssl)

πŸ“¦ version 4.1.0, in opensuse-leap 16.0

πŸ’… NAME πŸ’…

Okay so this is the Library Functions Manual page for X509_GET_PUBKEY_PARAMETE(3), and the main character is X509_get_pubkey_parameters β€” it copies public key parameters from a chain. That’s the whole vibe. πŸ’–

✨ SYNOPSIS ✨

Here’s the exact summoning ritual, bestie:

#include <openssl/x509.h>

int
X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain);

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so X509_get_pubkey_parameters() copies public key parameters from the first appropriate certificate in the chain. Slay.

If pkey is not NULL and already contains complete public key parameters, or if it uses an algorithm that does not use any parameters, no action occurs. The function indicates success without inspecting the existing parameters, without inspecting the chain, and without comparing any parameters. It literally does not look. Iconic.

Otherwise, all public key parameters are copied from the first certificate in the chain that contains complete public key parameters to each certificate preceding it in the chain. Unless pkey is a NULL pointer, the same parameters are also copied to pkey. Periodt. πŸ’…

πŸŽ€ RETURN VALUES πŸŽ€

X509_get_pubkey_parameters() returns 1 for success or 0 for failure. That’s it, bestie β€” binary mood, no cap. 🫢

πŸ’€ ERRORS πŸ’€

These diagnostics can be retrieved with ERR_get_error(3), ERR_GET_REASON(3), and ERR_reason_error_string(3):

  • X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY β€” "unable to get certs public key": retrieving the public key from a certificate in the chain failed before a certificate containing complete public key parameters could be found.
  • X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN β€” "unable to find parameters in chain": none of the certificates in the chain contain complete public key parameters.

🌈 SEE ALSO 🌈

Go peek at these besties, iykyk:

πŸ•°οΈ HISTORY πŸ•°οΈ

X509_get_pubkey_parameters() first appeared in SSLeay 0.8.0 and has been available since OpenBSD 2.4. Lowkey a legacy icon. πŸ‘‘

⚠️ CAVEATS ⚠️

Okay so this is the messy part, bestie. If X509_get_pubkey_parameters() fails and returns 0, a part of the parameters may or may not have been copied before the failure was detected, whereas other parts of pkey and chain may remain unchanged. So in case of failure, the state of the arguments may change and possibly become inconsistent. Do not assume everything stayed cute and untouched.

Debian Β· November 26, 2021 Β· X509_GET_PUBKEY_PARAMETERS(3) β€” mwah, bestie, go handle those parameters responsibly πŸ’…βœ¨

πŸ“¦ where this page comes from