bseddon / xml-signer

Provides signing and verification of XML documents including support for XAdES
BSD 3-Clause "New" or "Revised" License
19 stars 8 forks source link

Issues with autoload.php / Generic::fromNode() in UNIX and TSA.php #1

Closed Guidin12 closed 3 years ago

Guidin12 commented 3 years ago

Hi @bseddon , I'm trying to use your library to generate XAdES signatures in Ubuntu 20.04 and I'm having some issues with autoload files in composer, Generic::fromNode() function.

I have fixed them replacing "\" by "/", but maybe it could be better to use realpath() php function that detect OS system and use paths accordingly (I haven't tested).

Moreover, I couldn't get the timestamp added because of the curl option: CURLOPT_CAINFO which can't be null.

I leave the fixes attached in this issue. fixes.zip

Thanks for everything :)

bseddon commented 3 years ago

Thank you very much for letting me know about these issues. I've applied your fixes (with one alteration) so they are available in the repository now and will be included in the next composer release.

You may have guessed I've working on Window. PHP on Windows is agnostic about the direction of a slash when handling files which is why the code works OK for me. With your fixes I don't think there is a need to use realpath.

The alteration I have made is to the TSA fix. Rather than have almost the same array appear in both sides of the condition, instead the array is wrapped in a call to array_filter() as the default behaviour of this function is to remove array element that has a null value.

Thanks again.