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

Avoid warning dv cn #843

Merged
merged 33 commits into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6c23670
lint about the encoding of qcstatements for PSD2
Feb 4, 2020
4666bb7
Revert "lint about the encoding of qcstatements for PSD2"
Feb 4, 2020
01996c6
Merge https://github.com/zmap/zlint
Aug 26, 2020
28481cc
Merge https://github.com/zmap/zlint
Sep 1, 2021
749d896
Merge https://github.com/zmap/zlint
Oct 21, 2021
e56e2a0
util: gtld_map autopull updates for 2021-10-21T07:25:20 UTC
web-flow Oct 21, 2021
8600050
Merge pull request #1 from mtgag/zlint-gtld-update
mtgag Oct 21, 2021
30b096e
Merge https://github.com/zmap/zlint
mtgag Apr 19, 2023
92e659c
always check and perform the operation in the execution
mtgag Apr 27, 2023
351a379
Merge branch 'master' into master
christopher-henderson May 14, 2023
b52111b
Merge https://github.com/zmap/zlint
mtgag May 16, 2023
526f9be
Merge https://github.com/zmap/zlint
mtgag Jun 9, 2023
92902fc
Merge https://github.com/zmap/zlint
mtgag Jul 1, 2023
1652cfa
synchronised with project
mtgag Jul 5, 2023
d4f2f9f
synchronised with project
mtgag Aug 30, 2023
88c933e
Merge https://github.com/zmap/zlint
mtgag Aug 30, 2023
cee805f
Merge https://github.com/zmap/zlint
mtgag Dec 3, 2023
2408543
synchronised with project
mtgag Dec 14, 2023
67537e9
synchronised with project
mtgag Dec 14, 2023
e77fae1
synchronised with project
mtgag Jan 24, 2024
51d498f
synchronised with project
mtgag Feb 13, 2024
31e1845
Merge https://github.com/zmap/zlint
mtgag Feb 25, 2024
d10444e
Merge https://github.com/zmap/zlint
mtgag Mar 4, 2024
53b911e
fixed merge error
mtgag Mar 5, 2024
f1a66db
Merge https://github.com/zmap/zlint
mtgag Mar 10, 2024
795d206
Merge https://github.com/zmap/zlint
mtgag Apr 5, 2024
bad73ee
synchronised with project
mtgag Apr 5, 2024
2cd7d08
synchronised with project
mtgag Apr 9, 2024
63cf8e8
Revert "synchronised with project"
mtgag Apr 9, 2024
b3a86b3
Revert "synchronised with project"
mtgag Apr 9, 2024
4d46729
Merge https://github.com/zmap/zlint
mtgag Apr 9, 2024
f9adb1b
avoiding warning when CN is present.
mtgag May 23, 2024
1988149
Merge branch 'master' into avoid-warning-dv-cn
christopher-henderson May 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions v3/lints/cabf_br/lint_cab_dv_subject_invalid_values.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
4 changes: 2 additions & 2 deletions v3/lints/cabf_br/lint_cab_dv_subject_invalid_values_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
{
Expand Down
Loading