Skip to content

feat(bindings): expose signature scheme API#5708

Merged
jmayclin merged 2 commits intoaws:mainfrom
jmayclin:2026-01-21-signature-scheme-bindings
Jan 31, 2026
Merged

feat(bindings): expose signature scheme API#5708
jmayclin merged 2 commits intoaws:mainfrom
jmayclin:2026-01-21-signature-scheme-bindings

Conversation

@jmayclin
Copy link
Copy Markdown
Contributor

Goal

Expose s2n_connection_get_signature_scheme in 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.

* use ffi::c_char, not byte
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)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The answer is that the get_selected_signature_algorithm does not return the precise string that we need for logging.

@jmayclin jmayclin added this pull request to the merge queue Jan 27, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 27, 2026
@jmayclin jmayclin added this pull request to the merge queue Jan 31, 2026
Merged via the queue into aws:main with commit fc58af9 Jan 31, 2026
53 checks passed
@jmayclin jmayclin deleted the 2026-01-21-signature-scheme-bindings branch January 31, 2026 01:30
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