SSL_GET_PEER_SIGNATURE_NID(3ossl)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1

okay bestie, buckle up 🫢 this is the SSL_GET_PEER_SIGNATURE_NID(3ossl) page from the OpenSSL manual, and we're about to get into TLS message signing types together ✨

🌸 NAME 🌸

These functions are the little squad that gets TLS message signing types, no cap πŸ’…

  • SSL_get0_peer_signature_name
  • SSL_get_peer_signature_nid
  • SSL_get_peer_signature_type_nid
  • SSL_get0_signature_name
  • SSL_get_signature_nid
  • SSL_get_signature_type_nid

✨ SYNOPSIS ✨

#include <openssl/ssl.h>

int SSL_get0_peer_signature_name(const SSL *ssl, const char **sigalg);
int SSL_get_peer_signature_nid(SSL *ssl, int *psig_nid);
int SSL_get_peer_signature_type_nid(const SSL *ssl, int *psigtype_nid);
int SSL_get0_signature_name(SSL *ssl, const char **sigalg);
int SSL_get_signature_nid(SSL *ssl, int *psig_nid);
int SSL_get_signature_type_nid(SSL *ssl, int *psigtype_nid);

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so here's the tea β˜• β€” these are all about who signed what on a TLS connection, and which signature scheme they used.

⚠️ caveat, and this is important: the caller must not free the returned pointer. If you need the returned string to stick around beyond the lifetime of the SSL connection, copy it. periodt πŸ’…
  • SSL_get_peer_signature_nid() sets *psig_nid to the NID of the digest used by the peer to sign TLS messages. It is implemented as a macro πŸŽ€
  • SSL_get_peer_signature_type_nid() sets *psigtype_nid to the signature type used by the peer to sign TLS messages. Currently the signature type is the NID of the public key type used for signing except for PSS signing where it is EVP_PKEY_RSA_PSS. To differentiate between rsa_pss_rsae_* and rsa_pss_pss_* signatures, it's necessary to check the type of public key in the peer's certificate 🧚
  • SSL_get0_signature_name(), SSL_get_signature_nid() and SSL_get_signature_type_nid() return the equivalent information for the local end of the connection. local end representation, slay 🌈

πŸ’– RETURN VALUES πŸ’–

These functions return 1 for success and 0 for failure. No in-between, no mystery vibe check 😭

There are several possible reasons for failure:

  • the peer or local end is a client and did not sign the handshake (did not use a client certificate)
  • the cipher suite has no signature (e.g. it uses RSA key exchange or is anonymous)
  • the TLS version is below 1.2
  • or the functions were called too early, e.g. before the peer signed a message

πŸ‘‘ SEE ALSO πŸ‘‘

⭐ HISTORY ⭐

The SSL_get0_peer_signature_name() and SSL_get0_signature_name() functions were added in OpenSSL 3.5. iconic behavior, honestly πŸ”₯

Copyright 2017-2025 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at https://www.openssl.org/source/license.html.


mwah πŸ’‹ signing off from OpenSSL 3.5.6, dated 2026-04-07 β€” catch you in the next manpage, bestie 🫢✨

πŸ“¦ where this page comes from