aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2013-01-25 04:52:38 +0000
committerRob Austein <sra@hactrn.net>2013-01-25 04:52:38 +0000
commit95d3eb56c11c96b2a3c0890b1abfb3f9826cdd9f (patch)
treeea7c93f7fa1c301afb8c61d5981d3119e3cca657
parent8609ad03805edb0b71f401aee46f80f898a59098 (diff)
Catch any exceptions that might occur during invocation of caller
object's internal done() handler (eg, CMS verification errors), so that any such exceptions propagate correctly to the synchronous caller rather than being trapped by the asynchronous I/O core. See #396. svn path=/trunk/; revision=4977
-rw-r--r--rpkid/rpki/http.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/rpkid/rpki/http.py b/rpkid/rpki/http.py
index c3eae1fe..d7690988 100644
--- a/rpkid/rpki/http.py
+++ b/rpkid/rpki/http.py
@@ -1048,13 +1048,18 @@ class caller(object):
"""
Handle CMS-wrapped XML response message.
"""
- r_cms = self.proto.cms_msg(DER = r_der)
- r_msg = r_cms.unwrap((self.server_ta, self.server_cert))
- self.cms_timestamp = r_cms.check_replay(self.cms_timestamp)
- if self.debug:
- print "<!-- Reply -->"
- print r_cms.pretty_print_content()
- cb(r_msg)
+ try:
+ r_cms = self.proto.cms_msg(DER = r_der)
+ r_msg = r_cms.unwrap((self.server_ta, self.server_cert))
+ self.cms_timestamp = r_cms.check_replay(self.cms_timestamp)
+ if self.debug:
+ print "<!-- Reply -->"
+ print r_cms.pretty_print_content()
+ cb(r_msg)
+ except (rpki.async.ExitNow, SystemExit):
+ raise
+ except Exception, e:
+ eb(e)
q_msg = self.proto.msg.query(*pdus)
q_cms = self.proto.cms_msg()