chg: [api] skip extraction of extension for empty fields

Sample certificate: c46fed822dadac3f31f9bb4d1a78a1d9eae4567b
This commit is contained in:
Alexandre Dulaunoy 2021-04-02 10:09:14 +02:00
parent 5ca337aeb0
commit 7cc17a4ced
Signed by: adulau
GPG key ID: 09E2CD4944E6CBCD

View file

@ -168,7 +168,10 @@ class FetchCertificateHandler(tornado.web.RequestHandler):
extcount = cert.get_ext_count() extcount = cert.get_ext_count()
for i in range(0, extcount): for i in range(0, extcount):
try:
out['info']['extension'][cert.get_ext_at(i).get_name()] = cert.get_ext_at(i).get_value() out['info']['extension'][cert.get_ext_at(i).get_name()] = cert.get_ext_at(i).get_value()
except:
pass
if ricsi.exists(fp): if ricsi.exists(fp):
icsi = ricsi.hgetall(fp) icsi = ricsi.hgetall(fp)
out['icsi'] = icsi out['icsi'] = icsi