diff options
-rw-r--r-- | myrpki/schema.py | 2 | ||||
-rw-r--r-- | myrpki/schema.rng | 2 | ||||
-rwxr-xr-x | rpkid/irdbd.py | 35 | ||||
-rw-r--r-- | rpkid/rpki/https.py | 1 | ||||
-rw-r--r-- | rpkid/rpki/rpki_engine.py | 6 |
5 files changed, 26 insertions, 20 deletions
diff --git a/myrpki/schema.py b/myrpki/schema.py index 33752636..5208ed87 100644 --- a/myrpki/schema.py +++ b/myrpki/schema.py @@ -1,7 +1,7 @@ import lxml.etree myrpki = lxml.etree.RelaxNG(lxml.etree.fromstring('''<?xml version="1.0" encoding="UTF-8"?> <!-- - $Id: schema.rnc 2700 2009-08-24 19:09:24Z sra $ + $Id: schema.rnc 2722 2009-08-31 22:24:48Z sra $ RelaxNG Schema for MyRPKI XML messages diff --git a/myrpki/schema.rng b/myrpki/schema.rng index 5e380784..c4328d3a 100644 --- a/myrpki/schema.rng +++ b/myrpki/schema.rng @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - $Id: schema.rnc 2700 2009-08-24 19:09:24Z sra $ + $Id: schema.rnc 2722 2009-08-31 22:24:48Z sra $ RelaxNG Schema for MyRPKI XML messages diff --git a/rpkid/irdbd.py b/rpkid/irdbd.py index 2c3f49e3..9113f44f 100755 --- a/rpkid/irdbd.py +++ b/rpkid/irdbd.py @@ -111,24 +111,35 @@ def handler(query, path, cb): db.ping() - q_msg = rpki.left_right.cms_msg.unwrap(query, (bpki_ta, rpkid_cert)) + r_msg = rpki.left_right.msg.reply() - if not isinstance(q_msg, rpki.left_right.msg) or not q_msg.is_query(): - raise rpki.exceptions.BadQuery, "Unexpected %s PDU" % repr(q_msg) + try: - r_msg = rpki.left_right.msg.reply() + q_msg = rpki.left_right.cms_msg.unwrap(query, (bpki_ta, rpkid_cert)) + + if not isinstance(q_msg, rpki.left_right.msg) or not q_msg.is_query(): + raise rpki.exceptions.BadQuery, "Unexpected %s PDU" % repr(q_msg) - for q_pdu in q_msg: + for q_pdu in q_msg: - try: - if type(q_pdu) in handle_dispatch: + try: + if type(q_pdu) not in handle_dispatch: + raise rpki.exceptions.BadQuery, "Unexpected %s PDU" % repr(q_pdu) handle_dispatch[type(q_pdu)](q_pdu, r_msg) - else: - raise rpki.exceptions.BadQuery, "Unexpected %s PDU" % repr(q_pdu) - except Exception, data: - rpki.log.traceback() - r_msg.append(rpki.left_right.report_error_elt.from_exception(data, q_pdu.self_handle, q_pdu.tag)) + except (rpki.async.ExitNow, SystemExit): + raise + + except Exception, data: + rpki.log.traceback() + r_msg.append(rpki.left_right.report_error_elt.from_exception(data, q_pdu.self_handle, q_pdu.tag)) + + except (rpki.async.ExitNow, SystemExit): + raise + + except Exception, data: + rpki.log.traceback() + r_msg.append(rpki.left_right.report_error_elt.from_exception(data)) cb(200, rpki.left_right.cms_msg.wrap(r_msg, irdbd_key, irdbd_cert)) diff --git a/rpkid/rpki/https.py b/rpkid/rpki/https.py index 1b2d948e..305182e1 100644 --- a/rpkid/rpki/https.py +++ b/rpkid/rpki/https.py @@ -136,7 +136,6 @@ class http_message(object): class http_request(http_message): def __init__(self, cmd = None, path = None, version = default_http_version, body = None, callback = None, errback = None, **headers): - #assert cmd is None or cmd == "POST" or body is None assert cmd == "POST" or body is None http_message.__init__(self, version = version, body = body, headers = headers) self.cmd = cmd diff --git a/rpkid/rpki/rpki_engine.py b/rpkid/rpki/rpki_engine.py index c383f9a2..b32d5465 100644 --- a/rpkid/rpki/rpki_engine.py +++ b/rpkid/rpki/rpki_engine.py @@ -945,7 +945,7 @@ class child_cert_obj(rpki.sql.sql_persistent): rpki.log.info("Suppressing withdrawal of %r" % self.cert) done() - def reissue(self, ca_detail, callback = None, errback = None, resources = None, sia = None): + def reissue(self, ca_detail, callback, errback, resources = None, sia = None): """ Reissue an existing cert, reusing the public key. If the cert we would generate is identical to the one we already have, we just @@ -955,10 +955,6 @@ class child_cert_obj(rpki.sql.sql_persistent): child_cert_obj must use the return value from this method. """ - # Hack during conversion, remove default values and these assertions eventually - assert callback is not None - assert errback is not None - ca = ca_detail.ca() child = self.child() |