Skip to content

fix: Initial config influences client hello parsing#4676

Merged
maddeleine merged 13 commits intomainfrom
initial_config
Aug 15, 2024
Merged

fix: Initial config influences client hello parsing#4676
maddeleine merged 13 commits intomainfrom
initial_config

Conversation

@maddeleine
Copy link
Copy Markdown
Contributor

@maddeleine maddeleine commented Jul 30, 2024

Resolved issues:

Partially tackles #4585

Description of changes:

This PR strengthens our assertion that servers don't use the config before the client hello callback is invoked (allowing the user to swap out the config based on information in the client hello.)
I added a test that we aren't dereferencing anything on the config before the client hello cb is invoked. The way I do this is by setting the connection's config pointer to null. Any attempt to dereference pointers on that config will error/segfault.

I fixed a couple places where we do reference the config before the callback is invoked. One of those is setting a default ecc curve if the client doesn't send any ecc preferences in the extensions. I moved that chunk of code from the "parsing" function to the "processing" function.

Call-outs:

I'm not fixing everything in #4585. Our sslv2 client hello processing code uses the config before the client hello callback is invoked. I don't want to refactor our sslv2 client hello code right now, as we don't yet have an integration test for that behavior. Once this is done, we should have more assurance that a refactor is safe.

Testing:

Adds tests.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions github-actions bot added the s2n-core team label Jul 30, 2024
@maddeleine maddeleine changed the title Initial config fix: Initial config influences client hello parsing Jul 30, 2024
@maddeleine maddeleine requested review from goatgoose and lrstewart and removed request for jmayclin August 13, 2024 16:50
@maddeleine maddeleine enabled auto-merge (squash) August 14, 2024 21:49
@maddeleine maddeleine merged commit 9cca574 into main Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants