EVP module documentation pass
[openssl.git] / doc / man3 / SSL_CTX_set_stateless_cookie_generate_cb.pod
1 =pod
2
3 =head1 NAME
4
5 SSL_CTX_set_stateless_cookie_generate_cb,
6 SSL_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
26 SSL_CTX_set_cookie_generate_cb() sets the callback used by L<SSL_stateless(3)>
27 to generate the application-controlled portion of the cookie provided to clients
28 in the HelloRetryRequest transmitted as a response to a ClientHello with a
29 missing or invalid cookie. gen_stateless_cookie_cb() must write at most
30 SSL_COOKIE_LENGTH bytes into B<cookie>, and must write the number of bytes
31 written to B<cookie_len>. If a cookie cannot be generated, a zero return value
32 can be used to abort the handshake.
33
34 SSL_CTX_set_cookie_verify_cb() sets the callback used by L<SSL_stateless(3)> to
35 determine whether the application-controlled portion of a ClientHello cookie is
36 valid. A nonzero return value from app_verify_cookie_cb() communicates that the
37 cookie is valid. The integrity of the entire cookie, including the
38 application-controlled portion, is automatically verified by HMAC before
39 verify_stateless_cookie_cb() is called.
40
41 =head1 RETURN VALUES
42
43 Neither function returns a value.
44
45 =head1 SEE ALSO
46
47 L<SSL_stateless(3)>
48
49 =head1 COPYRIGHT
50
51 Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.
52
53 Licensed under the OpenSSL license (the "License").  You may not use
54 this file except in compliance with the License.  You can obtain a copy
55 in the file LICENSE in the source distribution or at
56 L<https://www.openssl.org/source/license.html>.
57
58 =cut