Merge pull request #6283 from cconlon/tls13resume12

In SendTls13ClientHello() only send Session ID for sessions being resumed (< TLS 1.3)
pull/6310/head
Sean Parkinson 2023-04-17 12:21:11 +10:00 committed by GitHub
commit 50e15dbb36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 5 deletions

View File

@ -4084,7 +4084,7 @@ int SendTls13ClientHello(WOLFSSL* ssl)
ssl->options.tls13MiddleBoxCompat = 1; ssl->options.tls13MiddleBoxCompat = 1;
} }
#else #else
if (ssl->session->sessionIDSz > 0) if (ssl->options.resuming && ssl->session->sessionIDSz > 0)
args->length += ssl->session->sessionIDSz; args->length += ssl->session->sessionIDSz;
#endif #endif
@ -4229,10 +4229,16 @@ int SendTls13ClientHello(WOLFSSL* ssl)
if (ssl->session->sessionIDSz > 0) { if (ssl->session->sessionIDSz > 0) {
/* Session resumption for old versions of protocol. */ /* Session resumption for old versions of protocol. */
args->output[args->idx++] = ID_LEN; if (ssl->options.resuming) {
XMEMCPY(args->output + args->idx, ssl->session->sessionID, args->output[args->idx++] = ID_LEN;
ssl->session->sessionIDSz); XMEMCPY(args->output + args->idx, ssl->session->sessionID,
args->idx += ID_LEN; ssl->session->sessionIDSz);
args->idx += ID_LEN;
}
else {
/* Not resuming, zero length session ID */
args->output[args->idx++] = 0;
}
} }
else { else {
#ifdef WOLFSSL_TLS13_MIDDLEBOX_COMPAT #ifdef WOLFSSL_TLS13_MIDDLEBOX_COMPAT