1=pod
2
3=head1 NAME
4
5SSL_CTX_set_stateless_cookie_generate_cb,
6SSL_CTX_set_stateless_cookie_verify_cb
7- Callback functions for stateless TLS1.3 cookies
8
9=head1 SYNOPSIS
10
11 #include <openssl/ssl.h>
12
13 void SSL_CTX_set_stateless_cookie_generate_cb(
14     SSL_CTX *ctx,
15     int (*gen_stateless_cookie_cb) (SSL *ssl,
16                                     unsigned char *cookie,
17                                     size_t *cookie_len));
18 void SSL_CTX_set_stateless_cookie_verify_cb(
19     SSL_CTX *ctx,
20     int (*verify_stateless_cookie_cb) (SSL *ssl,
21                                        const unsigned char *cookie,
22                                        size_t cookie_len));
23
24=head1 DESCRIPTION
25
26SSL_CTX_set_cookie_generate_cb() sets the callback used by L<SSL_stateless(3)>
27to generate the application-controlled portion of the cookie provided to clients
28in the HelloRetryRequest transmitted as a response to a ClientHello with a
29missing or invalid cookie. gen_stateless_cookie_cb() must write at most
30SSL_COOKIE_LENGTH bytes into B<cookie>, and must write the number of bytes
31written to B<cookie_len>. If a cookie cannot be generated, a zero return value
32can be used to abort the handshake.
33
34SSL_CTX_set_cookie_verify_cb() sets the callback used by L<SSL_stateless(3)> to
35determine whether the application-controlled portion of a ClientHello cookie is
36valid. A nonzero return value from app_verify_cookie_cb() communicates that the
37cookie is valid. The integrity of the entire cookie, including the
38application-controlled portion, is automatically verified by HMAC before
39verify_stateless_cookie_cb() is called.
40
41=head1 RETURN VALUES
42
43Neither function returns a value.
44
45=head1 SEE ALSO
46
47L<SSL_stateless(3)>
48
49=head1 COPYRIGHT
50
51Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.
52
53Licensed under the OpenSSL license (the "License").  You may not use
54this file except in compliance with the License.  You can obtain a copy
55in the file LICENSE in the source distribution or at
56L<https://www.openssl.org/source/license.html>.
57
58=cut
59