zlint icon indicating copy to clipboard operation
zlint copied to clipboard

Cleanup util QCStatement code, use ZCrypto parsing/types

Open cpu opened this issue 5 years ago • 2 comments

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.

cpu avatar May 14 '20 15:05 cpu

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.

mtgag avatar May 14 '20 16:05 mtgag

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 deleted
  • lint_qcstatem_etsi_type_as_statem - trivial
  • lint_qcstatem_etsi_present_qcs_critical - trivial
  • lint_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 coverted
  • lint_qcstatem_qcpds_lang_case - trivial
  • lint_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)

sleevi avatar Jun 05 '20 03:06 sleevi