Skip to content

Commit 055b314

Browse files
author
Roland Hedberg
committed
Merge pull request #188 from richtera/master
Fix error when response has no cert but outstanding_certs is defined.
2 parents a1b7a97 + cd446e3 commit 055b314

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/saml2/entity.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -937,9 +937,13 @@ def _parse_response(self, xmlstr, response_cls, service, binding,
937937

938938
if response:
939939
if outstanding_certs:
940-
_, key_file = make_temp(
941-
"%s" % outstanding_certs[
942-
response.in_response_to]["key"], decode=False)
940+
cert = outstanding_certs[
941+
response.in_response_to]
942+
if cert:
943+
_, key_file = make_temp(
944+
"%s" % cert["key"], decode=False)
945+
else:
946+
key_file = ""
943947
else:
944948
key_file = ""
945949
response = response.verify(key_file)

0 commit comments

Comments
 (0)