aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/pkcs10.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/scripts/pkcs10.py b/scripts/pkcs10.py
index e788a502..738ddbaa 100644
--- a/scripts/pkcs10.py
+++ b/scripts/pkcs10.py
@@ -15,16 +15,19 @@ for name in glob.glob("resource-cert-samples/*.req"):
print "[", name, "]"
- exts = pkcs10.certificationRequestInfo.attributes.get()[0][1][0]
+ extc = pkcs10.certificationRequestInfo.attributes.val
+ exts = extc.choices[extc.choice][0]
+
+ #print len(exts), exts[0].extnValue
if parse_extensions:
- as, v4, v6 = rpki.resource_set.parse_extensions(exts)
+ as, v4, v6 = rpki.resource_set.parse_extensions(exts.get())
if as: print "ASN =", as
if v4: print "IPv4 =", v4
if v6: print "IPv6 =", v6
- for t in exts:
+ for t in exts.get():
oid = t[0]
if oid in ((1, 3, 6, 1, 5, 5, 7, 1, 7), (1, 3, 6, 1, 5, 5, 7, 1, 8)):
continue
@@ -34,8 +37,7 @@ for name in glob.glob("resource-cert-samples/*.req"):
print POW.pkix.oid2obj(oid), oid, "=", val
if list_extensions:
- extensions = pkcs10.certificationRequestInfo.attributes.sequenceOf[0].val.sequenceOf[0].sequenceOf
- for x in extensions:
+ for x in exts:
oid = x.extnID.get()
name = POW.pkix.oid2obj(oid)
crit = x.critical.get()