selective-php / xmldsig

Sign XML Documents with Digital Signatures
MIT License
73 stars 34 forks source link

VerifyXML issue #15

Closed iBullRay closed 2 years ago

iBullRay commented 2 years ago

In some situations after veryfing xml for equal signatures method can return false, but signatures are correct. I think that it depends on your xml response. To fix this, i changed $xml->preserveWhiteSpace to false in verifyXml method. So my suggestion is to make an additional option for this method where we can choose value of $xml->preserveWhiteSpace option.

odan commented 2 years ago

I think this would be a good feature, but the question is why does this happen? Who is signing the response? Another server? How does the xml looks like?

iBullRay commented 2 years ago

@odan Yes, another server is signing the response and i check it with my key. It reponse with different XML and with different data and i really dont know why these happens. Maybe, because response server written in C# with buggy and dirty code or it depends on content of response. It can be single case with content of my response server, who knows :) It would be nice if this option can be added to these method for such cases

odan commented 2 years ago

Ok we could add a boolean parameter to the verifyXml method, or we add a configuration array key to the constructor. Can you create a PR please?

odan commented 2 years ago

This should be fixed in the next release.