Skip to content

Commit 3d17753

Browse files
Merge pull request #5900 from icing/tls12-no-tickets
WOLFSSL_OP_NO_TICKET fix for TLSv1.2
2 parents 91f8b5e + 9d0b160 commit 3d17753

2 files changed

Lines changed: 16 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: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13358,6 +13358,7 @@ int wolfSSL_DTLS_SetCookieSecret(WOLFSSL* ssl,
1335813358
#ifdef HAVE_SESSION_TICKET
1335913359
if (ssl->options.createTicket && !ssl->options.noTicketTls12) {
1336013360
if ( (ssl->error = SendTicket(ssl)) != 0) {
13361+
WOLFSSL_MSG("Thought we need ticket but failed");
1336113362
WOLFSSL_ERROR(ssl->error);
1336213363
return WOLFSSL_FATAL_ERROR;
1336313364
}
@@ -16774,6 +16775,12 @@ int wolfSSL_set_compression(WOLFSSL* ssl)
1677416775
return BAD_FUNC_ARG;
1677516776

1677616777
ctx->mask = wolf_set_options(ctx->mask, opt);
16778+
#if defined(HAVE_SESSION_TICKET) && (defined(OPENSSL_EXTRA) \
16779+
|| defined(HAVE_WEBSERVER) || defined(WOLFSSL_WPAS_SMALL))
16780+
if ((ctx->mask & WOLFSSL_OP_NO_TICKET) == WOLFSSL_OP_NO_TICKET) {
16781+
ctx->noTicketTls12 = 1;
16782+
}
16783+
#endif
1677716784

1677816785
return ctx->mask;
1677916786
}
@@ -23556,6 +23563,14 @@ long wolfSSL_set_options(WOLFSSL* ssl, long op)
2355623563
#endif
2355723564
}
2355823565

23566+
#if defined(HAVE_SESSION_TICKET) && (defined(OPENSSL_EXTRA) \
23567+
|| defined(HAVE_WEBSERVER) || defined(WOLFSSL_WPAS_SMALL))
23568+
if ((ssl->options.mask & WOLFSSL_OP_NO_TICKET) == WOLFSSL_OP_NO_TICKET) {
23569+
ssl->options.noTicketTls12 = 1;
23570+
}
23571+
#endif
23572+
23573+
2355923574
/* in the case of a version change the cipher suites should be reset */
2356023575
#ifndef NO_PSK
2356123576
havePSK = ssl->options.havePSK;

0 commit comments

Comments
 (0)