ZD-22438: fix TLS version checks - #11456
padelsbach wants to merge 5 commits into
Conversation
798d83e to
c9cca6b
Compare
|
retest this please |
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11456
Scan targets checked: wolfssl-src, wolfssl-bugs
Findings: 2
2 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Reported findings require changes before merge.
| } | ||
|
|
||
| ssl->options.downgrade = 0; | ||
| ssl->options.versionSet = 1; |
There was a problem hiding this comment.
SetVersion leaves protocol downgrade enabled · TLS protocol issues
wolfSSL_SetVersion() no longer clears options.downgrade, so flexible-method sessions negotiate below the selected version. Unlike known #6545's missing downgrade sentinel, this expands the allowed range itself.
Related known finding #1810 (similar but distinct): Both can permit negotiation of older TLS versions, but #1810 is compile-time insecure context defaults in wolfSSL_CTX_new_ex, while this is stale per-session downgrade state in wolfSSL_SetVersion. The faulting operations, root causes, and required patches differ.
Suggested fix: Clear downgrade when only wolfSSL_SetVersion() is set; re-enable it only when an explicit minimum establishes a range.
Basis: wolfSSL API Reference, wolfSSL_SetVersion: the call overrides the session protocol setting with version.
There was a problem hiding this comment.
Fixed. This was an intentional choice, but swapped the behavior back.
| server_cbf.method = wolfSSLv23_server_method; | ||
| client_cbf.ssl_ready = test_SetVersion_tls12_ssl_ready; | ||
|
|
||
| ExpectIntEQ(test_wolfSSL_client_server_nofail_memio(&client_cbf, |
There was a problem hiding this comment.
Handshake test does not verify negotiated version · Weak or missing assertions
test_wolfSSL_SetVersion_tls12_with_tls13_peer() checks only handshake success; an implementation that ignores the TLS 1.2 override and negotiates TLS 1.3 still passes.
Suggested fix: Assert wolfSSL_get_version() equals TLSv1.2 for both peers after the handshake.
Basis: wolfSSL API Reference, wolfSSL_SetVersion: the call overrides the session protocol setting with version.
|
|
Please address the Fenrir report. I thumbed up the one I identified when also reviewing the PR. Once addressed then assign back to wolfssl-bot. |
|
@JacobBarthelmeh, my mistake, I had missed a push. Updates applied. Back over to you. |
|
retest this please |
Description
Fix to enable
wolfSSL_SetVersionvalue to be reflected in version advertisements.Fixes zd 22438
Testing
New test cases
Checklist