aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/rpki/left_right.py6
-rw-r--r--scripts/rpki/sql.py8
2 files changed, 10 insertions, 4 deletions
diff --git a/scripts/rpki/left_right.py b/scripts/rpki/left_right.py
index 6c24bebb..59032f17 100644
--- a/scripts/rpki/left_right.py
+++ b/scripts/rpki/left_right.py
@@ -261,7 +261,10 @@ class self_elt(data_elt):
def client_poll(self, gctx):
"""Run the regular client poll cycle with each of this self's parents in turn."""
for parent in parent_elt.sql_fetch_where(gctx, "self_id = %s" % self.self_id):
+
+ # This will need a callback when we go event-driven
r_pdu = rpki.up_down.list_pdu.query(gctx, parent)
+
ca_map = dict((ca.parent_resource_class, ca)
for ca in rpki.sql.ca_obj.sql_fetch_where(gctx, "parent_id = %s" % parent.parent_id))
for rc in r_pdu.payload.classes:
@@ -512,7 +515,8 @@ class repository_elt(data_elt):
elements = ("cms_ta", "https_ta")
sql_template = rpki.sql.template("repository", "repository_id", "self_id", "bsc_id",
- ("cms_ta", rpki.x509.X509), "peer_contact_uri")
+ ("cms_ta", rpki.x509.X509), "peer_contact_uri",
+ ("https_ta", rpki.x509.X509))
cms_ta = None
https_ta = None
diff --git a/scripts/rpki/sql.py b/scripts/rpki/sql.py
index ae4a5ced..1b60a926 100644
--- a/scripts/rpki/sql.py
+++ b/scripts/rpki/sql.py
@@ -229,9 +229,6 @@ class ca_obj(sql_persistant):
already knew about, so we need to check for an updated
certificate, changes in resource coverage, revocation and reissue
with the same key, etc.
-
- How and where do we decide when to request a new cert because the
- old one is going to expire soon?
"""
sia_uri = self.construct_sia_uri(gctx, parent, rc)
@@ -273,7 +270,10 @@ class ca_obj(sql_persistant):
self.sql_store(gctx)
self.sia_uri = self.construct_sia_uri(gctx, parent, rc)
ca_detail = ca_detail_obj.create(gctx, self)
+
+ # This will need a callback when we go event-driven
issue_response = rpki.up_down.issue_pdu.query(gctx, parent, self, ca_detail)
+
ca_detail.latest_ca_cert = issue_response.payload.classes[0].certs[0].cert
ca_detail.ca_cert_uri = issue_response.payload.classes[0].certs[0].cert_url.rsync()
ca_detail.generate_manifest_cert(self)
@@ -363,7 +363,9 @@ class ca_detail_obj(sql_persistant):
frob children of this ca_detail.
"""
+ # This will need a callback when we go event-driven
issue_response = rpki.up_down.issue_pdu.query(gctx, parent, ca, self)
+
self.latest_ca_cert = issue_response.classes[0].certs[0].cert
new_resources = self.latest_ca_cert.get_3779resources()