-
Notifications
You must be signed in to change notification settings - Fork 698
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
Audit connection bitfield for thread safety #4036
Conversation
67bb4d0
to
cf221b9
Compare
This PR has gotten a bit unfocused / disjointed. I'm going to split out some of the less relevant changes. |
Is there an issue for this? |
03ee173
to
08da3d0
Compare
@@ -223,7 +223,7 @@ int main(int argc, char **argv) | |||
EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&stuffer, 0)); | |||
EXPECT_SUCCESS(s2n_connection_set_io_stuffers(&stuffer, &stuffer, client_conn)); | |||
|
|||
client_conn->key_update_pending = true; | |||
client_conn->key_update_pending = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Is this change needed? I tend to prefer bools for flags as it indicates the intent better, rather than it being just some arbitrary number.
I've been moving the changes from this PR into other PRs. Closing this one. |
Resolved issues:
resolves #4026
Description of changes:
I went through the bitfield in s2n_connection and pulled out the two variables set post-handshake. I also added more documentation to make the situation clearer.
Testing:
Existing tests pass.
I also added a new test that runs with separate threads for send and receive. When run with ThreadSanitizer, it detected the issues fixed in this PR.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.