Cleanup util QCStatement code, use ZCrypto parsing/types
I think a lot of the code in util/qc_stmt.go in ZLint is now duplicated by code that landed upstream in ZCrypto w/ https://github.com/zmap/zcrypto/commit/13cf40b46ed3697eba66054aca90c73bbbc991d4
I think it makes sense for someone familiar with the ETSI ESI requirements to remove the ZLint code that isn't required anymore in favour of using the ZCrypto version. If there are types/behaviour in the ZLint parsing that isn't present in the ZCrypto version it would make sense to upstream it to that repo and then remove it from ZLint.
I think this is on our scope... I will try to incorporate this in the ETSI related lints also in the main project. These pull requests are not forgotten but unfortunately postponed. Hope to get back to it soon.
I started work on this, but I think there's still some work to be done before we can fully get there.
A few running notes from what I've found so far:
lint_qcstatem_qccompliance_valid- can be deletedlint_qcstatem_etsi_type_as_statem- triviallint_qcstatem_etsi_present_qcs_critical- triviallint_qcstatem_mandatory_etsi_statems- Actually a buggy lint, but trivial :)lint_qcstatem_qclimitvalue_valid- because of how ZCrypto has to deal with CHOICE types, we don't have enough information in the MonetaryValue to know which CHOICE was done, and so can't be covertedlint_qcstatem_qcpds_lang_case- triviallint_qcstatem_qcpds_valid- ZCrypto is too liberal in how it parses, both in terms of string type and trailing data, so this causes some bad certs to now pass where the hand-rolled parser rejects
I haven't finished everything, but I'm working on getting something together, and will also file issues once that's done for some of the ETSI lints that are not-quite-right (but can be "easily" fixed)