crocs-muni / sec-certs

Tool for analysis of security certificates and their security targets (Common Criteria, NIST FIPS140-2...).
https://sec-certs.org
MIT License
12 stars 8 forks source link

Cleanup cert-id rules #386

Closed J08nY closed 7 months ago

J08nY commented 8 months ago

The cert-id rules work, but are a mess. This PR will clean them up for presentation in the paper.

Before this, the regular cert_id regexes were used to extract the cert_id from the report filename. However, the filenames often do not use the same cert_id format, but contain all of the information necessary to reconstruct the cert_id, but with different order for example.

This commit along with those before it introduce a new set of regular expressions that better match the ones in the filenames. To extract the correctly formatted canonical cert_id, the regexes are used to obtain the parts of the cert_id (using named groups in regexes) and those are then reconstructed into a canonical version of the cert_id via one of the scheme-dependent functions.

codecov[bot] commented 8 months ago

Codecov Report

Attention: 40 lines in your changes are missing coverage. Please review.

Comparison is base (be702d4) 69.36% compared to head (40d89ff) 68.54%. Report is 13 commits behind head on main.

:exclamation: Current head 40d89ff differs from pull request most recent head ec0162c. Consider uploading reports for the commit ec0162c to get more accurate results

Files Patch % Lines
src/sec_certs/sample/cc_certificate_id.py 85.99% 22 Missing :warning:
src/sec_certs/sample/cc.py 8.34% 11 Missing :warning:
src/sec_certs/sample/cc_scheme.py 73.92% 6 Missing :warning:
src/sec_certs/configuration.py 83.34% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #386 +/- ## ========================================== - Coverage 69.36% 68.54% -0.82% ========================================== Files 62 62 Lines 7457 7535 +78 ========================================== - Hits 5172 5164 -8 - Misses 2285 2371 +86 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

J08nY commented 7 months ago

Now that this is merged and I did a full run I will use this PR for some insights/issues.