diff --git a/v3/lints/cabf_br/lint_cab_dv_subject_invalid_values.go b/v3/lints/cabf_br/lint_cab_dv_subject_invalid_values.go index ee768fe97..3563da7f0 100644 --- a/v3/lints/cabf_br/lint_cab_dv_subject_invalid_values.go +++ b/v3/lints/cabf_br/lint_cab_dv_subject_invalid_values.go @@ -66,21 +66,12 @@ func (l *dvSubjectInvalidValues) CheckApplies(cert *x509.Certificate) bool { func (l *dvSubjectInvalidValues) Execute(cert *x509.Certificate) *lint.LintResult { names := util.GetTypesInName(&cert.Subject) - var cnFound = false for _, n := range names { - if n.Equal(util.CommonNameOID) { - cnFound = true - continue - } - if n.Equal(util.CountryNameOID) { + if n.Equal(util.CommonNameOID) || n.Equal(util.CountryNameOID) { continue } return &lint.LintResult{Status: lint.Error, Details: fmt.Sprintf("DV certificate contains the invalid attribute type %s", n)} } - if cnFound { - return &lint.LintResult{Status: lint.Warn, Details: "DV certificate contains a subject common name, this is not recommended."} - } - return &lint.LintResult{Status: lint.Pass} } diff --git a/v3/lints/cabf_br/lint_cab_dv_subject_invalid_values_test.go b/v3/lints/cabf_br/lint_cab_dv_subject_invalid_values_test.go index 61b44837a..e31a7016f 100644 --- a/v3/lints/cabf_br/lint_cab_dv_subject_invalid_values_test.go +++ b/v3/lints/cabf_br/lint_cab_dv_subject_invalid_values_test.go @@ -46,9 +46,9 @@ func TestNewDvSubjectInvalidValues(t *testing.T) { ExpectedDetails: "DV certificate contains the invalid attribute type 2.5.4.5", }, { - Name: "warn - DV with valid values in subjectDN, with CN, on SC62", + Name: "pass - DV with valid values in subjectDN, with CN, on SC62", InputFilename: "dvWithCNAndCountry.pem", - ExpectedResult: lint.Warn, + ExpectedResult: lint.Pass, ExpectedDetails: "DV certificate contains a subject common name, this is not recommended", }, {