Skip to content

Commit e636590

Browse files
committed
tls.c: send missing_extension alert on TLS 1.3 SNI absence
1 parent 3181e2b commit e636590

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
@@ -2595,7 +2595,10 @@ static int TLSX_SNI_VerifyParse(WOLFSSL* ssl, byte isRequest)
25952595
continue;
25962596
}
25972597

2598-
SendAlert(ssl, alert_fatal, handshake_failure);
2598+
SendAlert(ssl, alert_fatal,
2599+
IsAtLeastTLSv1_3(ssl->version)
2600+
? missing_extension
2601+
: handshake_failure);
25992602
WOLFSSL_ERROR_VERBOSE(SNI_ABSENT_ERROR);
26002603
return SNI_ABSENT_ERROR;
26012604
}
@@ -2606,7 +2609,10 @@ static int TLSX_SNI_VerifyParse(WOLFSSL* ssl, byte isRequest)
26062609
if (ssl_sni->status != WOLFSSL_SNI_NO_MATCH)
26072610
continue;
26082611

2609-
SendAlert(ssl, alert_fatal, handshake_failure);
2612+
SendAlert(ssl, alert_fatal,
2613+
IsAtLeastTLSv1_3(ssl->version)
2614+
? missing_extension
2615+
: handshake_failure);
26102616
WOLFSSL_ERROR_VERBOSE(SNI_ABSENT_ERROR);
26112617
return SNI_ABSENT_ERROR;
26122618
}

0 commit comments

Comments
 (0)