Skip to content

Commit ed8d4a8

Browse files
Send missing_extension alert when the server does not include supported_versions in HelloRetryRequest for TLS 1.3.
Partially fixes #10746.
1 parent 2c5e135 commit ed8d4a8

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/tls13.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5639,6 +5639,21 @@ int DoTls13ServerHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
56395639
return ret;
56405640
}
56415641
if (!foundVersion) {
5642+
/* RFC 8446 4.1.4: "The server's extensions MUST contain
5643+
* 'supported_versions'." (also 9.2: "supported_versions" is
5644+
* REQUIRED for all ... HelloRetryRequest messages). The HRR random
5645+
* unambiguously identifies a TLS 1.3 server, so its absence is not
5646+
* a downgrade attempt but a missing mandatory extension, which per
5647+
* the "missing_extension" alert definition must be reported as
5648+
* such. Return INCOMPLETE_DATA (which maps to a missing_extension
5649+
* alert) and let the caller emit the alert via
5650+
* TranslateErrorToAlert(). */
5651+
if (*extMsgType == hello_retry_request) {
5652+
WOLFSSL_MSG("HelloRetryRequest missing supported_versions "
5653+
"extension");
5654+
WOLFSSL_ERROR_VERBOSE(INCOMPLETE_DATA);
5655+
return INCOMPLETE_DATA;
5656+
}
56425657
if (!ssl->options.downgrade) {
56435658
WOLFSSL_MSG("Server trying to downgrade to version less than "
56445659
"TLS v1.3");

0 commit comments

Comments
 (0)