Enable SCSV check unconditionally#10661
Open
yosuke-wolfssl wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes RFC 7507 TLS_FALLBACK_SCSV enforcement always compiled in (no build-time gate), fixes the server-side downgrade comparison to use the effective runtime max protocol version (including DTLS inversion rules), and adds targeted API tests to validate both positive and negative cases.
Changes:
- Remove the
HAVE_FALLBACK_SCSVbuild option and associated configuration/docs defines so fallback-SCSV handling is always present. - Fix downgrade detection by snapshotting the server’s effective max version (
ssl->version.minor) before negotiation mutates it, and invert the comparison for DTLS. - Add four manual-memio handshake tests covering TLS/DTLS inappropriate_fallback behavior and two “no downgrade” negative controls (including runtime-disabled TLS 1.3).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/internal.c |
Always enforce TLS_FALLBACK_SCSV and correct downgrade comparison using a pre-negotiation max snapshot, including DTLS inversion. |
configure.ac |
Remove the --enable-fallback-scsv option and related flag/summary output. |
CMakeLists.txt |
Remove mention of the fallback SCSV option from the option list comment. |
examples/configs/user_settings_all.h |
Drop HAVE_FALLBACK_SCSV define from the “all settings” example config. |
wrapper/Ada/user_settings.h |
Drop HAVE_FALLBACK_SCSV define from Ada wrapper user settings. |
tests/api/test_tls.h |
Register new fallback-SCSV tests in declarations and test list. |
tests/api/test_tls.c |
Add TLS/DTLS fallback-SCSV tests (positive + negative controls) via manual-memio harness. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5ae0907 to
92281ae
Compare
92281ae to
e2ed815
Compare
|
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #10661
Scan targets checked: wolfcrypt-rs-bugs, wolfssl-bugs, wolfssl-src
No new issues found in the changed files. ✅
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enable TLS_FALLBACK_SCSV check unconditionally
Summary
The TLS_FALLBACK_SCSV (RFC 7507) anti-downgrade enforcement was previously gated
behind the
HAVE_FALLBACK_SCSVbuild option (orOPENSSL_ALL), so a defaultbuild silently ignored a client's
TLS_FALLBACK_SCSV(0x5600) signaling cipher.This makes the check always compiled in and fixes a latent bug in how the
server determines whether a real downgrade occurred.
Changes
Always enforce the check (
src/internal.c)#if defined(HAVE_FALLBACK_SCSV) || defined(OPENSSL_ALL)guardaround the
TLS_FALLBACK_SCSVhandling inDoClientHello; the check now runsin every build.
HAVE_FALLBACK_SCSVoption from the build system and docs(
configure.ac,CMakeLists.txt,examples/configs/user_settings_all.h,wrapper/Ada/user_settings.h, and the option list comment ininternal.c).Fix the downgrade comparison
ssl->ctx->method->version.minor(the compiled maximum). That ignoredruntime restrictions such as
SSL_OP_NO_TLSv1_3on a TLS 1.3-capable method,producing a false-positive
inappropriate_fallbackabort for a client thatlegitimately offered the server's effective maximum version.
ssl->version.minor) intomaxMinorbefore the downgrade logic lowers it to the negotiated version,and compares against that.
as the version increases (DTLS 1.0 = 0xff, 1.2 = 0xfd, 1.3 = 0xfc):
Tests (
tests/api/test_tls.c,test_tls.h)Added four targeted handshake tests driven through the manual-memio harness:
test_tls_fallback_scsvVERSION_ERRORand sendinappropriate_fallback(86) on the wire.test_dtls_fallback_scsvtest_tls_fallback_scsv_no_downgradetest_tls_fallback_scsv_no_downgrade_runtime_maxmethod->version.minorcomparison broke).