Skip to content

Commit

Permalink
Slightly better handling of outstanding_certs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Roland Hedberg committed Mar 11, 2015
1 parent 055b314 commit 13ff5e8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/saml2/entity.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -937,13 +937,13 @@ def _parse_response(self, xmlstr, response_cls, service, binding,

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)
Expand Down

0 comments on commit 13ff5e8

Please sign in to comment.