-
Notifications
You must be signed in to change notification settings - Fork 712
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
Add unit test for setting server cipher preferences in the CH callback #4550
base: main
Are you sure you want to change the base?
Conversation
Thanks for the PR ! We'll have a look. |
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.
Thanks for the PR!
Within this callback, are calls to
s2n_connection_set_cipher_preferences
also valid?
Yes, I believe this should be valid, since the client hello callback is invoked before a cipher suite is negotiated.
@@ -104,6 +105,22 @@ int mock_client(struct s2n_test_io_pair *io_pair, int expect_failure, int expect | |||
exit(result); | |||
} | |||
|
|||
bool security_policy_contains_cipher(const char* security_policy_name, uint8_t* cipher_iana) { |
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.
Nice, it looks like this is working with the FIPS test now. The only failing test is for clang-format:
bool security_policy_contains_cipher(const char* security_policy_name, uint8_t* cipher_iana) { | |
bool security_policy_contains_cipher(const char *security_policy_name, uint8_t *cipher_iana) | |
{ |
#include "tls/s2n_security_policies.h" | ||
#include "tls/s2n_internal.h" |
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.
clang-format:
#include "tls/s2n_security_policies.h" | |
#include "tls/s2n_internal.h" | |
#include "tls/s2n_internal.h" | |
#include "tls/s2n_security_policies.h" |
This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Description of changes:
This adds a new unit test for changing server cipher preferences in the ClientHello callback
From the documentation of s2n_client_hello_fn:
Within this callback, are calls to
s2n_connection_set_cipher_preferences
also valid? I found no documentation or unit test that confirms this, so I'm contributing one under the premise that this is the case.Testing
I confirmed that removing the
s2n_connection_set_cipher_preferences()
call from the test callback fails the new unit test.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.