From 54a6b55d1a7d400eebee6cb378e7800d192908d0 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Wed, 26 Sep 2007 19:52:38 +0000 Subject: Checkpoint svn path=/scripts/rpki/up_down.py; revision=1037 --- scripts/rpki/up_down.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'scripts/rpki/up_down.py') 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). -- cgit v1.2.3