diff options
author | Roland Hedberg <roland.hedberg@adm.umu.se> | 2015-03-11 09:58:42 +0100 |
---|---|---|
committer | Roland Hedberg <roland.hedberg@adm.umu.se> | 2015-03-11 09:58:42 +0100 |
commit | 13ff5e8899300c9b359fa1bdfdb3d412be0d7356 (patch) | |
tree | 83837d82093e2a2dadbcbad11b52b978e987aa29 | |
parent | 055b3144dc38609b89de9b559922577aa349f10e (diff) | |
download | pysaml2-13ff5e8899300c9b359fa1bdfdb3d412be0d7356.tar.gz |
Slightly better handling of outstanding_certs.2.4.0
-rw-r--r-- | src/saml2/entity.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/saml2/entity.py b/src/saml2/entity.py index 82c932f0..eadeb105 100644 --- a/src/saml2/entity.py +++ b/src/saml2/entity.py @@ -1,5 +1,5 @@ import base64 -from binascii import hexlify +#from binascii import hexlify import logging from hashlib import sha1 from Crypto.PublicKey import RSA @@ -937,13 +937,13 @@ class Entity(HTTPBase): if response: if outstanding_certs: - cert = outstanding_certs[ - response.in_response_to] - if cert: - _, key_file = make_temp( - "%s" % cert["key"], decode=False) - else: + try: + cert = outstanding_certs[response.in_response_to] + except KeyError: key_file = "" + else: + _, key_file = make_temp("%s" % cert["key"], + decode=False) else: key_file = "" response = response.verify(key_file) |