chore: add static lists of supported TLS parameters#5698
Merged
Conversation
* add copyright headers * update bindgen version * remove usage of std::ptr::dangling * remove clippy lints on generated code
* rustfmt
maddeleine
approved these changes
Jan 15, 2026
bindings/rust/standard/s2n-metrics-subscriber/src/static_lists.rs
Outdated
Show resolved
Hide resolved
Published before finishing review, re-reviewing now!
kaukabrizvi
reviewed
Jan 15, 2026
bindings/rust/standard/s2n-metrics-subscriber/src/static_lists.rs
Outdated
Show resolved
Hide resolved
bindings/rust/standard/s2n-metrics-subscriber/src/static_lists.rs
Outdated
Show resolved
Hide resolved
| use std::{env, path::PathBuf}; | ||
|
|
||
| fn main() { | ||
| println!("cargo:rerun-if-changed=wrapper.h"); |
Contributor
There was a problem hiding this comment.
Is there a reason to only watch wrapper.h here? Just checking whether we want to rerun bindgen when the included s2n headers themselves change as well.
Contributor
Author
There was a problem hiding this comment.
Generally you should only be watching files that are in the scope of your crate.
I'm not sure whether cargo even support watching files outside of your crate 🤔
To more concretely answer your question, these are the files from the s2n-tls crate s2n-tls/lib folder, which should be treated as read-only, and only change when the s2n-tls crate version changes (which will trigger a rebuild of this anyways.)
* I'm not sure if I've fixed the openssl include issue ...
* okay, i'm pretty sure i'm correctly including the libcrypto stuff now
kaukabrizvi
approved these changes
Jan 16, 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
Add static definitions of all s2n-tls parameters.
Why
Because we need to know the number of static parameters so that we can use arrays of atomic integers in our metrics subscriber, rather than relying on a hashmap (which would require a mutex/locking)
How
We write internal bindings using bindgen, creating a test-only crate that can iterate over properties of the security policy.
Testing
Added unit tests.
Related
To metrics subscriber.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.