If statement already is a string do mess with it.

This commit is contained in:
Roland Hedberg
2014-06-05 11:47:59 +02:00
parent 3c3ffb0713
commit ab032b46fe

View File

@@ -38,7 +38,7 @@ from saml2.saml import EncryptedAssertion
import xmldsig as ds
from saml2 import samlp
from saml2 import samlp, SamlBase
from saml2 import SAMLError
from saml2 import extension_elements_to_elements
from saml2 import class_name
@@ -780,7 +780,9 @@ class CryptoBackendXmlSec1(CryptoBackend):
:return: The encrypted text
"""
statement = pre_encrypt_assertion(statement)
if isinstance(statement, SamlBase):
statement = pre_encrypt_assertion(statement)
_, fil = make_temp("%s" % statement, decode=False, delete=False)
_, tmpl = make_temp("%s" % template, decode=False)