fix: Initial config influences client hello parsing#4676
Merged
maddeleine merged 13 commits intomainfrom Aug 15, 2024
Merged
Conversation
lrstewart
reviewed
Aug 5, 2024
e2e78b4 to
7459bf0
Compare
goatgoose
reviewed
Aug 13, 2024
lrstewart
reviewed
Aug 13, 2024
goatgoose
approved these changes
Aug 14, 2024
lrstewart
approved these changes
Aug 14, 2024
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.
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.