Skip to content

Commit f3a5df6

Browse files
author
Hans Hörberg
committed
Fix for encryption of assertions.
1 parent 805915b commit f3a5df6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/saml2/sigver.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1820,10 +1820,11 @@ def pre_encrypt_assertion(response):
18201820
assertion = response.assertion
18211821
response.assertion = None
18221822
response.encrypted_assertion = EncryptedAssertion()
1823-
if isinstance(assertion, list):
1824-
response.encrypted_assertion.add_extension_elements(assertion)
1825-
else:
1826-
response.encrypted_assertion.add_extension_element(assertion)
1823+
if assertion is not None:
1824+
if isinstance(assertion, list):
1825+
response.encrypted_assertion.add_extension_elements(assertion)
1826+
else:
1827+
response.encrypted_assertion.add_extension_element(assertion)
18271828
# txt = "%s" % response
18281829
# _ass = "%s" % assertion
18291830
# _ass = rm_xmltag(_ass)

0 commit comments

Comments
 (0)