Skip to content

Commit

Permalink
Max length check applies (#724)
Browse files Browse the repository at this point in the history
* lint about the encoding of qcstatements for PSD2

* Revert "lint about the encoding of qcstatements for PSD2"

This reverts commit 6c23670.

* util: gtld_map autopull updates for 2021-10-21T07:25:20 UTC

* always check and perform the operation in the execution

* max length check only if component is present.

---------

Co-authored-by: mtg <[email protected]>
Co-authored-by: GitHub <[email protected]>
Co-authored-by: Christopher Henderson <[email protected]>
  • Loading branch information
4 people authored Jun 11, 2023
1 parent 45e8dff commit 59a91a2
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion v3/lints/rfc/lint_subject_common_name_max_length.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func NewSubjectCommonNameMaxLength() lint.LintInterface {
}

func (l *subjectCommonNameMaxLength) CheckApplies(c *x509.Certificate) bool {
return true
return len(c.Subject.CommonName) > 0
}

func (l *subjectCommonNameMaxLength) Execute(c *x509.Certificate) *lint.LintResult {
Expand Down
2 changes: 1 addition & 1 deletion v3/lints/rfc/lint_subject_email_max_length.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func NewSubjectEmailMaxLength() lint.LintInterface {
}

func (l *subjectEmailMaxLength) CheckApplies(c *x509.Certificate) bool {
return true
return len(c.Subject.EmailAddress) > 0
}

func (l *subjectEmailMaxLength) Execute(c *x509.Certificate) *lint.LintResult {
Expand Down
2 changes: 1 addition & 1 deletion v3/lints/rfc/lint_subject_given_name_max_length.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func NewSubjectGivenNameMaxLength() lint.LintInterface {
}

func (l *subjectGivenNameMaxLength) CheckApplies(c *x509.Certificate) bool {
return true
return len(c.Subject.GivenName) > 0
}

func (l *subjectGivenNameMaxLength) Execute(c *x509.Certificate) *lint.LintResult {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func NewSubjectGivenNameRecommendedMaxLength() lint.LintInterface {
type SubjectGivenNameRecommendedMaxLength struct{}

func (l *SubjectGivenNameRecommendedMaxLength) CheckApplies(c *x509.Certificate) bool {
return true
return len(c.Subject.GivenName) > 0
}

func (l *SubjectGivenNameRecommendedMaxLength) Execute(c *x509.Certificate) *lint.LintResult {
Expand Down
2 changes: 1 addition & 1 deletion v3/lints/rfc/lint_subject_locality_name_max_length.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func NewSubjectLocalityNameMaxLength() lint.LintInterface {
}

func (l *subjectLocalityNameMaxLength) CheckApplies(c *x509.Certificate) bool {
return true
return len(c.Subject.Locality) > 0
}

func (l *subjectLocalityNameMaxLength) Execute(c *x509.Certificate) *lint.LintResult {
Expand Down
2 changes: 1 addition & 1 deletion v3/lints/rfc/lint_subject_organization_name_max_length.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func NewSubjectOrganizationNameMaxLength() lint.LintInterface {
}

func (l *subjectOrganizationNameMaxLength) CheckApplies(c *x509.Certificate) bool {
return true
return len(c.Subject.Organization) > 0
}

func (l *subjectOrganizationNameMaxLength) Execute(c *x509.Certificate) *lint.LintResult {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func NewSubjectOrganizationalUnitNameMaxLength() lint.LintInterface {
}

func (l *subjectOrganizationalUnitNameMaxLength) CheckApplies(c *x509.Certificate) bool {
return true
return len(c.Subject.OrganizationalUnit) > 0
}

func (l *subjectOrganizationalUnitNameMaxLength) Execute(c *x509.Certificate) *lint.LintResult {
Expand Down
2 changes: 1 addition & 1 deletion v3/lints/rfc/lint_subject_postal_code_max_length.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func NewSubjectPostalCodeMaxLength() lint.LintInterface {
}

func (l *subjectPostalCodeMaxLength) CheckApplies(c *x509.Certificate) bool {
return true
return len(c.Subject.PostalCode) > 0
}

func (l *subjectPostalCodeMaxLength) Execute(c *x509.Certificate) *lint.LintResult {
Expand Down
2 changes: 1 addition & 1 deletion v3/lints/rfc/lint_subject_state_name_max_length.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func NewSubjectStateNameMaxLength() lint.LintInterface {
}

func (l *subjectStateNameMaxLength) CheckApplies(c *x509.Certificate) bool {
return true
return len(c.Subject.Province) > 0
}

func (l *subjectStateNameMaxLength) Execute(c *x509.Certificate) *lint.LintResult {
Expand Down
2 changes: 1 addition & 1 deletion v3/lints/rfc/lint_subject_street_address_max_length.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func NewSubjectStreetAddressMaxLength() lint.LintInterface {
}

func (l *subjectStreetAddressMaxLength) CheckApplies(c *x509.Certificate) bool {
return true
return len(c.Subject.StreetAddress) > 0
}

func (l *subjectStreetAddressMaxLength) Execute(c *x509.Certificate) *lint.LintResult {
Expand Down
2 changes: 1 addition & 1 deletion v3/lints/rfc/lint_subject_surname_max_length.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func NewSubjectSurnameMaxLength() lint.LintInterface {
}

func (l *subjectSurnameMaxLength) CheckApplies(c *x509.Certificate) bool {
return true
return len(c.Subject.Surname) > 0
}

func (l *subjectSurnameMaxLength) Execute(c *x509.Certificate) *lint.LintResult {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func NewSubjectSurnameRecommendedMaxLength() lint.LintInterface {
type SubjectSurnameRecommendedMaxLength struct{}

func (l *SubjectSurnameRecommendedMaxLength) CheckApplies(c *x509.Certificate) bool {
return true
return len(c.Subject.Surname) > 0
}

func (l *SubjectSurnameRecommendedMaxLength) Execute(c *x509.Certificate) *lint.LintResult {
Expand Down

0 comments on commit 59a91a2

Please sign in to comment.