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

Max length check applies #724

Merged
merged 13 commits into from
Jun 11, 2023
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
Loading