Skip to content

Commit ac59e8a

Browse files
committed
Do no prepare assertion signature in create_attribute_response but in _response
Signed-off-by: Ivan Kanakarakis <[email protected]>
1 parent c0c412e commit ac59e8a

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

src/saml2/server.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,6 @@ def _authn_response(
548548

549549
# ------------------------------------------------------------------------
550550

551-
# XXX calls pre_signature_part without ensuring sign_alg/digest_alg
552551
# XXX DONE idp create > _response
553552
def create_attribute_response(
554553
self,
@@ -616,29 +615,18 @@ def create_attribute_response(
616615
issuer=_issuer, name_id=name_id,
617616
farg=farg['assertion'])
618617

619-
if sign_assertion:
620-
# XXX calls pre_signature_part without ensuring sign_alg/digest_alg
621-
assertion.signature = pre_signature_part(
622-
assertion.id, self.sec.my_cert, 1, sign_alg=sign_alg, digest_alg=digest_alg
623-
)
624-
# Just the assertion or the response and the assertion ?
625-
to_sign = [(class_name(assertion), assertion.id)]
626-
kwargs['sign_assertion'] = True
627-
628-
kwargs["assertion"] = assertion
629-
630-
if sp_entity_id:
631-
kwargs['sp_entity_id'] = sp_entity_id
632-
633618
return self._response(
634619
in_response_to,
635620
destination,
636621
status,
637622
issuer,
638623
sign_response,
639624
to_sign,
625+
sign_assertion=sign_assertion,
640626
sign_alg=sign_alg,
641627
digest_alg=digest_alg,
628+
assertion=assertion,
629+
sp_entity_id=sp_entity_id,
642630
**kwargs,
643631
)
644632

0 commit comments

Comments
 (0)