Skip to content

Commit 4252dfa

Browse files
Avoid sending duplicate protocol_version alert in DoTls13ClientHello.
DoTls13ClientHello was explicitly sending a protocol_version alert, then returning VERSION_ERROR which TranslateErrorToAlert then mapped to protocol_version, causing a duplicate alert to be sent. Remove all protocol_version alerts from DoTls13ClientHello itself and instead return VERSION_ERROR and allow TranslateErrorToAlert to handle sending the alerts. Fixes #10746.
1 parent e68904e commit 4252dfa

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/tls13.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5452,7 +5452,6 @@ int DoTls13ServerHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
54525452

54535453
if (args->pv.major != ssl->version.major ||
54545454
args->pv.minor != tls12minor) {
5455-
SendAlert(ssl, alert_fatal, wolfssl_alert_protocol_version);
54565455
WOLFSSL_ERROR_VERBOSE(VERSION_ERROR);
54575456
return VERSION_ERROR;
54585457
}
@@ -5557,14 +5556,14 @@ int DoTls13ServerHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
55575556
#endif
55585557
ssl->options.haveEMS = 0;
55595558
if (args->pv.minor < ssl->options.minDowngrade) {
5560-
SendAlert(ssl, alert_fatal, wolfssl_alert_protocol_version);
5559+
WOLFSSL_ERROR_VERBOSE(VERSION_ERROR);
55615560
return VERSION_ERROR;
55625561
}
55635562
#ifndef WOLFSSL_NO_TLS12
55645563
ssl->options.tls1_3 = 0;
55655564
return DoServerHello(ssl, input, inOutIdx, helloSz);
55665565
#else
5567-
SendAlert(ssl, alert_fatal, wolfssl_alert_protocol_version);
5566+
WOLFSSL_ERROR_VERBOSE(VERSION_ERROR);
55685567
return VERSION_ERROR;
55695568
#endif
55705569
}
@@ -5604,7 +5603,6 @@ int DoTls13ServerHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
56045603
if (!ssl->options.downgrade) {
56055604
WOLFSSL_MSG("Server trying to downgrade to version less than "
56065605
"TLS v1.3");
5607-
SendAlert(ssl, alert_fatal, wolfssl_alert_protocol_version);
56085606
WOLFSSL_ERROR_VERBOSE(VERSION_ERROR);
56095607
return VERSION_ERROR;
56105608
}
@@ -5623,14 +5621,12 @@ int DoTls13ServerHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
56235621

56245622
if (!ssl->options.dtls &&
56255623
args->pv.minor < ssl->options.minDowngrade) {
5626-
SendAlert(ssl, alert_fatal, wolfssl_alert_protocol_version);
56275624
WOLFSSL_ERROR_VERBOSE(VERSION_ERROR);
56285625
return VERSION_ERROR;
56295626
}
56305627

56315628
if (ssl->options.dtls &&
56325629
args->pv.minor > ssl->options.minDowngrade) {
5633-
SendAlert(ssl, alert_fatal, wolfssl_alert_protocol_version);
56345630
WOLFSSL_ERROR_VERBOSE(VERSION_ERROR);
56355631
return VERSION_ERROR;
56365632
}

0 commit comments

Comments
 (0)