diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/data/test_fips_oop/algorithms.json | 513 | ||||
| -rw-r--r-- | test/fips_test_utils.py | 51 | ||||
| -rw-r--r-- | test/settings_test.yaml | 19 | ||||
| -rw-r--r-- | test/test_fips_oop.py | 134 |
4 files changed, 717 insertions, 0 deletions
diff --git a/test/data/test_fips_oop/algorithms.json b/test/data/test_fips_oop/algorithms.json new file mode 100644 index 00000000..7845d93d --- /dev/null +++ b/test/data/test_fips_oop/algorithms.json @@ -0,0 +1,513 @@ +{ + "_type": "FIPSAlgorithmDataset", + "certs": { + "2351": [ + { + "_type": "Algorithm", + "cert_id": "2351", + "date": "9/21/2018", + "implementation": "Apple CoreCrypto Kernel Module v9.0 for ARM (iOS12, A11 Bionic, Assembler_VNG)", + "type": "DRBG", + "vendor": "Apple Inc." + }, + { + "_type": "Algorithm", + "cert_id": "2351", + "date": "11/27/2015", + "implementation": "Apple iOS CoreCrypto Kernel Module (Optimized SHA, A6)", + "type": "HMAC", + "vendor": "Apple Inc." + }, + { + "_type": "Algorithm", + "cert_id": "2351", + "date": "1/27/2017", + "implementation": "OpenSSL using assembler for AES and SHA", + "type": "RSA", + "vendor": "Canonical Ltd." + }, + { + "_type": "Algorithm", + "cert_id": "2351", + "date": "1/19/2017", + "implementation": "Junos FIPS Version Junos 15.1 X49 - Dataplane_CN7020", + "type": "TDES", + "vendor": "Juniper Networks, Inc." + }, + { + "_type": "Algorithm", + "cert_id": "2351", + "date": "3/8/2013", + "implementation": "Samsung OpenSSL Cryptographic Module", + "type": "AES", + "vendor": "Samsung Electronics Co., Ltd" + }, + { + "_type": "Algorithm", + "cert_id": "2351", + "date": "3/7/2014", + "implementation": "Symantec PGP Cryptographic Engine", + "type": "SHS", + "vendor": "Symantec Corporation" + } + ], + "2352": [ + { + "_type": "Algorithm", + "cert_id": "2352", + "date": "9/21/2018", + "implementation": "Apple CoreCrypto Kernel Module v9.0 for ARM (iOS12, A10X Fusion, Assembler_VNG)", + "type": "DRBG", + "vendor": "Apple Inc." + }, + { + "_type": "Algorithm", + "cert_id": "2352", + "date": "3/8/2013", + "implementation": "AES-256 Core", + "type": "AES", + "vendor": "Altera Canada" + }, + { + "_type": "Algorithm", + "cert_id": "2352", + "date": "11/27/2015", + "implementation": "Apple iOS CoreCrypto Kernel Module (Optimized SHA, A6X)", + "type": "HMAC", + "vendor": "Apple Inc." + }, + { + "_type": "Algorithm", + "cert_id": "2352", + "date": "1/27/2017", + "implementation": "OpenSSL using support from Power ISA 2.07 for AES and SHA", + "type": "RSA", + "vendor": "Canonical Ltd." + }, + { + "_type": "Algorithm", + "cert_id": "2352", + "date": "1/19/2017", + "implementation": "Junos FIPS Version Junos 15.1 X49 - Dataplane_CN7130", + "type": "TDES", + "vendor": "Juniper Networks, Inc." + }, + { + "_type": "Algorithm", + "cert_id": "2352", + "date": "3/21/2014", + "implementation": "Karnak SHA in Hardware", + "type": "SHS", + "vendor": "Seagate Technology, LLC." + } + ], + "2600": [ + { + "_type": "Algorithm", + "cert_id": "2600", + "date": "12/15/2017", + "implementation": "Apple iOS CoreCrypto v8 Kernel Module (Generic Software Implementation)", + "type": "TDES", + "vendor": "Apple Inc." + }, + { + "_type": "Algorithm", + "cert_id": "2600", + "date": "6/10/2016", + "implementation": "IOS Common Cryptographic Module (IC2M) Algorithm Module", + "type": "HMAC", + "vendor": "Cisco Systems, Inc." + }, + { + "_type": "Algorithm", + "cert_id": "2600", + "date": "8/16/2013", + "implementation": "Blade System Virtual Connect", + "type": "AES", + "vendor": "Hewlett-Packard Development Company, L.P." + }, + { + "_type": "Algorithm", + "cert_id": "2600", + "date": "12/5/2014", + "implementation": "Cryptographic Security Kernel", + "type": "SHS", + "vendor": "IBM Corporation" + }, + { + "_type": "Algorithm", + "cert_id": "2600", + "date": "9/1/2017", + "implementation": "IBM z/OS(R) Cryptographic Services System SSL - 31bit", + "type": "RSA", + "vendor": "IBM Corporation" + } + ], + "2601": [ + { + "_type": "Algorithm", + "cert_id": "2601", + "date": "12/5/2014", + "implementation": "SHA256 Library on Canon MFP Security Chip", + "type": "SHS", + "vendor": "Canon Inc." + }, + { + "_type": "Algorithm", + "cert_id": "2601", + "date": "8/16/2013", + "implementation": "Dell AppAssure Crypto Library", + "type": "AES", + "vendor": "Dell, Inc." + }, + { + "_type": "Algorithm", + "cert_id": "2601", + "date": "6/10/2016", + "implementation": "EFJ Communication Cryptographic Library", + "type": "HMAC", + "vendor": "EFJohnson Technologies" + }, + { + "_type": "Algorithm", + "cert_id": "2601", + "date": "9/1/2017", + "implementation": "IBM z/OS(R) Cryptographic Services System SSL - 64bit", + "type": "RSA", + "vendor": "IBM Corporation" + }, + { + "_type": "Algorithm", + "cert_id": "2601", + "date": "12/22/2017", + "implementation": "Oracle Linux 7 GnuTLS C Implementation", + "type": "TDES", + "vendor": "Oracle Corporation" + } + ], + "2602": [ + { + "_type": "Algorithm", + "cert_id": "2602", + "date": "12/22/2017", + "implementation": "Apple tvOS CoreCrypto Kernel Module v8.0 (Generic Software Implementation)", + "type": "TDES", + "vendor": "Apple Inc." + }, + { + "_type": "Algorithm", + "cert_id": "2602", + "date": "6/10/2016", + "implementation": "FIPS-ALGORITHMS.1.5.0v", + "type": "HMAC", + "vendor": "Mercury Systems" + }, + { + "_type": "Algorithm", + "cert_id": "2602", + "date": "8/16/2013", + "implementation": "RSA BSAFE\u00ae Crypto-J Software Module", + "type": "AES", + "vendor": "RSA Security, Inc." + }, + { + "_type": "Algorithm", + "cert_id": "2602", + "date": "12/5/2014", + "implementation": "SHA Library", + "type": "SHS", + "vendor": "Sage Microelectronics Corp" + }, + { + "_type": "Algorithm", + "cert_id": "2602", + "date": "9/1/2017", + "implementation": "Bouncy Castle FIPS Java API", + "type": "RSA", + "vendor": "Legion of the Bouncy Castle Inc." + } + ], + "2700": [ + { + "_type": "Algorithm", + "cert_id": "2700", + "date": "3/13/2015", + "implementation": "Apple OSX CoreCrypto Module (Generic, Xeon)", + "type": "SHS", + "vendor": "Apple Inc." + }, + { + "_type": "Algorithm", + "cert_id": "2700", + "date": "10/21/2016", + "implementation": "Axway OpenSSL", + "type": "HMAC", + "vendor": "Axway Inc." + }, + { + "_type": "Algorithm", + "cert_id": "2700", + "date": "11/30/2017", + "implementation": "Brocade Fabric OS FIPS Cryptographic Module", + "type": "RSA", + "vendor": "Brocade Communications Systems LLC" + }, + { + "_type": "Algorithm", + "cert_id": "2700", + "date": "3/30/2018", + "implementation": "Junos OS 17.4R1-S1 - Dataplane", + "type": "TDES", + "vendor": "Juniper Networks, Inc." + }, + { + "_type": "Algorithm", + "cert_id": "2700", + "date": "11/29/2013", + "implementation": "VMware NSS Cryptographic Module", + "type": "AES", + "vendor": "VMware, Inc." + } + ], + "2701": [ + { + "_type": "Algorithm", + "cert_id": "2701", + "date": "3/30/2018", + "implementation": "Security Builder GSE-J Crypto Core", + "type": "TDES", + "vendor": "BlackBerry Certicom" + }, + { + "_type": "Algorithm", + "cert_id": "2701", + "date": "11/30/2017", + "implementation": "ngfips_rsa", + "type": "RSA", + "vendor": "Cavium, Inc." + }, + { + "_type": "Algorithm", + "cert_id": "2701", + "date": "10/28/2016", + "implementation": "Cisco_SSL_Implementation-1", + "type": "HMAC", + "vendor": "Cisco Systems, Inc." + }, + { + "_type": "Algorithm", + "cert_id": "2701", + "date": "3/13/2015", + "implementation": "RSA BSAFE\u00ae Crypto-J JSAFE and JCE Software Module", + "type": "SHS", + "vendor": "RSA, The Security Division of EMC" + }, + { + "_type": "Algorithm", + "cert_id": "2701", + "date": "11/29/2013", + "implementation": "VMware Cryptographic Module", + "type": "AES", + "vendor": "VMware, Inc." + } + ], + "2702": [ + { + "_type": "Algorithm", + "cert_id": "2702", + "date": "3/30/2018", + "implementation": "Security Builder GSE-J Crypto Core", + "type": "TDES", + "vendor": "BlackBerry Certicom" + }, + { + "_type": "Algorithm", + "cert_id": "2702", + "date": "11/30/2017", + "implementation": "DELPHI RSA2048 Signature Verification Algorithm Implementation", + "type": "RSA", + "vendor": "DELPHI" + }, + { + "_type": "Algorithm", + "cert_id": "2702", + "date": "12/6/2013", + "implementation": "RSA BSAFE Crypto-J", + "type": "AES", + "vendor": "McAfee, Inc." + }, + { + "_type": "Algorithm", + "cert_id": "2702", + "date": "10/28/2016", + "implementation": "OpenSSL Crypto Library", + "type": "HMAC", + "vendor": "MikroM GmbH" + }, + { + "_type": "Algorithm", + "cert_id": "2702", + "date": "3/13/2015", + "implementation": "OpenSSL FIPS Object Module", + "type": "SHS", + "vendor": "OpenSSL Validation Services, Inc." + } + ], + "3415": [ + { + "_type": "Algorithm", + "cert_id": "3415", + "date": "1/26/2018", + "implementation": "Apple Secure Key Store CoreCrypto Module (Generic Software Implementation)", + "type": "HMAC", + "vendor": "Apple Inc." + }, + { + "_type": "Algorithm", + "cert_id": "3415", + "date": "6/5/2015", + "implementation": "Motorola Solutions Subscriber \u00b5Mace AES256", + "type": "AES", + "vendor": "Motorola Solutions Inc" + }, + { + "_type": "Algorithm", + "cert_id": "3415", + "date": "11/18/2016", + "implementation": "Secure Parser Library", + "type": "SHS", + "vendor": "Security First Corp." + } + ], + "3426": [ + { + "_type": "Algorithm", + "cert_id": "3426", + "date": "6/11/2015", + "implementation": "Apple iOS CoreCrypto Module (KeyWrap A8 32 bit)", + "type": "AES", + "vendor": "Apple Inc." + }, + { + "_type": "Algorithm", + "cert_id": "3426", + "date": "12/2/2016", + "implementation": "Apple iOS CoreCrypto Module (Generic)", + "type": "SHS", + "vendor": "Apple Inc." + }, + { + "_type": "Algorithm", + "cert_id": "3426", + "date": "1/26/2018", + "implementation": "Apple Secure Key Store CoreCrypto Module (VNG)", + "type": "HMAC", + "vendor": "Apple Inc." + } + ], + "3427": [ + { + "_type": "Algorithm", + "cert_id": "3427", + "date": "12/2/2016", + "implementation": "Apple iOS CoreCrypto Module (Generic)", + "type": "SHS", + "vendor": "Apple Inc." + }, + { + "_type": "Algorithm", + "cert_id": "3427", + "date": "1/26/2018", + "implementation": "Forcepoint NGFW FIPS Java API", + "type": "HMAC", + "vendor": "Forcepoint" + }, + { + "_type": "Algorithm", + "cert_id": "3427", + "date": "6/11/2015", + "implementation": "HP ESKM OpenSSL", + "type": "AES", + "vendor": "Hewlett Packard Enterprise" + } + ], + "3447": [ + { + "_type": "Algorithm", + "cert_id": "3447", + "date": "12/2/2016", + "implementation": "Apple OSX CoreCrypto Module (Optimized SHA nosse)", + "type": "SHS", + "vendor": "Apple Inc." + }, + { + "_type": "Algorithm", + "cert_id": "3447", + "date": "7/2/2015", + "implementation": "FireEye Algorithms Implementation", + "type": "AES", + "vendor": "FireEye, Inc." + }, + { + "_type": "Algorithm", + "cert_id": "3447", + "date": "2/9/2018", + "implementation": "OpenSSL (no AVX2/AVX/AESNI/SSSE3, x86_64, 64-bit library)", + "type": "HMAC", + "vendor": "Red Hat, Inc." + } + ], + "3451": [ + { + "_type": "Algorithm", + "cert_id": "3451", + "date": "12/2/2016", + "implementation": "Apple OSX CoreCrypto Module (Optimized SHA nosse)", + "type": "SHS", + "vendor": "Apple Inc." + }, + { + "_type": "Algorithm", + "cert_id": "3451", + "date": "7/2/2015", + "implementation": "OpenSSL FIPS Object Module", + "type": "AES", + "vendor": "OpenSSL Software Foundation, Inc." + }, + { + "_type": "Algorithm", + "cert_id": "3451", + "date": "2/9/2018", + "implementation": "OpenSSL (no AVX2/AVX/AESNI, x86_64, 64-bit library)", + "type": "HMAC", + "vendor": "Red Hat, Inc." + } + ], + "3464": [ + { + "_type": "Algorithm", + "cert_id": "3464", + "date": "12/9/2016", + "implementation": "Apple OSX CoreCrypto Module (Generic)", + "type": "SHS", + "vendor": "Apple Inc." + }, + { + "_type": "Algorithm", + "cert_id": "3464", + "date": "7/10/2015", + "implementation": "Security Builder Linux Kernel Crypto Core", + "type": "AES", + "vendor": "Certicom Corp." + }, + { + "_type": "Algorithm", + "cert_id": "3464", + "date": "2/9/2018", + "implementation": "HPE Secure Encryption Engine v1.1", + "type": "HMAC", + "vendor": "Hewlett-Packard Development Company, L.P." + } + ] + } +}
\ No newline at end of file diff --git a/test/fips_test_utils.py b/test/fips_test_utils.py new file mode 100644 index 00000000..94fb406a --- /dev/null +++ b/test/fips_test_utils.py @@ -0,0 +1,51 @@ +from typing import List +from pathlib import Path + +def generate_html(ids: List[str], path: Path): + def generate_entry(certificate_id: str) -> str: + return f''' + <tr id="cert-row-0"> + <td class="text-center"> + <a href="/projects/cryptographic-module-validation-program/certificate/3898" id="cert-number-link-0">{certificate_id}</a> + </td> + </tr> + ''' + + html_head = ''' + <!DOCTYPE html> + <html lang="en-us" xml:lang="en-us"> + <head> + <meta charset="utf-8" /> + <title>Cryptographic Module Validation Program | CSRC</title> + <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> + <meta http-equiv="content-style-type" content="text/css" /> + <meta http-equiv="content-script-type" content="text/javascript" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <meta name="msapplication-config" content="/CSRC/Media/images/favicons/browserconfig.xml" /> + <meta name="theme-color" content="#000000" /> + <meta name="google-site-verification" content="xbrnrVYDgLD-Bd64xHLCt4XsPXzUhQ-4lGMj4TdUUTA" /> + </head> + ''' + rows = "" + for cert_id in ids: + rows += f"\n{generate_entry(cert_id)}\n" + html_body = f''' + <body> + <table class="table table-striped table-condensed publications-table table-bordered" id="searchResultsTable"> + <thead> + <tr> + <th class="text-center">Certificate Number</th> + <th class="text-center">Vendor Name</th> + <th class="text-center">Module Name</th> + <th class="text-center">Module Type</th> + <th class="text-center">Validation Date</th> + </tr> + </thead> + <tbody> + {rows} + </tbody> + </table> + </body> + ''' + with open(path, 'w') as f: + f.write(f"{html_head}\n{html_body}\n") diff --git a/test/settings_test.yaml b/test/settings_test.yaml new file mode 100644 index 00000000..9b07a8be --- /dev/null +++ b/test/settings_test.yaml @@ -0,0 +1,19 @@ +--- +smallest_certificate_id_to_connect: + description: During validation we don't connect certificates with number lower than + _this_ to connections + value: 40 +year_difference_between_validations: + description: During validation we don't connect certificates with validation dates + difference higher than _this_ + value: 7 +use_text_with_newlines_during_parsing: + description: During keyword search, search in text with newlines + value: true +ignore_first_page: + description: During keyword search, first page usually contains addresses - ignore it. + value: true +cert_threshold: + description: Used with --higher-precision-results. Determines the amount of mismatched algorithms to be considered faulty. + value: 5 + diff --git a/test/test_fips_oop.py b/test/test_fips_oop.py new file mode 100644 index 00000000..107f0c5d --- /dev/null +++ b/test/test_fips_oop.py @@ -0,0 +1,134 @@ +from unittest import TestCase +from pathlib import Path +from tempfile import TemporaryDirectory + +from sec_certs.dataset import FIPSDataset, FIPSAlgorithmDataset +from sec_certs.configuration import config +from fips_test_utils import generate_html + + + +def _set_up_dataset(td, certs): + dataset = FIPSDataset({}, Path(td), 'test_dataset', 'fips_test_dataset') + generate_html(certs, td + '/test_search.html') + dataset.get_certs_from_web(test=td + '/test_search.html', update_json=False) + return dataset + + +def _set_up_dataset_for_full(td, certs): + dataset = _set_up_dataset(td, certs) + dataset.convert_all_pdfs() + dataset.extract_keywords() + dataset.extract_certs_from_tables(high_precision=True) + dataset.algorithms = FIPSAlgorithmDataset.from_json(Path(__file__).parent / 'data/test_fips_oop/algorithms.json') + dataset.finalize_results() + return dataset + + +class TestFipsOOP(TestCase): + def setUp(self) -> None: + self.data_dir: Path = Path(__file__).parent / 'data' / 'test_fips_oop' + self.dataset = FIPSDataset({}, self.data_dir, 'test_dataset', 'fips_test_dataset') + self.certs_to_parse = [ + ['3099', '2549', '2484', '3038', '2472', '2435', '2471', '1930'], # openSUSE chunk + ['23', '24', '25', '26'], + ['3095', '3651', '3093', '3090', '3197', '3196', '3089', '3195', '3480', '3615', '3194', '3091', '3690', + '3644', '3527', '3094', '3544', '3096', '3092'], # microsoft chunk + ['2630', '2721', '2997', '2441', '2711', '2633', '2798', '3613', '3733', '2908', '2446', '2742', '2447'], + # redhat chunk + ['3850', '2779', '2860', '2665', '1883', '3518', '3141', '2590'], # Document signing chunk + ['3493', '3495', '3711', '3176', '3488', '3126', '3269', '3524', '3220', '2398', '3543', '2676', '3313', + '3363', '3608', '3158'], # Chunk referencing openSSL FIPS Object Module SE + ] + config.load(Path(__file__).parent / 'settings_test.yaml') + + def test_size(self): + for certs in self.certs_to_parse: + with TemporaryDirectory() as td: + dataset = _set_up_dataset(td, certs) + self.assertEqual(len(dataset.certs), len(certs), "Wrong number of parsed certs") + + def test_connections_microsoft(self): + certs = self.certs_to_parse[2] + with TemporaryDirectory() as td: + dataset = _set_up_dataset_for_full(td, certs) + + self.assertEqual(set(dataset.certs['3095'].processed.connections), {x for x in ['3093', '3096', '3094']}) + self.assertEqual(set(dataset.certs['3651'].processed.connections), {x for x in ['3615']}) + self.assertEqual(set(dataset.certs['3093'].processed.connections), {x for x in ['3090', '3091']}) + self.assertEqual(set(dataset.certs['3090'].processed.connections), {x for x in ['3089']}) + self.assertEqual(set(dataset.certs['3197'].processed.connections), + {x for x in ['3195', '3096', '3196', '3644', '3651']}) + self.assertEqual(set(dataset.certs['3196'].processed.connections), + {x for x in ['3194', '3091', '3480', '3615']}) + self.assertEqual(set(dataset.certs['3089'].processed.connections), {x for x in []}) + self.assertEqual(set(dataset.certs['3195'].processed.connections), {x for x in ['3194', '3091', '3480']}) + self.assertEqual(set(dataset.certs['3480'].processed.connections), {x for x in ['3089']}) + self.assertEqual(set(dataset.certs['3615'].processed.connections), {x for x in ['3089']}) + self.assertEqual(set(dataset.certs['3194'].processed.connections), {x for x in ['3089']}) + self.assertEqual(set(dataset.certs['3091'].processed.connections), {x for x in ['3089']}) + self.assertEqual(set(dataset.certs['3690'].processed.connections), {x for x in ['3644', '3196', '3651']}) + self.assertEqual(set(dataset.certs['3644'].processed.connections), {x for x in ['3615']}) + self.assertEqual(set(dataset.certs['3527'].processed.connections), {x for x in ['3090', '3091']}) + self.assertEqual(set(dataset.certs['3094'].processed.connections), {x for x in ['3090', '3091']}) + self.assertEqual(set(dataset.certs['3544'].processed.connections), {x for x in ['3093', '3096', '3527']}) + self.assertEqual(set(dataset.certs['3096'].processed.connections), + {x for x in ['3090', '3194', '3091', '3480']}) + self.assertEqual(set(dataset.certs['3092'].processed.connections), + {x for x in ['3093', '3195', '3096', '3644', '3651']}) + + def test_connections_redhat(self): + certs = self.certs_to_parse[3] + with TemporaryDirectory() as td: + dataset = _set_up_dataset_for_full(td, certs) + self.assertEqual(set(dataset.certs['2630'].processed.connections), {x for x in ['2441']}) + self.assertEqual(set(dataset.certs['2633'].processed.connections), {x for x in ['2441']}) + self.assertEqual(set(dataset.certs['2441'].processed.connections), {x for x in []}) + self.assertEqual(set(dataset.certs['2997'].processed.connections), {x for x in ['2711']}) + self.assertEqual(set(dataset.certs['2446'].processed.connections), {x for x in ['2441']}) + self.assertEqual(set(dataset.certs['2447'].processed.connections), {x for x in ['2441']}) + self.assertEqual(set(dataset.certs['3733'].processed.connections), {x for x in ['2441']}) + self.assertEqual(set(dataset.certs['2441'].processed.connections), {x for x in []}) + self.assertEqual(set(dataset.certs['2711'].processed.connections), {x for x in []}) + self.assertEqual(set(dataset.certs['2908'].processed.connections), {x for x in ['2711']}) + self.assertEqual(set(dataset.certs['3613'].processed.connections), {x for x in ['2997']}) + self.assertEqual(set(dataset.certs['2721'].processed.connections), {x for x in ['2441', '2711']}) + self.assertEqual(set(dataset.certs['2798'].processed.connections), {x for x in ['2721', '2711']}) + self.assertEqual(set(dataset.certs['2711'].processed.connections), {x for x in []}) + self.assertEqual(set(dataset.certs['2997'].processed.connections), {x for x in ['2711']}) + self.assertEqual(set(dataset.certs['2742'].processed.connections), {x for x in ['2721', '2711']}) + self.assertEqual(set(dataset.certs['2721'].processed.connections), {x for x in ['2441', '2711']}) + + def test_docusign_chunk(self): + certs = self.certs_to_parse[4] + with TemporaryDirectory() as td: + dataset = _set_up_dataset_for_full(td, certs) + self.assertEqual(set(dataset.certs['3850'].processed.connections), {x for x in ['3518', '1883']}) + self.assertEqual(set(dataset.certs['2779'].processed.connections), {x for x in ['1883']}) + self.assertEqual(set(dataset.certs['2860'].processed.connections), {x for x in ['1883']}) + self.assertEqual(set(dataset.certs['2665'].processed.connections), {x for x in ['1883']}) + self.assertEqual(set(dataset.certs['1883'].processed.connections), {x for x in []}) + self.assertEqual(set(dataset.certs['3518'].processed.connections), {x for x in ['1883']}) + self.assertEqual(set(dataset.certs['3141'].processed.connections), {x for x in ['1883']}) + self.assertEqual(set(dataset.certs['2590'].processed.connections), {x for x in ['1883']}) + + def test_openssl_chunk(self): + certs = self.certs_to_parse[5] + with TemporaryDirectory() as td: + dataset = _set_up_dataset_for_full(td, certs) + self.assertEqual(set(dataset.certs['3493'].processed.connections), {x for x in ['2398']}) + self.assertEqual(set(dataset.certs['3495'].processed.connections), {x for x in ['2398']}) + self.assertEqual(set(dataset.certs['3711'].processed.connections), {x for x in ['3220']}) + self.assertEqual(set(dataset.certs['3176'].processed.connections), {x for x in ['2398']}) + self.assertEqual(set(dataset.certs['3488'].processed.connections), {x for x in ['2398']}) + self.assertEqual(set(dataset.certs['3126'].processed.connections), {x for x in ['3126', '2398']}) + self.assertEqual(set(dataset.certs['3269'].processed.connections), {x for x in ['3269', '3220']}) + self.assertEqual(set(dataset.certs['3524'].processed.connections), {x for x in ['3220']}) + self.assertEqual(set(dataset.certs['3220'].processed.connections), {x for x in ['3220', '2398']}) + self.assertEqual(set(dataset.certs['2398'].processed.connections), {x for x in []}) + self.assertEqual(set(dataset.certs['3543'].processed.connections), {x for x in ['2398']}) + self.assertEqual(set(dataset.certs['2676'].processed.connections), {x for x in ['2398']}) + self.assertEqual(set(dataset.certs['3313'].processed.connections), {x for x in ['3313', '3220']}) + self.assertEqual(set(dataset.certs['3363'].processed.connections), {x for x in []}) + self.assertEqual(set(dataset.certs['3608'].processed.connections), {x for x in ['2398']}) + self.assertEqual(set(dataset.certs['3158'].processed.connections), {x for x in ['2398']}) |
