<commit_before>=pod

=head1 NAME

SSL_psk_server_cb_func,
SSL_psk_find_session_cb_func,
SSL_CTX_use_psk_identity_hint,
SSL_use_psk_identity_hint,
SSL_CTX_set_psk_server_callback,
SSL_set_psk_server_callback,
SSL_CTX_set_psk_find_session_callback,
SSL_set_psk_find_session_callback
- set PSK identity hint to use

=head1 SYNOPSIS

 #include <openssl/ssl.h>

 typedef int (*SSL_psk_find_session_cb_func)(SSL *ssl,
                                             const unsigned char *identity,
                                             size_t identity_len,
                                             SSL_SESSION **sess);


 void SSL_CTX_set_psk_find_session_callback(SSL_CTX *ctx,
                                            SSL_psk_find_session_cb_func cb);
 void SSL_set_psk_find_session_callback(SSL *s, SSL_psk_find_session_cb_func cb);

 typedef unsigned int (*SSL_psk_server_cb_func)(SSL *ssl,
                                                const char *identity,
                                                unsigned char *psk,
                                                unsigned int max_psk_len);

 int SSL_CTX_use_psk_identity_hint(SSL_CTX *ctx, const char *hint);
 int SSL_use_psk_identity_hint(SSL *ssl, const char *hint);

 void SSL_CTX_set_psk_server_callback(SSL_CTX *ctx, SSL_psk_server_cb_func cb);
 void SSL_set_psk_server_callback(SSL *ssl, SSL_psk_server_cb_func cb);

=head1 DESCRIPTION

A client application wishing to use TLSv1.3 PSKs should set a callback
using either SSL_CTX_set_psk_use_session_callback() or
SSL_set_psk_use_session_callback() as appropriate.

The callback function is given a pointer to the SSL connection in B<ssl> and
an identity in B<identity> of length B<identity_len>. The callback function
should identify an SSL_SESSION object that provides the PSK details and store it
in B<*sess>. The SSL_SESSION object should, as a minimum, set the master key,
the ciphersuite and the protocol version. See
L<SSL_CTX_set_psk_use_session_callback(3)> for details.

It is also possible for the callback to succeed but not supply a PSK. In this
case no PSK will be used but the handshake will continue. To do this the
callback should return successfully and ensure that B<*sess> is
NULL.

Identity hints are not relevant for TLSv1.3. A server application wishing to use
PSK ciphersuites for TLSv1.2 and below may call SSL_CTX_use_psk_identity_hint()
to set the given B<NUL>-terminated PSK identity hint B<hint> for SSL context
object B<ctx>. SSL_use_psk_identity_hint() sets the given B<NUL>-terminated PSK
identity hint B<hint> for the SSL connection object B<ssl>. If B<hint> is
B<NULL> the current hint from B<ctx> or B<ssl> is deleted.<commit_msg>Fix a copy&paste error in the TLSv1.3 server side PSK documentation<commit_after>=pod

=head1 NAME

SSL_psk_server_cb_func,
SSL_psk_find_session_cb_func,
SSL_CTX_use_psk_identity_hint,
SSL_use_psk_identity_hint,
SSL_CTX_set_psk_server_callback,
SSL_set_psk_server_callback,
SSL_CTX_set_psk_find_session_callback,
SSL_set_psk_find_session_callback
- set PSK identity hint to use

=head1 SYNOPSIS

 #include <openssl/ssl.h>

 typedef int (*SSL_psk_find_session_cb_func)(SSL *ssl,
                                             const unsigned char *identity,
                                             size_t identity_len,
                                             SSL_SESSION **sess);


 void SSL_CTX_set_psk_find_session_callback(SSL_CTX *ctx,
                                            SSL_psk_find_session_cb_func cb);
 void SSL_set_psk_find_session_callback(SSL *s, SSL_psk_find_session_cb_func cb);

 typedef unsigned int (*SSL_psk_server_cb_func)(SSL *ssl,
                                                const char *identity,
                                                unsigned char *psk,
                                                unsigned int max_psk_len);

 int SSL_CTX_use_psk_identity_hint(SSL_CTX *ctx, const char *hint);
 int SSL_use_psk_identity_hint(SSL *ssl, const char *hint);

 void SSL_CTX_set_psk_server_callback(SSL_CTX *ctx, SSL_psk_server_cb_func cb);
 void SSL_set_psk_server_callback(SSL *ssl, SSL_psk_server_cb_func cb);

=head1 DESCRIPTION

A server application wishing to use TLSv1.3 PSKs should set a callback
using either SSL_CTX_set_psk_find_session_callback() or
SSL_set_psk_find_session_callback() as appropriate.

The callback function is given a pointer to the SSL connection in B<ssl> and
an identity in B<identity> of length B<identity_len>. The callback function
should identify an SSL_SESSION object that provides the PSK details and store it
in B<*sess>. The SSL_SESSION object should, as a minimum, set the master key,
the ciphersuite and the protocol version. See
L<SSL_CTX_set_psk_use_session_callback(3)> for details.

It is also possible for the callback to succeed but not supply a PSK. In this
case no PSK will be used but the handshake will continue. To do this the
callback should return successfully and ensure that B<*sess> is
NULL.

Identity hints are not relevant for TLSv1.3. A server application wishing to use
PSK ciphersuites for TLSv1.2 and below may call SSL_CTX_use_psk_identity_hint()
to set the given B<NUL>-terminated PSK identity hint B<hint> for SSL context
object B<ctx>. SSL_use_psk_identity_hint() sets the given B<NUL>-terminated PSK
identity hint B<hint> for the SSL connection object B<ssl>. If B<hint> is
B<NULL> the current hint from B<ctx> or B<ssl> is deleted.
{'fraction_non_alphanumeric': 0.05220588235294118, 'fraction_numerical': 0.004044117647058824, 'mean_word_length': 3.2641065830721003, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 28, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '662249', 'n_tokens_mistral': 1657, 'n_tokens_neox': 1614, 'n_words': 539}