Cross language compatibility: case insensitivity flag#552
Cross language compatibility: case insensitivity flag#552mkienow-r7 merged 2 commits intorapid7:mainfrom
Conversation
| <example>Dovecot (Debian) ready.</example> | ||
| <example>[CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ AUTH=PLAIN AUTH=LOGIN] Dovecot (Debian) ready.</example> | ||
| <param pos="0" name="service.vendor" value="Dovecot"/> | ||
| <param pos="0" name="service.vendor" value="Dovecot"/> |
There was a problem hiding this comment.
Not flag related, but duplicate param use detected by tests in recog-go.
The hope behind the Go Verify workflow was to detect issues between the various recog language implementation. What sort of internal testing discovered this issue that was not discoverable when verifying the fingerprints against their examples via cmd/recog_verify/main.go? |
| --> | ||
|
|
||
| <fingerprint pattern="^[Mm]fg=(?:Fuji)?(?i:Xerox);[Tt]yp=(?:MFP|AIO|[Pp]rinter);[Mm]od=(?:Xerox )?(\S+) ([a-zA-Z0-9]+).*;[Ss]er=([A-Z0-9]{9,10})(?:;[Ll]oc=.*)?$"> | ||
| <fingerprint pattern="(?i)^[Mm]fg=(?:Fuji)?Xerox;[Tt]yp=(?:MFP|AIO|[Pp]rinter);[Mm]od=(?:Xerox )?(\S+) ([a-zA-Z0-9]+).*;[Ss]er=([A-Z0-9]{9,10})(?:;[Ll]oc=.*)?$"> |
There was a problem hiding this comment.
With case insensitivity applied to the whole pattern the explicit case matching is no longer necessary.
[Mm][Tt][Pp][Ss][Ll]
There was a problem hiding this comment.
Good catch, fixed.
Testing in the Go version of The test for this condition is in EDIT: I'll see about adding checks to the Ruby and Go versions |
mkienow-r7
left a comment
There was a problem hiding this comment.
Thank you for the contribution @TomSellers!
Description
This PR moves the inline flag
(?i)(case insensitivity) to the beginning of the regex. In Python this flags has global meaning and use of it anywhere other than the start of the pattern is deprecated. This does not change the function of this flag in current patterns for other languages.See previous work in #367
This was caught by internal testing in
recog-goand the fixes are required in order for us to implement and test the changes from the following PRs intorecog-go:How Has This Been Tested?
bundle exec rake testsruby bin/recog_verify xml/*.xml | grep -v WARN | grep -v SUMMARYTypes of changes>
Checklist: