.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.48) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "SSL_SET_SESSION_SECRET_CB 3ssl" .TH SSL_SET_SESSION_SECRET_CB 3ssl 2026-10-23 4.1.0 OpenSSL .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME SSL_set_session_secret_cb, tls_session_secret_cb_fn, SSL_set_session_ticket_ext, SSL_set_session_ticket_ext_cb, tls_session_ticket_ext_cb_fn \&\- set the session secret and EAP\-FAST session ticket extension callbacks .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& #include \& \& typedef int (*tls_session_secret_cb_fn)(SSL *s, void *secret, int *secret_len, \& STACK_OF(SSL_CIPHER) *peer_ciphers, \& const SSL_CIPHER **cipher, void *arg); \& \& int SSL_set_session_secret_cb(SSL *s, \& tls_session_secret_cb_fn session_secret_cb, \& void *arg); \& \& typedef int (*tls_session_ticket_ext_cb_fn)(SSL *s, const unsigned char *data, \& int len, void *arg); \& \& int SSL_set_session_ticket_ext(SSL *s, void *ext_data, int ext_len); \& \& int SSL_set_session_ticket_ext_cb(SSL *s, \& tls_session_ticket_ext_cb_fn cb, \& void *arg); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" \&\fBSSL_set_session_secret_cb()\fR sets the session secret callback to be used (\fIsession_secret_cb\fR), and an optional argument (\fIarg\fR) to be passed to that callback when it is called. This is only useful for an implementation of EAP\-FAST (RFC4851). The presence of the callback also modifies the internal OpenSSL TLS state machine to match the modified TLS behaviour as described in RFC4851. Therefore this callback should not be used except when implementing EAP\-FAST. .PP The callback is expected to set the master secret to be used by filling in the data pointed to by \fI*secret\fR. The size of the secret buffer is initially available in \fI*secret_len\fR and may be updated by the callback (but must not be larger than the initial value). .PP On the server side the set of ciphersuites offered by the peer is provided in the \fIpeer_ciphers\fR stack. Optionally the callback may select the preferred ciphersuite by setting it in \fI*cipher\fR. .PP On the client side the \fIpeer_ciphers\fR stack will always be NULL. The callback may specify the preferred cipher in \fI*cipher\fR and this will be associated with the \fBSSL_SESSION\fR \- but it does not affect the ciphersuite selected by the server. .PP The callback is also supplied with an additional argument in \fIarg\fR which is the argument that was provided to the original \fBSSL_set_session_secret_cb()\fR call. .PP \&\fBSSL_set_session_ticket_ext()\fR is used on the client\-side to set the session ticket extension data for EAP\-FAST (RFC4851). The \fIext_data\fR argument is a pointer to the extension data, and \fIext_len\fR is the length of that data. \fIext_len\fR must be between 0 and 65535. If \fIext_data\fR is NULL, then the session ticket extension will not be sent. .PP \&\fBSSL_set_session_ticket_ext_cb()\fR is used on the server\-side to set a callback (\fIcb\fR) that will be called when a session ticket extension is received. The callback is supplied with the extension data in \fIdata\fR and its length in \&\fIlen\fR, as well as the additional argument \fIarg\fR that was provided when the callback was set. .SH "RETURN VALUES" .IX Header "RETURN VALUES" \&\fBSSL_set_session_secret_cb()\fR, \fBSSL_set_session_ticket_ext()\fR, and \&\fBSSL_set_session_ticket_ext_cb()\fR return 1 on success and 0 on failure. .PP If the session secret callback returns 1 then this indicates it has successfully set the secret. A return value of 0 indicates that the secret has not been set. On the client this will cause an immediate abort of the handshake. .PP The session ticket extension callback should return 1 for success. A return value of 0 indicates failure and will cause the handshake to abort immediately. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBssl\fR\|(7), \&\fBSSL_get_session\fR\|(3) .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright 2024\-2026 The OpenSSL Project Authors. All Rights Reserved. .PP 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 .