Skip to content

Commit bcbd701

Browse files
committed
Support DTLS1.3 downgrade when server sends multiple handshakes in packet
If the server sends Server Hello, Server Key Exchange and Server Hello Done in a single DTLS packet, but for DTLS1.2 in response to a client DTLS1.3 request, then FIRST_REPLAY state does not occur until the server re-sends the packet. At this point wolfSSLconnect() gets used and all bursts into life. When processing handshakes in wolfSSL_connect_TLSv13() for case HELLO_AGAIN_REPLY, downgrade to using wolfSSLconnect() to continue processing the remaining handshakes in the packet. Found when using Mbed TLS for the server.
1 parent 54370cc commit bcbd701

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/tls13.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13086,6 +13086,14 @@ int wolfSSL_connect_TLSv13(WOLFSSL* ssl)
1308613086
case HELLO_AGAIN_REPLY:
1308713087
/* Get the response/s from the server. */
1308813088
while (ssl->options.serverState < SERVER_FINISHED_COMPLETE) {
13089+
#ifdef WOLFSSL_DTLS13
13090+
if (!IsAtLeastTLSv1_3(ssl->version)) {
13091+
#ifndef WOLFSSL_NO_TLS12
13092+
if (ssl->options.downgrade)
13093+
return wolfSSL_connect(ssl);
13094+
#endif
13095+
}
13096+
#endif /* WOLFSSL_DTLS13 */
1308913097
if ((ssl->error = ProcessReply(ssl)) < 0) {
1309013098
WOLFSSL_ERROR(ssl->error);
1309113099
return WOLFSSL_FATAL_ERROR;

0 commit comments

Comments
 (0)