aboutsummaryrefslogtreecommitdiff
path: root/rp/utils
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2014-11-12 00:25:21 +0000
committerRob Austein <sra@hactrn.net>2014-11-12 00:25:21 +0000
commit41e89b412f7beb2c9d829495afdd92bb58f80c46 (patch)
tree3adb6b61d18bf263e066ad2aff75a4985a9b17c5 /rp/utils
parenta11d65c56617104c874b93ef2c801e73f8597c0f (diff)
Initial (awful kludge) version of adding RRDP URIs to SIA extension.
This needs rewriting, but doing it properly requires a minor database schema change, and I'm trying to get a test case running by tomorrow morning. svn path=/branches/tk705/; revision=6015
Diffstat (limited to 'rp/utils')
-rwxr-xr-xrp/utils/uri13
1 files changed, 10 insertions, 3 deletions
diff --git a/rp/utils/uri b/rp/utils/uri
index e72d5e0d..df6e710b 100755
--- a/rp/utils/uri
+++ b/rp/utils/uri
@@ -30,13 +30,19 @@ import rpki.POW
class Certificate(object):
@staticmethod
- def first_rsync(uris):
+ def first_whatever(uris, prefix):
if uris is not None:
for uri in uris:
- if uri.startswith("rsync://"):
+ if uri.startswith(prefix):
return uri
return None
+ def first_rsync(self, uris):
+ return self.first_whatever(uris, "rsync://")
+
+ def first_http(self, uris):
+ return self.first_whatever(uris, "http://")
+
def __init__(self, fn):
try:
x = rpki.POW.X509.derReadFile(fn)
@@ -47,13 +53,14 @@ class Certificate(object):
x = cms.certs()[0]
except:
raise ValueError
- sia = x.getSIA() or (None, None, None)
+ sia = x.getSIA() or (None, None, None, None)
self.fn = fn
self.uris = (
("AIA:caIssuers", self.first_rsync(x.getAIA())),
("SIA:caRepository", self.first_rsync(sia[0])),
("SIA:rpkiManifest", self.first_rsync(sia[1])),
("SIA:signedObject", self.first_rsync(sia[2])),
+ ("SIA:rpkiNotify", self.first_http(sia[3])),
("CRLDP", self.first_rsync(x.getCRLDP())))
def __str__(self):