aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2007-10-09 23:59:45 +0000
committerRob Austein <sra@hactrn.net>2007-10-09 23:59:45 +0000
commitef19bbf62eefa2aef1476c6130b2bb679881fce6 (patch)
tree8c2cbd926c189fa455ea4dc81aca26a2e0829fbe
parent45d983d07592f972d02ea7998293ea47768ed382 (diff)
Checkpoint
svn path=/scripts/manifests.py; revision=1145
-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,