Skip to content

fix(bindings): tie ClientHello lifetime to Fingerprint#5747

Merged
CarolYeh910 merged 2 commits intomainfrom
WesleyRosenblum/fingerlifetime
Feb 18, 2026
Merged

fix(bindings): tie ClientHello lifetime to Fingerprint#5747
CarolYeh910 merged 2 commits intomainfrom
WesleyRosenblum/fingerlifetime

Conversation

@WesleyRosenblum
Copy link
Copy Markdown
Contributor

Goal

Tie the ClientHello lifetime to the returned Fingerprint in the ClientHello fingerprinting builder.

We would like to thank Joshua Rogers (https://joshua.hu/) of AISLE Research Team (https://aisle.com/) for reporting this issue.

Why

Builder::build previously accepted client_hello: &ClientHello with an anonymous lifetime, meaning the borrow checker didn't enforce that the ClientHello outlives the Fingerprint. Since the underlying C code holds a raw pointer to the ClientHello, a caller could drop the ClientHello while the Fingerprint still references it.

How

Changed the client_hello parameter from &ClientHello to &'a ClientHello, binding it to the same lifetime 'a as &'a mut self and the returned Fingerprint<'a>.

Callouts

This is a source-compatible change for correct usage. Any existing code where the ClientHello already outlives the Fingerprint will continue to compile. Code that relied on the missing lifetime bound was unsound and will now fail to compile.

Testing

  • compile_fail,E0597 doctest verifies the compiler rejects dangling ClientHello references.
  • Run with: cargo test --manifest-path bindings/rust/extended/s2n-tls/Cargo.toml --features unstable-fingerprint --doc fingerprint

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@WesleyRosenblum WesleyRosenblum added this pull request to the merge queue Feb 18, 2026
@CarolYeh910 CarolYeh910 removed this pull request from the merge queue due to a manual request Feb 18, 2026
@CarolYeh910 CarolYeh910 added this pull request to the merge queue Feb 18, 2026
Merged via the queue into main with commit e8b6bc7 Feb 18, 2026
57 checks passed
@CarolYeh910 CarolYeh910 deleted the WesleyRosenblum/fingerlifetime branch February 18, 2026 21:34
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.

4 participants