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

The range of IA5String #853

Open zzzsz opened 5 months ago

zzzsz commented 5 months ago

I noticed that Zlint judges the range of IA5String as follows, I'd like to know where I can find the definition of the IA5String range. All I saw in RFC5280 is: “IA5String is limited to the set of ASCII characters.” But this only proves that IA5String is less than or equal to ASCII, but does not mean it is equal to ASCII. In the following range determination, the range determination basis of ASCII is used.

// IsIA5String returns true if raw is an IA5String, and returns false otherwise. func IsIA5String(raw []byte) bool { for _, b := range raw { i := int(b) if i > 127 || i < 0 { return false } } return true }

CBonnell commented 5 months ago

See clauses 35 (b) (c), and clause 38 of X.680 2002-07 for the character repertoire of IA5String.

cardonator commented 5 months ago

It does seem like a comment pointing to the spec would be helpful there.

zzzsz commented 5 months ago

有关 的字符集,请参阅X.680 2002-07的第 35(b)(c)条和第 38 条IA5String

Thank you for clearing up my confusion.