Skip to content
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

use key instead of subject to check root cert #31

Merged
merged 2 commits into from
May 22, 2023
Merged

use key instead of subject to check root cert #31

merged 2 commits into from
May 22, 2023

Conversation

pete911
Copy link
Owner

@pete911 pete911 commented May 20, 2023

@jonhadfield, I have merged and release you PR to unblock you, but want to know your opinion on comparing keys instead of subjects. My understanding of RFC is that the key is either omitted, or has to be the same (self signed).
I feel like it is maybe safer to compare keys instead of subjects. Let me know what you think - this PR addresses that.

@jonhadfield
Copy link
Contributor

Your message resulted in a lot of interesting reading. I got a bit thrown by RFC SHOULDs and MAYBEs and started looking for exceptions to each of the possible rules.
My takeaway (and I'm far from an expert) is that matching DNs should be sufficient and more compatible (less of the spec to adhere to?), but key comparison is technically superior if the spec is always followed.

@pete911
Copy link
Owner Author

pete911 commented May 22, 2023

Hi, so it is quite easy to create intermediate with the same issuer and subject (I added test certificate to test this specific scenario to pkg/cert/testdata/intermediate_same_issuer_and_subject.pem).
I will merge this PR to cover cases likes this, even though they are unlikely.

@pete911 pete911 merged commit 42d0d71 into main May 22, 2023
3 checks passed
@pete911 pete911 deleted the root-check branch May 22, 2023 20:21
@jonhadfield
Copy link
Contributor

Hi @pete911, I was having another read and, FWIW, also concluded that comparison of AKI (or lack thereof) and SKI is definitely the correct way to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants