Skip to content

Commit b3a7db9

Browse files
author
Roland Hedberg
committed
Fixed issue #176
1 parent cf577a4 commit b3a7db9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/saml2/entity.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,6 @@ def _response(self, in_response_to, consumer_url=None, status=None,
531531
return signed_instance_factory(response, self.sec, to_sign)
532532

533533
if encrypt_assertion:
534-
sign_class = [(class_name(response), response.id)]
535534
if sign:
536535
response.signature = pre_signature_part(response.id,
537536
self.sec.my_cert, 1)
@@ -541,7 +540,12 @@ def _response(self, in_response_to, consumer_url=None, status=None,
541540
pre_encryption_part())
542541
# template(response.assertion.id))
543542
if sign:
544-
return signed_instance_factory(response, self.sec, sign_class)
543+
if to_sign:
544+
signed_instance_factory(response, self.sec, to_sign)
545+
else:
546+
sign_class = [(class_name(response), response.id)]
547+
return signed_instance_factory(response, self.sec,
548+
sign_class)
545549
else:
546550
return response
547551

0 commit comments

Comments
 (0)