Properly handle certs with no extensions.
This commit is contained in:
parent
4cc20fdd05
commit
534aaf2b2a
1 changed files with 1 additions and 1 deletions
|
@ -42,7 +42,7 @@ def extract_names(raw_cert):
|
|||
cert = decoder.decode(raw_cert, asn1Spec=Certificate())[0]
|
||||
tbs = cert.getComponentByName('tbsCertificate')
|
||||
subject = tbs.getComponentByName('subject')
|
||||
extensions = tbs.getComponentByName('extensions')
|
||||
extensions = tbs.getComponentByName('extensions') or []
|
||||
|
||||
# Extract the CommonName(s) from the cert.
|
||||
for rdnss in subject:
|
||||
|
|
Loading…
Reference in a new issue