zmap / zlint

X.509 Certificate Linter focused on Web PKI standards and requirements.
https://zmap.io
Apache License 2.0
361 stars 110 forks source link

Is the omission of RFC8813 intentional? #877

Closed yukoori closed 1 month ago

yukoori commented 2 months ago

Looking at UnmarshalJSON and FromString in file lint/source.go, there is no processing for RFC8813.

So when verifying using zlint, if we add RFC8813 to the options, the following error occurs.

5, unable to configure included/exclude lints: unknown lint source in list: "RFC8813".

We solved the problem by modifying the code as follows. Could you please apply it to the distribution version?

func (s *LintSource) UnmarshalJSON(data []byte) error {
        ... 
    switch LintSource(throwAway) {
    case RFC8813, RFC5280, RFC5480, RFC5891, RFC8813, CABFBaselineRequirements, CABFEVGuidelines, CABFSMIMEBaselineRequirements, MozillaRootStorePolicy, AppleRootStorePolicy, Community, EtsiEsi:
        *s = LintSource(throwAway)
        return nil
        ...
    }
}
func (s *LintSource) FromString(src string) {
        ...
    switch LintSource(src) {
    case RFC5280:
        *s = RFC5280
    case RFC5480:
        *s = RFC5480
    case RFC5891:
        *s = RFC5891
    case RFC8813:
        *s = RFC8813
    ...
    }
}

It's a handling issue with the options, but the function is working fine.

Thank you.

christopher-henderson commented 1 month ago

Fixed in #879