From b3a7db984065056b94048e7282173d2f4d0c6641 Mon Sep 17 00:00:00 2001 From: Roland Hedberg Date: Mon, 15 Dec 2014 14:24:32 +0100 Subject: Fixed issue #176 --- src/saml2/entity.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/saml2/entity.py b/src/saml2/entity.py index 13944fa9..2b62c591 100644 --- a/src/saml2/entity.py +++ b/src/saml2/entity.py @@ -531,7 +531,6 @@ class Entity(HTTPBase): return signed_instance_factory(response, self.sec, to_sign) if encrypt_assertion: - sign_class = [(class_name(response), response.id)] if sign: response.signature = pre_signature_part(response.id, self.sec.my_cert, 1) @@ -541,7 +540,12 @@ class Entity(HTTPBase): pre_encryption_part()) # template(response.assertion.id)) if sign: - return signed_instance_factory(response, self.sec, sign_class) + if to_sign: + signed_instance_factory(response, self.sec, to_sign) + else: + sign_class = [(class_name(response), response.id)] + return signed_instance_factory(response, self.sec, + sign_class) else: return response -- cgit v1.2.1