summaryrefslogtreecommitdiff
path: root/ssl
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2018-01-31 16:40:03 +0000
committerMatt Caswell <matt@openssl.org>2018-05-17 16:48:25 +0100
commit394159da608f625b60f07c59e36dc7d01df3a709 (patch)
treebe53d870c3c1e277a2d94861717219148ea2fc9b /ssl
parent9d0a8bb71e3e411e9183e635122f17c1429c4116 (diff)
downloadopenssl-new-394159da608f625b60f07c59e36dc7d01df3a709.tar.gz
Allow configuation of the number of TLSv1.3 session tickets via SSL_CONF
Also allows the apps to set it. Reviewed-by: Viktor Dukhovni <viktor@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5227)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/ssl_conf.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/ssl/ssl_conf.c b/ssl/ssl_conf.c
index f1e8200b70..758f012938 100644
--- a/ssl/ssl_conf.c
+++ b/ssl/ssl_conf.c
@@ -570,6 +570,21 @@ static int cmd_RecordPadding(SSL_CONF_CTX *cctx, const char *value)
return rv;
}
+
+static int cmd_NumTickets(SSL_CONF_CTX *cctx, const char *value)
+{
+ int rv = 0;
+ int num_tickets = atoi(value);
+
+ if (num_tickets >= 0) {
+ if (cctx->ctx)
+ rv = SSL_CTX_set_num_tickets(cctx->ctx, num_tickets);
+ if (cctx->ssl)
+ rv = SSL_set_num_tickets(cctx->ssl, num_tickets);
+ }
+ return rv;
+}
+
typedef struct {
int (*cmd) (SSL_CONF_CTX *cctx, const char *value);
const char *str_file;
@@ -655,7 +670,8 @@ static const ssl_conf_cmd_tbl ssl_conf_cmds[] = {
SSL_CONF_FLAG_SERVER | SSL_CONF_FLAG_CERTIFICATE,
SSL_CONF_TYPE_FILE),
#endif
- SSL_CONF_CMD_STRING(RecordPadding, "record_padding", 0)
+ SSL_CONF_CMD_STRING(RecordPadding, "record_padding", 0),
+ SSL_CONF_CMD_STRING(NumTickets, "num_tickets", SSL_CONF_FLAG_SERVER)
};
/* Supported switches: must match order of switches in ssl_conf_cmds */