Add relax-rsa-key-usage feature to restore historical RSA keyUsage - #512
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 #512Conversation
cjpatton
left a comment
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 |
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).
There was a problem hiding this comment.
Likewise for the commit message for the new patch.
|
Good call. I'll take care of both. |
8bf3d4b to
b971e57
Compare
|
Okay, those requested changes should be handled now. I'm getting a ci error, but it seems like a flake |
|
I kicked the job and it failed the same way. Looks like an issue with CI itself, probably just needs updating. |
| # (KEY_USAGE_BIT_INCORRECT). Enabling this feature applies a build-time | ||
| # patch that sets the default back to `false`, so RSA keyUsage mismatches | ||
| # are non-fatal. Non-RSA keyUsage enforcement is unaffected. | ||
| relax-rsa-key-usage = [] |
There was a problem hiding this comment.
Consider a rename that allows us to reuse this for other changes like this.
| relax-rsa-key-usage = [] | |
| relax-cert-validation = [] |
…e default BoringSSL starting with BORINGSSL_API_VERSION 19 (see include/openssl/base.h) 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-cert-validation` Cargo feature that applies a build-time patch restoring the historical default (false). When the feature is not enabled, the strict BoringSSL behaviour is preserved. Non-RSA keyUsage enforcement is unaffected in either case. A unit test verifies that a TLS 1.2 ECDHE-RSA server certificate with keyUsage missing the digitalSignature bit is rejected by default and accepted when the feature is enabled.
b971e57 to
0807b30
Compare
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.