Skip to content

Commit cd446e3

Browse files
author
Andreas Richter
committed
Fix error when response has no cert but outstanding_certs is defined.
1 parent 5174a48 commit cd446e3

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
@@ -872,9 +872,13 @@ def _parse_response(self, xmlstr, response_cls, service, binding,
872872

873873
if response:
874874
if outstanding_certs:
875-
_, key_file = make_temp(
876-
"%s" % outstanding_certs[
877-
response.in_response_to]["key"], decode=False)
875+
cert = outstanding_certs[
876+
response.in_response_to]
877+
if cert:
878+
_, key_file = make_temp(
879+
"%s" % cert["key"], decode=False)
880+
else:
881+
key_file = ""
878882
else:
879883
key_file = ""
880884
response = response.verify(key_file)

0 commit comments

Comments
 (0)