Skip to content

Add basic handshake defragmentation tests in ssl-opt #9989

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
79a8ded
Add TLS Hanshake defragmentation tests
waleed-elmelegy-arm Jan 24, 2025
0e0d5d4
Improve TLS handshake defragmentation tests
waleed-elmelegy-arm Jan 28, 2025
c0118d8
Fix typo in TLS Handshake defrafmentation tests
waleed-elmelegy-arm Jan 29, 2025
fccd014
Remove unnecessary string check in handshake defragmentation tests
waleed-elmelegy-arm Jan 29, 2025
f912031
Require openssl to support TLS 1.3 in handshake defragmentation tests
waleed-elmelegy-arm Jan 29, 2025
48874b3
Add client authentication to handshake defragmentation tests
waleed-elmelegy-arm Jan 29, 2025
39d83dd
Remove unneeded mtu option from handshake fragmentation tests
waleed-elmelegy-arm Jan 29, 2025
61b8e2d
Enforce client authentication in handshake fragmentation tests
waleed-elmelegy-arm Jan 30, 2025
f162249
Add a comment to elaborate using split_send_frag in handshake defragm…
waleed-elmelegy-arm Jan 30, 2025
a75c7e0
Add guard to handshake defragmentation tests for client certificate
waleed-elmelegy-arm Jan 31, 2025
5f21537
Test Handshake defragmentation only for TLS 1.3 only for small values
waleed-elmelegy-arm Jan 31, 2025
4028cfd
Add missing client certificate check in handshake defragmentation tests
waleed-elmelegy-arm Jan 31, 2025
270dd74
ssl-opt: Updated the keywords to look up during handshake fragmentati…
minosgalanakis Feb 5, 2025
a1b9117
ssl-opt: Added requires_openssl_3_x to defragmentation tests.
minosgalanakis Feb 7, 2025
a8a298c
ssl-opt: Adjusted the wording on handshake fragmentation tests.
minosgalanakis Feb 7, 2025
a4dde77
ssl-opt: Dependency resolving set to use to requires_protocol_version…
minosgalanakis Feb 8, 2025
85fe73d
ssl-opt: Added tls 1.2 tests for HS defragmentation.
minosgalanakis Feb 9, 2025
41782a9
ssl-opt: Added negative-assertion testing, (HS Fragmentation disabled)
minosgalanakis Feb 18, 2025
1c106af
ssl-opt: Added handshake fragmentation tests for 4 byte fragments.
minosgalanakis Feb 18, 2025
74ce749
ssl-opt: Added negative tests for handshake fragmentation.
minosgalanakis Feb 18, 2025
36c81f5
ssl-opt: Added DSA-RSA dependency on TLS1.2 defragmentation testing.
minosgalanakis Feb 20, 2025
d708a63
ssl-opt: Updated documentation.
minosgalanakis Feb 18, 2025
eddbb5a
ChangeLog: Updated the entry for tls-hs-defragmentation
minosgalanakis Feb 19, 2025
a5a8c9f
ssl-opt: Added coverage for hs defragmentation TLS 1.2 tests.
minosgalanakis Feb 20, 2025
99ca668
ssl-opt: Replaced max_send_frag with split_send_frag
minosgalanakis Feb 20, 2025
cd6a24b
ssl-opt.sh: Disabled HS Defrag Tests for TLS1.2 where len < 16
minosgalanakis Feb 24, 2025
c8709c6
ssl-opt: Removed redundant dependencies: requires_openssl_3_x
minosgalanakis Feb 24, 2025
17170a5
ssl-opt: Updated documentation of HS-Defrag tests.
minosgalanakis Feb 27, 2025
19dbbe0
analyze_outcomes: Temporary disabled 3 HS Degragmentation tests.
minosgalanakis Feb 27, 2025
76957cc
ssl-opt: Minor typos and documentation fixes.
minosgalanakis Feb 27, 2025
d01ac30
ssl-opt: Adjusted reference hs defragmentation tests.
minosgalanakis Feb 27, 2025
0dd57a9
ssl-opt: Removed dependencies for HS defrag negative tests.
minosgalanakis Feb 27, 2025
4354dc6
ssl-opt: Re-introduce certificate dependency for HS negative tests.
minosgalanakis Feb 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ChangeLog.d/tls-hs-defrag-in.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@ Bugfix
by the spec. Lack of support was causing handshake failures with some
servers, especially with TLS 1.3 in practice (though both protocol
version could be affected in principle, and both are fixed now).
The initial fragment for each handshake message must be at least 4 bytes.

Server-side, defragmentation of the ClientHello message is only
Copy link
Contributor

Choose a reason for hiding this comment

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

For a follow-up: I think we should document the limitations of defragmentation in the versioned, rendered documentation — so presumably in a Doxygen comment in ssl.h. Especially if this evolves over time, users and maintainers shouldn't have to puzzle out the result from a series of changelog entries. And we then don't need to list all the limitations in the changelog entry.

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point. Generally speaking, we (and I'm as guilty of it as anyone) tend to put too much information in the ChangeLog that should really be in the documentation.

In this case though, I'm not entirely sure where this would fit in ssl.h. In the documentation of ssl_handshake()?

Ideally, I think in addition to doxygen comments, we should have a (versioned) summary document for what's implemented or not or partially for TLS 1.2, DTLS and for X.509. I think we have something like this for TLS 1.3 (docs/architecture/tls13-support.md). For TLS 1.2 I thought there was something (as list of implemented RFCs, probably outdated) in the old Knowledge Base but I can't find it any more.

supported if the server accepts TLS 1.3 (regardless of whether the
ClientHello is 1.3 or 1.2). That is, servers configured (either
at compile time or at runtime) to only accept TLS 1.2 will
still fail the handshake if the ClientHello message is fragmented.
5 changes: 5 additions & 0 deletions tests/scripts/analyze_outcomes.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ def _has_word_re(words: typing.Iterable[str],
# TLS doesn't use restartable ECDH yet.
# https://github.com/Mbed-TLS/mbedtls/issues/7294
re.compile(r'EC restart:.*no USE_PSA.*'),
# Temporary disable Handshake defragmentation tests until mbedtls
# pr #10011 has been merged.
'Handshake defragmentation on client: len=4, TLS 1.2',
'Handshake defragmentation on client: len=5, TLS 1.2',
'Handshake defragmentation on client: len=13, TLS 1.2'
],
'test_suite_config.mbedtls_boolean': [
# Missing coverage of test configurations.
Expand Down
Loading