Skip to content

Commit

Permalink
Implement Strict Layout Rules for WSS 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
blaggacao committed Sep 21, 2024
1 parent 950140c commit 87f213b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/zeep/wsse/signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def _signature_prepare(envelope, key, signature_method, digest_method, signature

# Insert the Signature node in the wsse:Security header.
security = get_security_header(envelope)
security.insert(0, signature)
security.append(signature)

# Perform the actual signing.
ctx = xmlsec.SignatureContext()
Expand Down Expand Up @@ -316,7 +316,7 @@ def _sign_envelope_with_key_binary(
)
ref.attrib["URI"] = "#" + ensure_id(bintok)
bintok.text = x509_data.find(QName(ns.DS, "X509Certificate")).text
security.insert(1, bintok)
security.insert(0, bintok)
x509_data.getparent().remove(x509_data)


Expand Down
2 changes: 1 addition & 1 deletion src/zeep/wsse/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def get_security_header(doc):
security = header.find("wsse:Security", namespaces=NSMAP)
if security is None:
security = WSSE.Security()
header.append(security)
header.insert(0, security)
return security


Expand Down

0 comments on commit 87f213b

Please sign in to comment.