Skip to content

Commit 87f213b

Browse files
committed
Implement Strict Layout Rules for WSS 1.0
1 parent 950140c commit 87f213b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/zeep/wsse/signature.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def _signature_prepare(envelope, key, signature_method, digest_method, signature
242242

243243
# Insert the Signature node in the wsse:Security header.
244244
security = get_security_header(envelope)
245-
security.insert(0, signature)
245+
security.append(signature)
246246

247247
# Perform the actual signing.
248248
ctx = xmlsec.SignatureContext()
@@ -316,7 +316,7 @@ def _sign_envelope_with_key_binary(
316316
)
317317
ref.attrib["URI"] = "#" + ensure_id(bintok)
318318
bintok.text = x509_data.find(QName(ns.DS, "X509Certificate")).text
319-
security.insert(1, bintok)
319+
security.insert(0, bintok)
320320
x509_data.getparent().remove(x509_data)
321321

322322

src/zeep/wsse/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def get_security_header(doc):
2323
security = header.find("wsse:Security", namespaces=NSMAP)
2424
if security is None:
2525
security = WSSE.Security()
26-
header.append(security)
26+
header.insert(0, security)
2727
return security
2828

2929

0 commit comments

Comments
 (0)