Skip to content

Commit 5822f22

Browse files
committed
Fix for TLS v1.2 session resumption with tickets where the server decides to do a full handshake. The wrong sessionIDSz was being checked and should be the arrays one since it get set from the server_hello.
1 parent 8227309 commit 5822f22

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/internal.c

+13-1
Original file line numberDiff line numberDiff line change
@@ -17471,6 +17471,18 @@ int DoHandShakeMsgType(WOLFSSL* ssl, byte* input, word32* inOutIdx,
1747117471
case certificate_request:
1747217472
case server_hello_done:
1747317473
if (ssl->options.resuming) {
17474+
/* Client requested resumption, but server is doing a
17475+
* full handshake */
17476+
17477+
/* The server's decision to resume isn't known until after the
17478+
* "server_hello". It subsequent handshake messages like
17479+
* "certificate" or "server_key_exchange" are recevied then we
17480+
* are doing a full handshake */
17481+
17482+
/* If the server included a session id then we
17483+
* treat this as a fatal error, since the server said it was
17484+
* doing resumption, but did not.
17485+
1747417486
/* https://www.rfc-editor.org/rfc/rfc5077.html#section-3.4
1747517487
* Alternatively, the client MAY include an empty Session ID
1747617488
* in the ClientHello. In this case, the client ignores the
@@ -17479,7 +17491,7 @@ int DoHandShakeMsgType(WOLFSSL* ssl, byte* input, word32* inOutIdx,
1747917491
* messages.
1748017492
*/
1748117493
#ifndef WOLFSSL_WPAS
17482-
if (ssl->session->sessionIDSz != 0) {
17494+
if (ssl->arrays->sessionIDSz != 0) {
1748317495
/* Fatal error. Only try to send an alert. RFC 5246 does not
1748417496
* allow for reverting back to a full handshake after the
1748517497
* server has indicated the intention to do a resumption. */

0 commit comments

Comments
 (0)