Skip to content
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

Add TLS Handshake defragmentation tests #9928

Open
wants to merge 30 commits into
base: development
Choose a base branch
from

Conversation

waleed-elmelegy-arm
Copy link
Contributor

@waleed-elmelegy-arm waleed-elmelegy-arm commented Jan 24, 2025

Description

Fixes #9887
Add TLS Handshake defragmentation tests based on implementation done in #9872 .

PR checklist

  • changelog provided
  • development PR provided
  • framework PR not required
  • 3.6 PR provided #TODO
  • 2.28 PR not required because: New feature
  • tests provided

rojer and others added 3 commits December 25, 2024 14:34
Co-authored-by: minosgalanakis <[email protected]>
Signed-off-by: Deomid Ryabkov <[email protected]>
Signed-off-by: Deomid rojer Ryabkov <[email protected]>
@waleed-elmelegy-arm waleed-elmelegy-arm added component-tls size-s Estimated task size: small (~2d) labels Jan 24, 2025
@waleed-elmelegy-arm waleed-elmelegy-arm force-pushed the defrag-tls-handshake-tests branch 2 times, most recently from bfec8af to fc9f04e Compare January 24, 2025 17:53
@waleed-elmelegy-arm waleed-elmelegy-arm added the needs-preceding-pr Requires another PR to be merged first label Jan 24, 2025
rojer added 2 commits January 26, 2025 11:12
Signed-off-by: Deomid rojer Ryabkov <[email protected]>
Except the first

Signed-off-by: Deomid rojer Ryabkov <[email protected]>
@minosgalanakis minosgalanakis self-requested a review January 27, 2025 10:05
@waleed-elmelegy-arm waleed-elmelegy-arm force-pushed the defrag-tls-handshake-tests branch 2 times, most recently from 4a74b6c to 9fae2db Compare January 27, 2025 11:32
@waleed-elmelegy-arm waleed-elmelegy-arm marked this pull request as ready for review January 27, 2025 11:33
@waleed-elmelegy-arm waleed-elmelegy-arm added needs-review Every commit must be reviewed by at least two team members, needs-ci Needs to pass CI tests labels Jan 27, 2025
Copy link
Contributor

@mpg mpg left a comment

Choose a reason for hiding this comment

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

Looking pretty good, I like the selection of fragment sizes tested. Just two things:

  • missing TLS 1.3 as pointed out in a comment;
  • we're only testing this when we're the client, should we also have some tests where we're the server (we'll probably want them to use client authentication so that the client has a large message to fragment: its certificate)?

Signed-off-by: Deomid rojer Ryabkov <[email protected]>
Copy link
Contributor

@mpg mpg left a comment

Choose a reason for hiding this comment

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

Thanks for addressing my feedback. This looks good to me, but the CI disagrees. Can you look into it? We probably need some require lines...

@mpg
Copy link
Contributor

mpg commented Jan 29, 2025

Several tests are failing with:

ssl_tls12_server.c:1077: |1| 0x7fffb0dde280: bad client hello message: 5 != 4 + 284

(or obviously a variant with different sizes). We might need to adapt this check in the original PR - Cc @rojer

Copy link
Contributor

@minosgalanakis minosgalanakis left a comment

Choose a reason for hiding this comment

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

Looks ok, just have some questions about the conditions we are testing.

@waleed-elmelegy-arm waleed-elmelegy-arm force-pushed the defrag-tls-handshake-tests branch 3 times, most recently from c8993e0 to 909e716 Compare January 30, 2025 18:51
Copy link
Contributor

@mpg mpg left a comment

Choose a reason for hiding this comment

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

Thanks for addressing our comments. Looks good to me on code inspection, but the CI doesn't seem fully happy yet, I'll have a look.

@minosgalanakis minosgalanakis force-pushed the defrag-tls-handshake-tests branch 2 times, most recently from a11d40b to d9bf91d Compare February 13, 2025 00:10
The first fragment of a fragmented handshake message always starts at the beginning of the buffer so there's no need to store it.

Signed-off-by: Deomid rojer Ryabkov <[email protected]>
waleed-elmelegy-arm and others added 20 commits February 16, 2025 18:42
Tests uses openssl s_server with a mix of max_send_frag
and split_send_frag options.

Signed-off-by: Waleed Elmelegy <[email protected]>
* Add tests for the server side.
* Remove restriction for TLS 1.2 so that we can test TLS 1.2 & 1.3.
* Use latest version of openSSL to make sure -max_send_frag &
  -split_send_frag flags are supported.

Signed-off-by: Waleed Elmelegy <[email protected]>
TODO: This is an intermediate commit for review purposes.
All of the removed cases will need to be validated.

Signed-off-by: Minos Galanakis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component-tls needs-preceding-pr Requires another PR to be merged first needs-review Every commit must be reviewed by at least two team members, size-s Estimated task size: small (~2d)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Basic ssl-opt testing for TLS HS defragmentation
5 participants