Skip to content

Commit 5308d95

Browse files
committed
CRL entry extension do not have a AKID extension
1 parent e942085 commit 5308d95

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

credentials/generate-revocation-set.py

+7-14
Original file line numberDiff line numberDiff line change
@@ -304,22 +304,21 @@ def main(use_main_net_dcld: str, use_test_net_dcld: str, use_main_net_http: bool
304304
paa_certificate_object.public_key().verify(crl_signer_certificate.signature,
305305
crl_signer_certificate.tbs_certificate_bytes,
306306
ec.ECDSA(crl_signer_certificate.signature_hash_algorithm))
307-
except Exception as e:
307+
except Exception:
308308
logging.warning("CRL Signer Certificate is not signed by PAA Certificate, continue...")
309-
logging.error("Error: ", e)
310309
continue
311310

312311
# 6. Obtain the CRL
313312
logging.debug(f"Fetching CRL from {revocation_point['dataURL']}")
314313
try:
315314
r = requests.get(revocation_point["dataURL"], timeout=5)
316-
except Exception as e:
315+
except Exception:
317316
logging.error('Failed to fetch CRL')
318317
continue
319318

320319
try:
321320
crl_file = x509.load_der_x509_crl(r.content)
322-
except Exception as e:
321+
except Exception:
323322
logging.error('Failed to load CRL')
324323
continue
325324

@@ -374,16 +373,10 @@ def main(use_main_net_dcld: str, use_test_net_dcld: str, use_main_net_http: bool
374373
pass
375374

376375
# b.
377-
try:
378-
revoked_cert_authority_key_id = revoked_cert.extensions.get_extension_for_oid(
379-
x509.OID_AUTHORITY_KEY_IDENTIFIER).value.key_identifier
380-
381-
if revoked_cert_authority_key_id is None or revoked_cert_authority_key_id != crl_signer_subject_key_id:
382-
logging.warning("CRL Authority Key ID is not CRL Signer Subject Key ID, continue...")
383-
continue
384-
except Exception:
385-
logging.warning("CRL Authority Key ID not found, continue...")
386-
continue
376+
# TODO: Verify that the certificate chain of the entry is linking to the same PAA
377+
# that issued the CRLSignerCertificate for this entry, including path through
378+
# CRLSignerDelegator if present. If the PAAs under which were issued the certificate
379+
# and the CRLSignerCertificate are different, ignore the entry.
387380

388381
# c. and d.
389382
serialnumber_list.append(bytes(str('{:02X}'.format(revoked_cert.serial_number)), 'utf-8').decode('utf-8'))

0 commit comments

Comments
 (0)