diff options
author | Rob Austein <sra@hactrn.net> | 2007-09-26 19:52:38 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2007-09-26 19:52:38 +0000 |
commit | 54a6b55d1a7d400eebee6cb378e7800d192908d0 (patch) | |
tree | 5854051d4d57c159c0e2715315c90609872180b7 /scripts/rpki/up_down.py | |
parent | b67f0c5fb4cf8d9358ba36b1bfbfa31dcb3cde4f (diff) |
Checkpoint
svn path=/scripts/rpki/up_down.py; revision=1037
Diffstat (limited to 'scripts/rpki/up_down.py')
-rw-r--r-- | scripts/rpki/up_down.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/scripts/rpki/up_down.py b/scripts/rpki/up_down.py index a58a6e59..83b80cda 100644 --- a/scripts/rpki/up_down.py +++ b/scripts/rpki/up_down.py @@ -217,11 +217,17 @@ class issue_pdu(base_elt): def serve_pdu(self, gctx, q_msg, r_msg, child): - # Tasks: - # # 1) self.class_naem is ca_id, so pull the corresponding ca # object, throw an exception if we can't find it. - # + + if not self.class_name.isdigit(): + raise rpki.exceptions.BadClassNameSyntax, "Bad class name %s" % self.class_name + ca_id = long(self.class_name) + ca = rpki.sql.ca_obj.sql_fetch(gctx.db, gctx.cur, ca_id) + ca_detail = rpki.sql.ca_detail_elt.sql_fetch_active(gctx.db, gctx.cur, ca_id) + if ca is None or ca_detail is None: + raise rpki.exceptions.NotInDatabase + # 2) Check that PKCS#10 is legal according to the profile (has all # required fields, doesn't have any forbidden fields, fields # that it has don't conflict with anything we already know). |