LIBRESSL-SSL_SET_PSK_USE_SESSION_CALLBACK(3)
π SSL_set_psk_use_session_callback, SSL_psk_use_session_cb_func π
okay so bestie, this is the Library Functions Manual (section 3) page for the TLS pre-shared-key client callback situation, and it is very much a LibreSSL stub era moment. π
πΈ NAME πΈ
SSL_set_psk_use_session_callback, SSL_psk_use_session_cb_func β set TLS pre-shared key client callback
β¨ SYNOPSIS β¨
library βlibsslβ libcrypto #include <openssl/ssl.h>
typedef int
(*SSL_psk_use_session_cb_func)(SSL *ssl, const EVP_MD *md,
const unsigned char **id, size_t *idlen, SSL_SESSION **session);
void
SSL_set_psk_use_session_callback(SSL *ssl,
SSL_psk_use_session_cb_func cb);
π DESCRIPTION π
okay so the tea β: LibreSSL provides the stub function SSL_set_psk_use_session_callback() to allow compiling application programs that contain optional support for TLSv1.3 pre-shared keys. That's the whole assignment. π«Ά
- LibreSSL does not support TLS pre-shared keys, and no action occurs when
SSL_set_psk_use_session_callback()is called. In particular, both arguments are ignored. both. of. them. π - During session negotiation, LibreSSL never calls the callback
cband always behaves as if that callback succeeded and set the*sessionpointer toNULL. It's giving "we are simply not doing that" energy. π - That is, LibreSSL never sends a pre-shared key to the server and never aborts the handshake for lack of a pre-shared key. Iconic non-behavior, honestly. β¨
Now, with OpenSSL, a client application wishing to use TLSv1.3 pre-shared keys can install a callback function cb using SSL_set_psk_use_session_callback(). The OpenSSL library may call cb once or twice during session negotiation. π
- If the callback fails, OpenSSL aborts connection setup. like, handshake over.
- If the callback succeeds but sets the
*sessionpointer toNULL, OpenSSL continues the handshake but does not send a pre-shared key to the server.
π RETURN VALUES π
The SSL_psk_use_session_cb_func() callback is expected to return 1 on success or 0 on failure. That's the contract, bestie. β
β
π¦ HISTORY π¦
SSL_set_psk_use_session_callback() and SSL_psk_use_session_cb_func() first appeared in OpenSSL 1.1.1 and have been available since OpenBSD 7.0. periodt. π
cute sign-off time: source/version is Debian, and the date is June 8, 20 β the raw footer literally runs the date straight into SSL_SET_PSK_USE_SESSION_CALLBACK(3), no cap. ππ
π¦ where this page comes from
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms