diff options
author | Benjamin Saunders <ben.e.saunders@gmail.com> | 2018-02-25 18:39:11 -0800 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2018-03-12 19:34:13 +0000 |
commit | 3fa2812f32bdb922d47b84ab7b5a98a807d838c0 (patch) | |
tree | ad6cd3c8463be1521456b004cd14811a3b0fc20b /include | |
parent | 4718f449a3ecd5efac62b22d0fa9a759a7895dbc (diff) |
Introduce SSL_CTX_set_stateless_cookie_{generate,verify}_cb
These functions are similar to SSL_CTX_set_cookie_{generate,verify}_cb,
but used for the application-controlled portion of TLS1.3 stateless
handshake cookies rather than entire DTLSv1 cookies.
Reviewed-by: Ben Kaduk <kaduk@mit.edu>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5463)
Diffstat (limited to 'include')
-rw-r--r-- | include/openssl/ssl.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h index a47975d355..ec29405c50 100644 --- a/include/openssl/ssl.h +++ b/include/openssl/ssl.h @@ -546,8 +546,8 @@ typedef int (*SSL_verify_cb)(int preverify_ok, X509_STORE_CTX *x509_ctx); # define SSL_CONF_TYPE_DIR 0x3 # define SSL_CONF_TYPE_NONE 0x4 -/* Length of a TLSv1.3 cookie */ -# define SSL_COOKIE_LENGTH 255 +/* Maximum length of the application-controlled segment of a a TLSv1.3 cookie */ +# define SSL_COOKIE_LENGTH 4096 /* * Note: SSL[_CTX]_set_{options,mode} use |= op on the previous value, they @@ -726,6 +726,17 @@ void SSL_CTX_set_cookie_verify_cb(SSL_CTX *ctx, *cookie, unsigned int cookie_len)); + +void SSL_CTX_set_stateless_cookie_generate_cb( + SSL_CTX *ctx, + int (*gen_stateless_cookie_cb) (SSL *ssl, + unsigned char *cookie, + size_t *cookie_len)); +void SSL_CTX_set_stateless_cookie_verify_cb( + SSL_CTX *ctx, + int (*verify_stateless_cookie_cb) (SSL *ssl, + const unsigned char *cookie, + size_t cookie_len)); # ifndef OPENSSL_NO_NEXTPROTONEG typedef int (*SSL_CTX_npn_advertised_cb_func)(SSL *ssl, |