diff --git a/src/python_testing/TC_DA_1_2.py b/src/python_testing/TC_DA_1_2.py index 30a5285a4a4b68..7b5945dd618202 100644 --- a/src/python_testing/TC_DA_1_2.py +++ b/src/python_testing/TC_DA_1_2.py @@ -383,7 +383,12 @@ async def test_TC_DA_1_2(self): if '.der' not in filename: continue with open(os.path.join(cd_cert_dir, filename), 'rb') as f: - cert = x509.load_der_x509_certificate(f.read()) + logging.info(f'Parsing CD signing certificate file: {filename}') + try: + cert = x509.load_der_x509_certificate(f.read()) + except ValueError: + logging.info(f'File is not a valid certificate, skipping') + pass pub = cert.public_key() ski = x509.SubjectKeyIdentifier.from_public_key(pub).digest certs[ski] = pub