-
Notifications
You must be signed in to change notification settings - Fork 1.8k
reject empty subjectAltName and issuerAltName sequences #15472
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
dxbjavid
wants to merge
2
commits into
pyca:main
Choose a base branch
from
dxbjavid:empty-san-ian-sequence
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
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
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
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
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
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 |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| -----BEGIN CERTIFICATE----- | ||
| MIIBMjCB2aADAgECAgQHW80VMAoGCCqGSM49BAMCMBoxGDAWBgNVBAMMD2NyeXB0 | ||
| b2dyYXBoeS5pbzAeFw0yNTAxMDEwMDAwMDBaFw0zNTAxMDEwMDAwMDBaMBoxGDAW | ||
| BgNVBAMMD2NyeXB0b2dyYXBoeS5pbzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IA | ||
| BBB0GLaeloeWg3Gco3XAypqHZq48UdTm60oI6KfKH6+dtY/7EKFEJaYNj2tQfMS8 | ||
| +EwNn3y2nUacAFdPweu0O92jDTALMAkGA1UdEgQCMAAwCgYIKoZIzj0EAwIDSAAw | ||
| RQIhAIv3h7z+YD321gf/jnz2FhqcHZ+MZg7+Lhss7ym6Pt+0AiAYYE5CjExH/QTd | ||
| muKQ8B78WqZE4glTIkKqN6050Ltokg== | ||
| -----END CERTIFICATE----- |
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 |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| -----BEGIN CERTIFICATE----- | ||
| MIIBMjCB2aADAgECAgQHW80VMAoGCCqGSM49BAMCMBoxGDAWBgNVBAMMD2NyeXB0 | ||
| b2dyYXBoeS5pbzAeFw0yNTAxMDEwMDAwMDBaFw0zNTAxMDEwMDAwMDBaMBoxGDAW | ||
| BgNVBAMMD2NyeXB0b2dyYXBoeS5pbzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IA | ||
| BBB0GLaeloeWg3Gco3XAypqHZq48UdTm60oI6KfKH6+dtY/7EKFEJaYNj2tQfMS8 | ||
| +EwNn3y2nUacAFdPweu0O92jDTALMAkGA1UdEQQCMAAwCgYIKoZIzj0EAwIDSAAw | ||
| RQIgFtbOPouE/CuyKQ+TuGil2iOk2yq8ISLKjegKpMlRTV4CIQDQ5zSTl1p5nyoc | ||
| B7o2lMSPf+6L8FVow8ASh1sb9rS18g== | ||
| -----END CERTIFICATE----- |
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.
SequenceOftakes aMINIMUM_LEN, is there a reason not to just set that to 1?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 looked at that first, but the SubjectAlternativeName and IssuerAlternativeName aliases are shared with the path validation engine, which stands in for a certificate with no SAN by parsing an empty sequence into SubjectAlternativeName (the \x30\x00 parse in cryptography-x509-verification/src/lib.rs). setting MINIMUM_LEN to 1 on the alias would make that parse fail. keeping the check in parse_general_names also means the other GeneralNames users that go through it, authorityCertIssuer and the CRL distribution point names, pick up the same 1..MAX constraint, since 5280 defines them all the same way. happy to move it to a type-level constraint if you'd rather give verification its own zero-minimum type.
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.
Oh, I think we should probably fix the \x30\x00 callsites to just store an Option<SequenceOf<>>
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.
done. set MINIMUM_LEN to 1 on both aliases and made the verification NameChain store an Option instead of parsing the empty
\x30\x00sequence, so the empty rejection now comes from the type. parse_general_names is generic over the minimum length now so the len-0 GeneralNames callers still go through unchanged. rust builds clean.