Skip to content

Commit dccabc6

Browse files
committed
Disabling TLSv1.2 session tickets when WOLFSSL_OP_NO_TICKET is being set.
There seems to have been a misunderstanding that WOLFSSL_OP_NO_TICKET would only disable tickets for TLS version lower than 1.2. But it includes 1.2 as well.
1 parent 502fd84 commit dccabc6

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

src/internal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34194,7 +34194,7 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
3419434194
if (ssl->ctx->ticketEncCb == NULL
3419534195
#if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) || defined(WOLFSSL_WPAS_SMALL)
3419634196
||
34197-
/* SSL_OP_NO_TICKET turns off tickets in < 1.2. Forces
34197+
/* SSL_OP_NO_TICKET turns off tickets in <= 1.2. Forces
3419834198
* "stateful" tickets for 1.3 so just use the regular
3419934199
* stateless ones. */
3420034200
(!IsAtLeastTLSv1_3(ssl->version) &&

src/ssl.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13354,6 +13354,7 @@ int wolfSSL_DTLS_SetCookieSecret(WOLFSSL* ssl,
1335413354
#ifdef HAVE_SESSION_TICKET
1335513355
if (ssl->options.createTicket && !ssl->options.noTicketTls12) {
1335613356
if ( (ssl->error = SendTicket(ssl)) != 0) {
13357+
WOLFSSL_MSG("Thought we need ticket but failed");
1335713358
WOLFSSL_ERROR(ssl->error);
1335813359
return WOLFSSL_FATAL_ERROR;
1335913360
}
@@ -16771,6 +16772,12 @@ int wolfSSL_set_compression(WOLFSSL* ssl)
1677116772

1677216773
ctx->mask = wolf_set_options(ctx->mask, opt);
1677316774

16775+
#if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) || defined(WOLFSSL_WPAS_SMALL)
16776+
if ((ctx->mask & WOLFSSL_OP_NO_TICKET) == WOLFSSL_OP_NO_TICKET) {
16777+
ctx->noTicketTls12 = 1;
16778+
}
16779+
#endif
16780+
1677416781
return ctx->mask;
1677516782
}
1677616783

@@ -23552,6 +23559,13 @@ long wolfSSL_set_options(WOLFSSL* ssl, long op)
2355223559
#endif
2355323560
}
2355423561

23562+
#if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) || defined(WOLFSSL_WPAS_SMALL)
23563+
if ((ssl->options.mask & WOLFSSL_OP_NO_TICKET) == WOLFSSL_OP_NO_TICKET) {
23564+
ssl->options.noTicketTls12 = 1;
23565+
}
23566+
#endif
23567+
23568+
2355523569
/* in the case of a version change the cipher suites should be reset */
2355623570
#ifndef NO_PSK
2355723571
havePSK = ssl->options.havePSK;

0 commit comments

Comments
 (0)