diff options
author | Rob Austein <sra@hactrn.net> | 2007-10-09 05:47:07 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2007-10-09 05:47:07 +0000 |
commit | 3fb13e36c97810eb9c7cf2d899b60f6dce30b7af (patch) | |
tree | aef4525a33fb21274c23af9d64189c96b9c77bb5 /scripts/rpki/up_down.py | |
parent | 93f1f3c9e6202b8fceb206ac40d5316464e10e2c (diff) |
Checkpoint
svn path=/scripts/rpki/exceptions.py; revision=1126
Diffstat (limited to 'scripts/rpki/up_down.py')
-rw-r--r-- | scripts/rpki/up_down.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/scripts/rpki/up_down.py b/scripts/rpki/up_down.py index 61800b11..7dcab8ee 100644 --- a/scripts/rpki/up_down.py +++ b/scripts/rpki/up_down.py @@ -297,12 +297,8 @@ class issue_pdu(base_elt): r_msg.payload.classes.append(rc) @classmethod - def query(cls, gctx, parent, ca, ca_detail = None): + def query(cls, gctx, parent, ca, ca_detail): """Send an "issue" request to parent associated with ca.""" - if ca_detail is None: - ca_detail = rpki.sql.ca_detail_obj.sql_fetch_active(gctx, ca.ca_id) - if ca_detail is None: - ca_detail = rpki.sql.ca_detail_obj.create(gctx, ca) assert ca_detail is not None and ca_detail.state != "deprecated" sia = (((1, 3, 6, 1, 5, 5, 7, 48, 5), ("uri", ca.sia_uri)), ((1, 3, 6, 1, 5, 5, 7, 48, 10), ("uri", ca.sia_uri + ca_detail.public_key.gSKI() + ".mnf"))) @@ -314,7 +310,12 @@ class issue_pdu(base_elt): class issue_response_pdu(class_response_syntax): """Up-Down protocol "issue_response" PDU.""" - pass + def check(self): + """Check whether this looks like a reasonable issue_response PDU. + XML schema should be tighter for this response. + """ + if len(self.classes) != 1 or len(self.classes[0].certs) != 1: + raise rpki.exceptions.BadIssueResponse class revoke_syntax(base_elt): """Syntax for Up-Down protocol "revoke" and "revoke_response" PDUs.""" |