Skip to content

Correct alert type for missing supported_versions in HRR and avoid sending duplicate protocol_version alerts.#10811

Open
kareem-wolfssl wants to merge 2 commits into
wolfSSL:masterfrom
kareem-wolfssl:gh10746
Open

Correct alert type for missing supported_versions in HRR and avoid sending duplicate protocol_version alerts.#10811
kareem-wolfssl wants to merge 2 commits into
wolfSSL:masterfrom
kareem-wolfssl:gh10746

Conversation

@kareem-wolfssl

Copy link
Copy Markdown
Contributor

Description

Fixes #10746

Testing

Built in tests + provided reproducer

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

…ed_versions in HelloRetryRequest for TLS 1.3.

Partially fixes wolfSSL#10746.
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 wolfSSL#10746.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR targets TLS 1.3 client compliance with RFC 8446 when processing HelloRetryRequest (HRR) messages that omit the mandatory supported_versions extension, specifically correcting the alert description and preventing duplicate protocol_version alerts.

Changes:

  • Adjusts HRR handling to return an error that maps to the missing_extension alert when supported_versions is absent.
  • Removes several direct SendAlert(... protocol_version ...) calls in DoTls13ServerHello() to avoid sending duplicate fatal alerts in some call paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/tls13.c
Comment on lines 5453 to 5456
if (args->pv.major != ssl->version.major ||
args->pv.minor != tls12minor) {
SendAlert(ssl, alert_fatal, wolfssl_alert_protocol_version);
WOLFSSL_ERROR_VERBOSE(VERSION_ERROR);
return VERSION_ERROR;
Comment thread src/tls13.c
Comment on lines 5603 to 5608
if (!ssl->options.downgrade) {
WOLFSSL_MSG("Server trying to downgrade to version less than "
"TLS v1.3");
SendAlert(ssl, alert_fatal, wolfssl_alert_protocol_version);
WOLFSSL_ERROR_VERBOSE(VERSION_ERROR);
return VERSION_ERROR;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: RFC 8446 violations: wolfSSL sends the wrong alert type and two alerts when an HRR is missing the supported_versions extension

2 participants