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

Ecdsa ee invalid ku check applies #731

Merged
Merged
2 changes: 1 addition & 1 deletion v3/lints/rfc/lint_ecdsa_ee_invalid_ku.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func NewEcdsaInvalidKU() lint.LintInterface {
// CheckApplies returns true when the certificate is a subscriber cert using an
// ECDSA public key algorithm.
func (l *ecdsaInvalidKU) CheckApplies(c *x509.Certificate) bool {
return util.IsSubscriberCert(c) && c.PublicKeyAlgorithm == x509.ECDSA
return util.IsSubscriberCert(c) && c.PublicKeyAlgorithm == x509.ECDSA && util.HasKeyUsageOID(c)
}

// Execute returns a Notice level lint.LintResult if the ECDSA end entity certificate
Expand Down
5 changes: 5 additions & 0 deletions v3/lints/rfc/lint_ecdsa_ee_invalid_ku_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ func TestECDSAInvalidKU(t *testing.T) {
expectedStatus: lint.Notice,
expectedDetails: "Certificate had unexpected key usage(s): KeyUsageCRLSign, KeyUsageCertSign",
},
{
name: "ecdsa ee cert, without key usage",
filename: "CNWithoutSANSeptember2021.pem",
expectedStatus: lint.NA,
},
}

for _, tc := range testCases {
Expand Down