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

test: avoid mutating static configs in tests #4749

Merged
merged 6 commits into from
Sep 10, 2024
Merged

Conversation

toidiu
Copy link
Contributor

@toidiu toidiu commented Sep 4, 2024

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.

@github-actions github-actions bot added the s2n-core team label Sep 4, 2024
@toidiu toidiu marked this pull request as ready for review September 4, 2024 19:56
@toidiu toidiu requested a review from goatgoose September 4, 2024 19:57
EXPECT_SUCCESS(s2n_config_set_cipher_preferences(config, "20240501"));

Copy link
Contributor

@lrstewart lrstewart Sep 9, 2024

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.

Copy link
Contributor Author

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.

@toidiu toidiu enabled auto-merge (squash) September 9, 2024 20:47
@toidiu toidiu merged commit 79fdd44 into aws:main Sep 10, 2024
36 checks passed
@toidiu toidiu deleted the ak-staticConfig branch September 11, 2024 00:16
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