-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Strengthen validation of end-entity key usage when present #15018
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sjudson
wants to merge
3
commits into
pyca:main
Choose a base branch
from
trail-of-forks:sj/keyusage
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -640,6 +640,12 @@ mod ee { | |||||
| "EE keyUsage must not assert keyCertSign".to_string(), | ||||||
| ))); | ||||||
| } | ||||||
|
|
||||||
| if !key_usage.digital_signature() { | ||||||
| return Err(ValidationError::new(ValidationErrorKind::Other( | ||||||
| "EE keyUsage must assert digitalSignature when present".to_string(), | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At this point we have a
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've cut this. |
||||||
| ))); | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| Ok(()) | ||||||
|
|
||||||
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: CABF 7.1.2.7.11 requires
digitalSignaturefor subscriber certs (i.e. EEs) that convey ECC keys, but does not require it for subscriber certs that convey RSA keys:This is an incredible mess in practice: the BR says that an RSA-conveying subscriber cert MUST have at least one keyUsage, but no specific one is a MUST in practice unless the validator knows the TLS version being used.
Given that, I think we have two options here:
digitalSignature. This...probably works fine in practice, even though it's technically stricter than what the BRs say?digitalSignature | keyEncipherment | dataEncipherment.Curious what @alex and @reaperhulk think about this as well 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I'm still unsure if we want to enforce this at all, or if we want to allow configuring it on the policy builder? (Or just require users to provide their own extension validator for KU)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes sense to enforce in our default policy, since we're otherwise relatively strict about CABF (and the limbo results suggest that other validators check this). But it is indeed somewhat annoying to enforce correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know if the other validators are key-type aware?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't test that yet, will do so tonight 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes the word "modern" was doing perhaps a bit too much heavy lifting in my initial description.
I've now added distinct handling for RSA that considers
keyEnciphermentsufficient (and allows both, despite being NOT RECOMMENDED) to be more permissive for the default validation.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@woodruffw did you get a chance to test this?