From 0b13cb5aaa9163203d9dcceeab6330922671a040 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Fri, 10 Aug 2007 19:02:48 +0000 Subject: Cleanup svn path=/scripts/pkcs10.py; revision=859 --- scripts/pkcs10.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'scripts/pkcs10.py') 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() -- cgit v1.2.3