aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/manifests.py26
1 files changed, 16 insertions, 10 deletions
diff --git a/scripts/manifests.py b/scripts/manifests.py
index 1f6a571d..079d7a3d 100644
--- a/scripts/manifests.py
+++ b/scripts/manifests.py
@@ -2,19 +2,25 @@
import rpki.x509, rpki.manifest, time, glob, os
-show_content_1 = True
-show_signed_manifest_PEM = True
+show_content_1 = False
+show_signed_manifest_PEM = False
show_signed_manifest_asn1dump = True
-show_content_2 = True
-show_content_3 = True
+show_content_2 = False
+show_content_3 = False
def dumpasn1(thing):
- i,o = os.popen4(("dumpasn1", "-a", "-"))
- i.write(thing)
- i.close()
- print "\n".join(x for x in o.read().splitlines() if x.startswith(" "))
- o.close()
-
+ # Save to file rather than using popen4() because dumpasn1 uses
+ # seek() when decoding ASN.1 content nested in OCTET STRING values.
+ try:
+ fn = "dumpasn1.tmp"
+ f = open(fn, "w")
+ f.write(thing)
+ f.close()
+ f = os.popen("dumpasn1 2>&1 -a " + fn)
+ print "\n".join(x for x in f.read().splitlines() if x.startswith(" "))
+ f.close()
+ finally:
+ os.unlink(fn)
m = rpki.x509.SignedManifest()
m.build(serial = 17,