diff --git a/src/zeep/wsse/signature.py b/src/zeep/wsse/signature.py index 143ca0f5f..c4aec758e 100644 --- a/src/zeep/wsse/signature.py +++ b/src/zeep/wsse/signature.py @@ -244,7 +244,7 @@ def _signature_prepare(envelope, key, signature_method, digest_method): _sign_node(ctx, signature, envelope.find(QName(soap_env, "Body")), digest_method) timestamp = security.find(QName(ns.WSU, "Timestamp")) if timestamp != None: - _sign_node(ctx, signature, timestamp) + _sign_node(ctx, signature, timestamp, digest_method) ctx.sign(signature) # Place the X509 data inside a WSSE SecurityTokenReference within diff --git a/tests/test_wsse_signature.py b/tests/test_wsse_signature.py index 2f3e730eb..921f9e6ba 100644 --- a/tests/test_wsse_signature.py +++ b/tests/test_wsse_signature.py @@ -35,7 +35,16 @@ @skip_if_no_xmlsec -def test_sign_timestamp_if_present(): +@pytest.mark.parametrize("digest_method,expected_digest_href", DIGEST_METHODS_TESTDATA) +@pytest.mark.parametrize( + "signature_method,expected_signature_href", SIGNATURE_METHODS_TESTDATA +) +def test_sign_timestamp_if_present( + digest_method, + signature_method, + expected_digest_href, + expected_signature_href, +): envelope = load_xml( """