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

identify root certificate identification by equal subject and issuer #30

Merged
merged 1 commit into from
May 20, 2023

Conversation

jonhadfield
Copy link
Contributor

Hi,

The existing code asserts a certificate is a root by lack of authority key id although the rfc states:

...where a CA distributes its public key in the form of a "self-signed" certificate, the authority key identifier MAY be omitted.

This PR adds to the root check by first checking if the Subject and Issuer match, which should only be true if it is a root.

I first noticed this issue when running certinfo against a DigiCert root and it was identified as an intermediate. I've added the same root as test data and included a test that requires its now identified as a root.

@pete911
Copy link
Owner

pete911 commented May 20, 2023

Hi @jonhadfield, you are right, I realised this sometime ago when going through RFC, but completely forgot to fix it. Thanks again for the fix. I will do new release shortly as well.

@pete911 pete911 merged commit b85f701 into pete911:main May 20, 2023
@jonhadfield jonhadfield deleted the fix_root_check branch May 20, 2023 09:43
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.

2 participants