Skip to content

Commit

Permalink
Duplicate lints about keyIdentifier in certificates (#726)
Browse files Browse the repository at this point in the history
* Duplicate lints about keyIdentifier in certificates

* fixed go imports styling

* breaking up code comments to match conditional blocks

* typo

* simplifying check

* Triggering GHA with empty commit

* adding one more error cert to the corpus

---------

Co-authored-by: Zakir Durumeric <zakird@gmail.com>
  • Loading branch information
christopher-henderson and zakird committed Jul 9, 2023
1 parent 3f1605e commit 40f2b32
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 109 deletions.
2 changes: 1 addition & 1 deletion v3/integration/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@
"ErrCount": 37
},
"e_ext_authority_key_identifier_no_key_identifier": {
"ErrCount": 65
"ErrCount": 66
},
"e_ext_cert_policy_disallowed_any_policy_qualifier": {},
"e_ext_cert_policy_duplicate": {},
Expand Down
65 changes: 0 additions & 65 deletions v3/lints/rfc/lint_ext_authority_key_identifier_missing.go

This file was deleted.

40 changes: 0 additions & 40 deletions v3/lints/rfc/lint_ext_authority_key_identifier_missing_test.go

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ 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
return &lint.LintResult{Status: lint.Error}
} else {
if c.AuthorityKeyId != nil || util.IsCACert(c) && util.IsSelfSigned(c) {
return &lint.LintResult{Status: lint.Pass}
} else {
return &lint.LintResult{Status: lint.Error}
}
}

0 comments on commit 40f2b32

Please sign in to comment.