diff options
| author | Petr Svenda | 2021-01-28 12:19:50 +0100 |
|---|---|---|
| committer | Petr Svenda | 2021-01-28 12:22:23 +0100 |
| commit | cff51a51122b8ca7d89f1a4fbe1cfc41e331d35f (patch) | |
| tree | 036e59819f130d5f736936653978e1a408143fec | |
| parent | b6bc572cb19d3288f729fa33d3ecbc800a817ee3 (diff) | |
| download | sec-certs-cff51a51122b8ca7d89f1a4fbe1cfc41e331d35f.tar.gz sec-certs-cff51a51122b8ca7d89f1a4fbe1cfc41e331d35f.tar.zst sec-certs-cff51a51122b8ca7d89f1a4fbe1cfc41e331d35f.zip | |
add cmdline option to specify targeted certificates
| -rwxr-xr-x | process_certificates.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/process_certificates.py b/process_certificates.py index f134e9d5..d48f4d78 100755 --- a/process_certificates.py +++ b/process_certificates.py @@ -18,11 +18,11 @@ from sec_certs.download import download_cc_web, download_cc @click.option("--do-pairing", "do_pairing", is_flag=True, help="Whether to pair PP stuff.") @click.option("--do-processing", "do_processing", is_flag=True, help="Whether to process certificates.") @click.option("--do-analysis", "do_analysis", is_flag=True, help="Whether to analyse certificates.") -@click.option("--do-find-affected", "do_find_affected", is_flag=True, help="Whether to find affected certificates.") +@click.option("--do-find-affected", "do_find_affected", help="Find affected certs.", multiple=True, type=str, metavar="certifocate id") @click.option("-t", "--threads", "threads", type=int, default=4, help="Amount of threads to use.") def main(directory, do_complete_extraction: bool, do_download_meta: bool, do_extraction_meta: bool, do_download_certs: bool, do_pdftotext: bool, do_extraction_certs: bool, - do_pairing: bool, do_processing: bool, do_analysis: bool, do_find_affected: bool, threads: int): + do_pairing: bool, do_processing: bool, do_analysis: bool, do_find_affected: list, threads: int): directory = Path(directory) web_dir = directory / "web" @@ -215,12 +215,12 @@ def main(directory, do_complete_extraction: bool, do_download_meta: bool, do_ext with open(results_dir / "certificate_data_complete_processed_analyzed.json", "w") as write_file: json.dump(all_cert_items, write_file, indent=4, sort_keys=True) - if do_find_affected: + # example: --do-find-affected BSI-DSZ-CC-0782-2012 --do-find-affected BSI-DSZ-CC-0640-2010 + if len(do_find_affected) > 0: with open(results_dir / 'certificate_data_complete_processed_analyzed.json') as json_file: all_cert_items = json.load(json_file) - TARGET_VULN_CERT_ID = ['BSI-DSZ-CC-0782-2012', 'BSI-DSZ-CC-0640-2010'] # bugbug: take from cmd line option - do_analysis_affected(all_cert_items, results_dir, TARGET_VULN_CERT_ID) + do_analysis_affected(all_cert_items, results_dir, do_find_affected) if __name__ == "__main__": |
