Harden constitution validation for JWT, CA, and member keys#7924
Draft
Copilot wants to merge 12 commits into
Draft
Harden constitution validation for JWT, CA, and member keys#7924Copilot wants to merge 12 commits into
Copilot wants to merge 12 commits into
Conversation
Copilot
AI
changed the title
[WIP] Fix insufficient strictness in constitution validators
Harden constitution validation for JWT, CA, and member keys
Jun 5, 2026
achamayou
reviewed
Jun 5, 2026
achamayou
reviewed
Jun 5, 2026
Member
|
@copilot add a relevant changelog entry |
Contributor
Author
- Use ceiling division when sizing EC coordinate/private-scalar buffers so curves whose bit-size is not a multiple of 8 (P-521 has 521 bits) get the full 66-byte buffer rather than a truncated 65-byte one. This fixes BN_bn2binpad failures and dropped leading-zero bytes when round-tripping P-521 keys through JWK. - Update test_jwt_auth_raw_key to use an https:// JWT issuer URL so it satisfies the hardened set_jwt_issuer constitution validator added in this PR. - Run clang-format on curve.h and crypto.cpp.
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.
Constitution validators accepted weak or malformed security inputs, including unsafe JWKS metadata, non-HTTPS JWT issuers, non-CA TLS trust anchors, and unchecked member encryption keys. This tightens validation using the existing JS crypto surface where available.
kidvalues.ktytoRSAorEC.usetosig.algto supported signing algorithms (RS256,ES256).x5ccertificate chains to the provided root.JWT issuer validation
auto_refresh.CA bundle validation
set_ca_cert_bundlenow requires certificates that validate as CA trust anchors, not merely parseable PEM.Member encryption key validation
set_membernow validatesencryption_pub_keyas a well-formed RSA public key with minimum strength before storing it.P-521 support
Coverage updates