Open
Description
Version: 45.0.3
Hello Developer, I successfully parsed a CRL file with an empty Key Identifier using Cryptography.When I used GnuTLS to parse this CRL file, it returned an error: error: gnutls_x509_ext_import_authority_key_id: ASN1 parser: Error in DER parsing. Is this considered an error?
Test Case:
Code:
from cryptography.x509 import load_pem_x509_crl, load_der_x509_crl
from cryptography.x509 import ExtensionNotFound
import sys
def load_crl(file_path):
with open(file_path, "rb") as f:
crl_data = f.read()
try:
crl = load_pem_x509_crl(crl_data)
except ValueError:
crl = load_der_x509_crl(crl_data)
return crl
def print_crl_issuer(file_path):
crl=load_crl(file_path)
aki_extension = None
try:
for ext in crl.extensions:
if ext.oid == x509.oid.ExtensionOID.AUTHORITY_KEY_IDENTIFIER:
aki=ext.value
print(aki)
except Exception as e:
print(f"Error parsing CRL: {e}")
file_path = 'filename'
print_crl_issuer(file_path)