-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
crypto/x509: verify checks root certificate #28971
Comments
/cc @FiloSottile |
@vit3k I'm curious what version of openssl you're using that the chain you described succeeds. I'm dealing with similar issues with a similar chain where openssl 1.1.0f verified as ok, but 1.1.0j fails the path length constraint. I suspect openssl/openssl#7353 is the cause there. It's unclear to me from the spec what the correct behavior even is. |
|
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Example saves root, intermediate and leaf certificate to files so it can be verified with openssl.
What did you expect to see?
Verification should be successful.
What did you see instead?
Verification fails because MaxPathLen is set to 0 on root certificate. According to x509 specification root certs should not be part of chain and should not be validated at all.
RFC5280 6.1
As far as I understand it means that trust anchor (which in example is a root CA self-signed certificate) is not in this list of certificates to be validated because the first one should be the one that trust anchor issued.
Trust anchor is defined in section 6.1.1 as:
In fact it doesn't need to be a certificate at all.
Also in verification algorithm there is:
The root in example is self signed but anyway - in my opinion it should not be even a part of verification chain. It should be only a trust anchor.
Openssl verification is successful on such chain
The text was updated successfully, but these errors were encountered: