diff options
author | Rob Austein <sra@hactrn.net> | 2008-04-10 13:52:54 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2008-04-10 13:52:54 +0000 |
commit | afd86b7de01a93340bf50cbab548c215938deb4b (patch) | |
tree | b062a05fa214f329678bbfc9d31bfe938419015d | |
parent | b0a7855141a7b2f14bd7a529a14c3ddab683c697 (diff) |
Allow multiple "trusted" certs.
svn path=/rpkid/rpki/cms.py; revision=1647
-rw-r--r-- | rpkid/rpki/cms.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/rpkid/rpki/cms.py b/rpkid/rpki/cms.py index e3e452b5..b3134587 100644 --- a/rpkid/rpki/cms.py +++ b/rpkid/rpki/cms.py @@ -64,7 +64,12 @@ def verify(der, ta): cms = POW.derRead(POW.CMS_MESSAGE, der) store = POW.X509Store() - store.addTrust(ta.get_POW()) + + if isinstance(ta, (tuple, list)): + for x in ta: + store.addTrust(x.get_POW()) + else: + store.addTrust(ta.get_POW()) try: return cms.verify(store) @@ -73,8 +78,13 @@ def verify(der, ta): if debug >= 1: print "CMS verification failed, dumping inputs:" print - print "TA:" - dumpasn1(ta.get_DER()) + if isinstance(ta, (tuple, list)): + for x in ta: + print "TA:" + dumpasn1(x.get_DER()) + else: + print "TA:" + dumpasn1(ta.get_DER()) print print "CMS:" dumpasn1(der) |