feat(bindings): expose signature scheme API#5708
Merged
Conversation
* use ffi::c_char, not byte
kaukabrizvi
approved these changes
Jan 23, 2026
maddeleine
reviewed
Jan 26, 2026
| pub fn signature_scheme(&self) -> Option<&'static str> { | ||
| let mut sig_alg: *const std::ffi::c_char = std::ptr::null(); | ||
| unsafe { | ||
| s2n_connection_get_signature_scheme(self.connection.as_ptr(), &mut sig_alg) |
Contributor
There was a problem hiding this comment.
We seem to have multiple signature getters, one of which is already in the rust bindings. Why do we need a second one/what's the difference between s2n_connection_get_selected_signature_algorithm and s2n_connection_get_signature_scheme? Do we actually need both of them in the rust bindings?
Contributor
There was a problem hiding this comment.
The answer is that the get_selected_signature_algorithm does not return the precise string that we need for logging.
maddeleine
approved these changes
Jan 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal
Expose
s2n_connection_get_signature_schemein the rust bindings.Why
I am using it in one aspect of the handshake event metrics stuff.
How
We just add the binding.
Callouts
The cstring stuff was used in multiple places, so I moved it to a new utilities module.
Testing
I added unit tests covering the same and none cases.
Related
Related to metrics work
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.