Add TLS 1.2 PRF module and bindings#487
Merged
kornelski merged 2 commits intocloudflare:masterfrom Apr 13, 2026
Merged
Conversation
Expose a new boring::prf::tls1_prf helper that wraps the TLS 1.2 PRF and document it with RFC 5246 context. Add vector tests for SHA-224, SHA-256, SHA-384, and SHA-512 to verify output compatibility. Declare CRYPTO_tls1_prf in boring-sys as a manual extern because the symbol is exported by BoringSSL but declared only in an internal header, so bindgen does not emit it. Keep this as a small explicit declaration in lib.rs as the simplest and most robust approach for a single missing symbol, instead of adding fragile bindgen plumbing for internal headers.
Collaborator
|
Why the -sys crate modification? bindgen should have generated the extern "C" definition for you |
Contributor
Author
|
The symbol is defined in an internal header that's not looked at by bindgen. Alternative is to add a patch that exposes it to a public header but that feels more brittle than simply defining the symbol the way I did |
kornelski
approved these changes
Apr 13, 2026
Contributor
Author
|
Thanks for adding the feature-flag gate! |
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.
Expose a new boring::prf::tls1_prf helper that wraps the TLS 1.2 PRF and document it with RFC 5246 context. Add vector tests for SHA-224, SHA-256, SHA-384, and SHA-512 to verify output compatibility.
Declare CRYPTO_tls1_prf in boring-sys as a manual extern because the symbol is exported by BoringSSL but declared only in an internal header, so bindgen does not emit it. Keep this as a small explicit declaration in lib.rs as the simplest and most robust approach for a single missing symbol, instead of adding fragile bindgen plumbing for internal headers.