From 45d983d07592f972d02ea7998293ea47768ed382 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Tue, 9 Oct 2007 21:50:47 +0000 Subject: Signed manifests almost working. ASN.1 encoding problem with manifest.version. svn path=/scripts/manifests.py; revision=1144 --- scripts/rpki/manifest.py | 1 + scripts/rpki/x509.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts/rpki') diff --git a/scripts/rpki/manifest.py b/scripts/rpki/manifest.py index c77f092b..51755732 100644 --- a/scripts/rpki/manifest.py +++ b/scripts/rpki/manifest.py @@ -23,6 +23,7 @@ class FilesAndHashes(SequenceOf): class Manifest(Sequence): def __init__(self, optional=0, default=''): self.version = Integer(0, "AgEA") + #self.version = Integer() self.manifestNumber = Integer() self.thisUpdate = GeneralizedTime() self.nextUpdate = GeneralizedTime() diff --git a/scripts/rpki/x509.py b/scripts/rpki/x509.py index e89d0f2c..4bcb20b4 100644 --- a/scripts/rpki/x509.py +++ b/scripts/rpki/x509.py @@ -548,7 +548,10 @@ class SignedManifest(DER_object): self.DER = rpki.cms.sign(self.content.toString(), keypair, certs) def verify(self, ta): - self.content = rpki.cms.verify(self.get_DER(), ta) + m = rpki.manifest.Manifest() + s = rpki.cms.verify(self.get_DER(), ta) + m.fromString(s) + self.content = m def build(self, serial, nextUpdate, names_and_objs): filelist = [] @@ -557,6 +560,7 @@ class SignedManifest(DER_object): d.update(obj.get_DER()) filelist.append((name.rpartition("/")[2], d.digest())) m = rpki.manifest.Manifest() + m.version.set(0) m.manifestNumber.set(serial) m.thisUpdate.set(POW.pkix.time2gen(time.time())) m.nextUpdate.set(POW.pkix.time2gen(nextUpdate)) -- cgit v1.2.3