Skip to content

chore: add static lists of supported TLS parameters#5698

Merged
jmayclin merged 8 commits intoaws:mainfrom
jmayclin:2026-01-12-static-lists
Jan 16, 2026
Merged

chore: add static lists of supported TLS parameters#5698
jmayclin merged 8 commits intoaws:mainfrom
jmayclin:2026-01-12-static-lists

Conversation

@jmayclin
Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions bot added the s2n-core team label Jan 13, 2026
@jmayclin jmayclin changed the title chore: add statis lists of supported TLS parameters chore: add static lists of supported TLS parameters Jan 13, 2026
* add copyright headers
* update bindgen version
* remove usage of std::ptr::dangling
* remove clippy lints on generated code
@kaukabrizvi kaukabrizvi self-requested a review January 15, 2026 20:07
@kaukabrizvi kaukabrizvi dismissed a stale review January 15, 2026 20:08

Published before finishing review, re-reviewing now!

use std::{env, path::PathBuf};

fn main() {
println!("cargo:rerun-if-changed=wrapper.h");
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.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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
@jmayclin jmayclin enabled auto-merge January 16, 2026 05:30
@jmayclin jmayclin added this pull request to the merge queue Jan 16, 2026
Merged via the queue into aws:main with commit 469e52d Jan 16, 2026
53 checks passed
@jmayclin jmayclin deleted the 2026-01-12-static-lists branch January 16, 2026 06:37
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