-
Notifications
You must be signed in to change notification settings - Fork 721
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
test: avoid mutating static configs in tests #4749
Conversation
219e535
to
a40ad5b
Compare
a40ad5b
to
bcdc37b
Compare
EXPECT_SUCCESS(s2n_config_set_cipher_preferences(config, "20240501")); | ||
|
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.
Setting the cipher preferences to a specific security policy might be confusing given that you then immediately manually set the policy to NULL on line 257.
But I guess you're doing this pre-emptively as part of removing implicit defaults? It might actually be preferable to let whatever mechanism you're working on for that catch this. I know we discussed comments indicating that the call to set cipher preferences was added automatically as part of that work, which would clarify this logic.
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.
Yea its a bit odd in this test due to the immediate NULL-ing. Ill do as you suggest, remove it and fix it during the implicit detection.
a3e3b75
to
788c53a
Compare
Description of changes:
s2n-tls instantiates 3 static configs and sets them by default on a new config/connection objects. These static configs provide a sane configuration so that users can easily start using the library. Since the static configs represent a immutable value, we should avoid mutating them once they have been initialized.
This PR amends tests which were modifying the static configs.
Testing:
Tests should continues to pass.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.