summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/saml2/entity.py14
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)