From: Matt Caswell Date: Sat, 8 Jul 2017 10:42:55 +0000 (+0100) Subject: Add SSL_SESSION_set_max_early_data() X-Git-Tag: OpenSSL_1_1_1-pre1~729 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=98e1d93454a5d0b34e929f28528756ba9a636e5c;p=openssl Add SSL_SESSION_set_max_early_data() Reviewed-by: Ben Kaduk (Merged from https://github.com/openssl/openssl/pull/3926) --- diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h index 237c086bae..077e8513b0 100644 --- a/include/openssl/ssl.h +++ b/include/openssl/ssl.h @@ -1542,6 +1542,8 @@ __owur unsigned long SSL_SESSION_get_ticket_lifetime_hint(const SSL_SESSION *s); void SSL_SESSION_get0_ticket(const SSL_SESSION *s, const unsigned char **tick, size_t *len); __owur uint32_t SSL_SESSION_get_max_early_data(const SSL_SESSION *s); +__owur int SSL_SESSION_set_max_early_data(SSL_SESSION *s, + uint32_t max_early_data); __owur int SSL_copy_session_id(SSL *to, const SSL *from); __owur X509 *SSL_SESSION_get0_peer(SSL_SESSION *s); __owur int SSL_SESSION_set1_id_context(SSL_SESSION *s, const unsigned char *sid_ctx, diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c index 575cd70ef0..6292d01126 100644 --- a/ssl/ssl_sess.c +++ b/ssl/ssl_sess.c @@ -929,6 +929,13 @@ uint32_t SSL_SESSION_get_max_early_data(const SSL_SESSION *s) return s->ext.max_early_data; } +int SSL_SESSION_set_max_early_data(SSL_SESSION *s, uint32_t max_early_data) +{ + s->ext.max_early_data = max_early_data; + + return 1; +} + X509 *SSL_SESSION_get0_peer(SSL_SESSION *s) { return s->peer; diff --git a/util/libssl.num b/util/libssl.num index d5774566e0..f3d1baacb5 100644 --- a/util/libssl.num +++ b/util/libssl.num @@ -465,3 +465,4 @@ SSL_free_buffers 465 1_1_1 EXIST::FUNCTION: SSL_SESSION_dup 466 1_1_1 EXIST::FUNCTION: SSL_get_pending_cipher 467 1_1_1 EXIST::FUNCTION: SSL_CIPHER_get_protocol_id 468 1_1_1 EXIST::FUNCTION: +SSL_SESSION_set_max_early_data 469 1_1_1 EXIST::FUNCTION: