-
Notifications
You must be signed in to change notification settings - Fork 111
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
Duplicate lints about keyIdentifier in certificates #726
Conversation
@@ -57,7 +59,23 @@ func (l *authorityKeyIdNoKeyIdField) CheckApplies(c *x509.Certificate) bool { | |||
} | |||
|
|||
func (l *authorityKeyIdNoKeyIdField) Execute(c *x509.Certificate) *lint.LintResult { | |||
if c.AuthorityKeyId == nil && !util.IsSelfSigned(c) { //will be nil by default if not found in x509.parseCert | |||
if util.IsCACert(c) && util.IsSelfSigned(c) { |
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.
Maybe we can remove util.IsCACert(c)? Only if it is self-signed it may be omitted.
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'm not quite convinced of that based on the language.
There is one exception; where a CA distributes its public key in the form of a "self-signed" certificate, the authority key identifier MAY be omitted.
It seems to me that this clause is stating that this does apply, specifically to CA certs and not just to any self signed.
Although what exists in practice may of course differ.
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.
That is fine.
@mtgag to bring this review to your attention.
Removes a duplicate lint regarding RFC 5280: 4.2.1.1.
Additionally, I believe that the lint itself was slightly inaccurate vis-a-vis RFC 5280.
I've attempted to encode this language a bit more precisely in this lint update.
Integration Test Failures
I'm working through smoke checking these fingerprints, but so far it looks reasonable.
For example, fe716ff3996cd6561b6b63a8c440fdf5489cf48f7834283eebd19b380f3fbc22 features a certificate that is indeed a CA, but is not self signed and does not have the authority key id (well, it has the common name and serial, but not the actual identifier).
Addresses #725