Add relax-rsa-key-usage feature to restore historical RSA keyUsage #512
Open
johnhurt wants to merge 1 commit into
Open
Add relax-rsa-key-usage feature to restore historical RSA keyUsage #512johnhurt wants to merge 1 commit into
relax-rsa-key-usage feature to restore historical RSA keyUsage #512johnhurt wants to merge 1 commit into
Conversation
…default BoringSSL 5.x changed SSL_CONFIG::enforce_rsa_key_usage to default to true, making client-side RSA leaf keyUsage mismatches a fatal handshake error (KEY_USAGE_BIT_INCORRECT). Many real-world origins serve certificates whose keyUsage does not include the bit required by the negotiated cipher suite; OpenSSL and prior BoringSSL pins accepted them. This adds a new `relax-rsa-key-usage` Cargo feature that applies a build-time patch restoring the historical default (false). When the feature is not enabled, the BoringSSL 5.x strict behaviour is preserved. Non-RSA keyUsage enforcement is unaffected in either case.
cjpatton
reviewed
Jun 24, 2026
cjpatton
left a comment
Collaborator
There was a problem hiding this comment.
Looks good. Can you update CI to make sure the patch is tested? Also consider adding a unit test with a cert that would validate with and without this feature.
| underscore-wildcards = [] | ||
|
|
||
| # Restores the historical BoringSSL default of not enforcing RSA keyUsage | ||
| # during TLS handshakes. BoringSSL 5.x changed `enforce_rsa_key_usage` to |
Collaborator
There was a problem hiding this comment.
The version number refers to the boring crate, not BoringSSL, correct? It might be more helpful to refer to the value of BORINGSSL_API_VERSION in the BoringSSL repo itself (include/openssl/base.h).
Collaborator
There was a problem hiding this comment.
Likewise for the commit message for the new patch.
Contributor
Author
|
Good call. I'll take care of both. |
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.
BoringSSL 5.x includes an update to openssl that changed SSL_CONFIG::enforce_rsa_key_usage to default to true, making client-side RSA leaf keyUsage mismatches a fatal handshake error (KEY_USAGE_BIT_INCORRECT). Many real-world origins serve certificates whose keyUsage does not include the bit required by the negotiated cipher suite; OpenSSL and prior BoringSSL pins accepted them.
This adds a new
relax-rsa-key-usageCargo feature that applies a build-time patch restoring the historical default (false). When the feature is not enabled, the BoringSSL 5.x strict behaviour is preserved. Non-RSA keyUsage enforcement is unaffected in either case.