File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -204,13 +204,14 @@ def _signature_prepare(envelope, key):
204204 # Insert the Signature node in the wsse:Security header.
205205 security = get_security_header (envelope )
206206 security .insert (0 , signature )
207- security .append (etree .Element (QName (ns .WSU , "Timestamp" )))
208207
209208 # Perform the actual signing.
210209 ctx = xmlsec .SignatureContext ()
211210 ctx .key = key
212211 _sign_node (ctx , signature , envelope .find (QName (soap_env , "Body" )))
213- _sign_node (ctx , signature , security .find (QName (ns .WSU , "Timestamp" )))
212+ timestamp = security .find (QName (ns .WSU , "Timestamp" ))
213+ if timestamp != None :
214+ _sign_node (ctx , signature , timestamp )
214215 ctx .sign (signature )
215216
216217 # Place the X509 data inside a WSSE SecurityTokenReference within
You can’t perform that action at this time.
0 commit comments