Add lint to check for suspicious characters in localityName and/or stateOrProvinceName - #1084
Open
defacto64 wants to merge 6 commits into
Open
Add lint to check for suspicious characters in localityName and/or stateOrProvinceName#1084defacto64 wants to merge 6 commits into
defacto64 wants to merge 6 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After a recent incident seen on Bugzilla, I thought this lint would be good to have. This lint checks whether the Subject's localityName and stateOrProvinceName attributes contain suspicious characters such as comma, colon, parentheses, etc. The presence of such characters almost certainly indicates an incorrect value for the containing attribute. A very common case is when localityName contains two or even three address elements, separated by commas, which is obviously incorrect. For example, there are quite a few certificates in the test corpus where localityName contains not only the locality but also the street address or the state/province. But there are also stranger cases.
Since I am not sure that the presence of such characters is always an error, this lint only returns a warning upon a hit. But if people here believe it's better, it's fine with me to change it to an error. I refined the set of suspect characters (as currently used in this lint) heuristically, so I may have missed some other characters that would be worth including; I'm of course open to changes.