Skip to content

Commit 91f3e7e

Browse files
authored
Merge pull request #10332 from jackctj117/SNI
tls.c: send missing_extension alert on TLS 1.3 SNI absence
2 parents 8199fda + bfc3f37 commit 91f3e7e

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/tls.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2593,7 +2593,10 @@ static int TLSX_SNI_VerifyParse(WOLFSSL* ssl, byte isRequest)
25932593
continue;
25942594
}
25952595

2596-
SendAlert(ssl, alert_fatal, handshake_failure);
2596+
SendAlert(ssl, alert_fatal,
2597+
IsAtLeastTLSv1_3(ssl->version)
2598+
? missing_extension
2599+
: handshake_failure);
25972600
WOLFSSL_ERROR_VERBOSE(SNI_ABSENT_ERROR);
25982601
return SNI_ABSENT_ERROR;
25992602
}
@@ -2604,7 +2607,10 @@ static int TLSX_SNI_VerifyParse(WOLFSSL* ssl, byte isRequest)
26042607
if (ssl_sni->status != WOLFSSL_SNI_NO_MATCH)
26052608
continue;
26062609

2607-
SendAlert(ssl, alert_fatal, handshake_failure);
2610+
SendAlert(ssl, alert_fatal,
2611+
IsAtLeastTLSv1_3(ssl->version)
2612+
? missing_extension
2613+
: handshake_failure);
26082614
WOLFSSL_ERROR_VERBOSE(SNI_ABSENT_ERROR);
26092615
return SNI_ABSENT_ERROR;
26102616
}

0 commit comments

Comments
 (0)