calculateDigest

81 views
Skip to first unread message

magnusc...@gmail.com

unread,
Apr 28, 2016, 8:48:22 PM4/28/16
to wse-php
hi all...

i've been asking questions here for a few months now without getting any reply. i've been using the code base to implement apparently a way more complicated task and it looks like im not that far way. im not sure where else to turn for help since this is the only form indicated on the github page...

so...  i'm gonna try one more time...

in the code, in the file xmlseclibs.php there is a function called calculateDigest which does exactly that - hashes tags passed to it for a tag in the xml document called DigestValue. the problem is that the tags passed and their final version after the xml is rendered look different and that is tripping the check on the other end.

here is an example:

this is the tag as passed to calculateDigest:

<wsu:Created>
2016-04-29T00:29:44Z
</wsu:Created>
<wsu:Expires>
2016-04-29T01:29:44Z
</wsu:Expires>
</wsu:Timestamp>

this is how it looks like after final rendering with saveXML():


<wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" Id="pfx0f1b5a38-c3c3-c3ff-7615-1b84b1bfd60c">
<wsu:Created>
2016-04-29T00:29:44Z
</wsu:Created>
<wsu:Expires>
2016-04-29T01:29:44Z
</wsu:Expires>
</wsu:Timestamp>


i'd like to know why is this happening?





Rob

unread,
May 3, 2016, 6:41:18 AM5/3/16
to wse-php
My assumption is that since the namespace is not used at all it is being stripped by the saveXML() method. Is it calculating the digest with the namespace included? If so then you need to find a way to either preserve or add it back to the serialized XML

Rob
 
Reply all
Reply to author
Forward
0 new messages