From ab032b46fec86d657b53e7e6ff2bc111e24cfc47 Mon Sep 17 00:00:00 2001 From: Roland Hedberg Date: Thu, 5 Jun 2014 11:47:59 +0200 Subject: [PATCH] If statement already is a string do mess with it. --- src/saml2/sigver.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/saml2/sigver.py b/src/saml2/sigver.py index c39157c..972c748 100644 --- a/src/saml2/sigver.py +++ b/src/saml2/sigver.py @@ -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)