-
Notifications
You must be signed in to change notification settings - Fork 707
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
api: add method to get the iana value for the negotiated cipher suite #2550
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2550 +/- ##
==========================================
+ Coverage 82.09% 82.14% +0.05%
==========================================
Files 272 272
Lines 19188 19186 -2
==========================================
+ Hits 15752 15760 +8
+ Misses 3436 3426 -10 |
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.
Do you want to put this API with the "semi-public" QUIC APIs for now, or do you think it's worth adding to the main APIs?
I think this is worth having outside of QUIC. |
90bca1d
to
0251053
Compare
0251053
to
bfae7e4
Compare
bfae7e4
to
d4292ea
Compare
Description of changes:
Currently there's no way to get the IANA value for a connection's negotiated cipher suite. There is the
s2n_connection_get_cipher
method which returns aconst char *
, but this is less than ideal when trying to match on values programmatically.This change adds a
s2n_connection_get_cipher_iana_value
method which takes two byte pointers and sets those to the negotiated cipher suite. I feel like this is the interface with the fewest sharp edges.The other options I considered were:
uint16_t
. It's nice to just pass a single pointer, but it leads to some ambiguity in the endianness of the contained value.uint8_t *
and requiring that there be 2 elements. This is impossible to enforce and hard to document.Testing:
I added some checks alongside the current tests for the
s2n_connection_get_cipher
method.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.