diff options
author | Rob Austein <sra@hactrn.net> | 2008-06-02 23:43:01 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2008-06-02 23:43:01 +0000 |
commit | 7fe2be97aa63bff93e7afca074d42e169a8b92f5 (patch) | |
tree | 37960080bd1fdc7b0de75d9c52549a41b13d7897 /rpkid/pubd.py | |
parent | fec873c92b1fb4445d30dd03592a0b8935a460fa (diff) |
Add BPKI CRL to pubd's SQL database, and clean up a lot of redundant
SAX code.
svn path=/rpkid/irbe-cli.py; revision=1835
Diffstat (limited to 'rpkid/pubd.py')
-rwxr-xr-x | rpkid/pubd.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/rpkid/pubd.py b/rpkid/pubd.py index 818370b3..a96e75f0 100755 --- a/rpkid/pubd.py +++ b/rpkid/pubd.py @@ -48,11 +48,11 @@ class pubd_context(rpki.gctx.global_context): self.sql_cache = {} self.sql_dirty = set() - def handler_common(self, query, client, certs): + def handler_common(self, query, client, certs, crl = None): """Common PDU handler code.""" q_msg = rpki.publication.cms_msg.unwrap(query, certs) r_msg = q_msg.serve_top_level(self, client) - reply = rpki.publication.cms_msg.wrap(r_msg, self.pubd_key, self.pubd_cert) + reply = rpki.publication.cms_msg.wrap(r_msg, self.pubd_key, self.pubd_cert, crl) self.sql_sweep() return reply @@ -75,7 +75,10 @@ class pubd_context(rpki.gctx.global_context): client = rpki.publication.client_elt.sql_fetch(self, long(client_id)) if client is None: raise rpki.exceptions.ClientNotFound, "Could not find client %s" % client_id - return 200, self.handler_common(query, client, (self.bpki_ta, client.bpki_cert, client.bpki_glue)) + config = rpki.publication.config_elt.fetch(self) + if config is None or config.bpki_crl is None: + raise rpki.exceptions.CMSCRLNotSet + return 200, self.handler_common(query, client, (self.bpki_ta, client.bpki_cert, client.bpki_glue), config.bpki_crl) except Exception, data: rpki.log.error(traceback.format_exc()) return 500, "Could not process PDU: %s" % data |