Skip to content

Commit ab032b4

Browse files
author
Roland Hedberg
committed
If statement already is a string do mess with it.
1 parent 3c3ffb0 commit ab032b4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/saml2/sigver.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
import xmldsig as ds
4040

41-
from saml2 import samlp
41+
from saml2 import samlp, SamlBase
4242
from saml2 import SAMLError
4343
from saml2 import extension_elements_to_elements
4444
from saml2 import class_name
@@ -780,7 +780,9 @@ def encrypt_assertion(self, statement, enc_key, template,
780780
:return: The encrypted text
781781
"""
782782

783-
statement = pre_encrypt_assertion(statement)
783+
if isinstance(statement, SamlBase):
784+
statement = pre_encrypt_assertion(statement)
785+
784786
_, fil = make_temp("%s" % statement, decode=False, delete=False)
785787
_, tmpl = make_temp("%s" % template, decode=False)
786788

0 commit comments

Comments
 (0)