Skip to content

Add a new firmador module that replaces the previous#219

Closed
ghost wants to merge 7 commits intov4.4from
unknown repository
Closed

Add a new firmador module that replaces the previous#219
ghost wants to merge 7 commits intov4.4from
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Oct 3, 2025

  • Removed of previous signXML (already was deprecated) and firmarXML, reuse firmarXML module, file and function name for backwards compatibility.
  • Removed cli-signer tool that relied on signXML. For those that want to try a command-line tool I suggest an external alternative where the new signer comes from (it does not ingest from stdin, but could be easily modified to support it): https://codeberg.org/fdelapena/xades-b-b-enveloped-signers/raw/branch/master/PHP/signer.php

Additionally:

  • Fixed Docker image for PHP. Fixed compatibility with Podman.
  • Removed some unused v4.2 XSD files found in the meanwhile.
  • Miscellaneous documentation updates (URL updates, minimum PHP version requirements)

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new firmador module that replaces the previous signing modules. The update involves removing several old XML signing modules and introducing a simplified, standalone XML signing implementation.

  • Removes the deprecated signXML and firmarXML modules with their dependencies
  • Introduces a new streamlined firmador module with backward compatibility
  • Updates Postman collection and references to use the new module endpoints

Reviewed Changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
recursos/API CRLibre.postman_collection V3.1.json Updates Postman collection endpoints from signXML/signFE to firmador/firmar
api/tools/cli-signer.php Removes deprecated CLI signer tool
api/contrib/signXML/ Removes entire deprecated signXML module and dependencies
api/contrib/firmarXML/ Removes entire deprecated firmarXML module and xmlseclibs dependency
api/contrib/firmador/ Adds new simplified firmador module with backward compatibility functions
api/contrib/crlibreall/module.php Updates comments to reference new firmador module

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@JeanCarlosChavarriaHughes
Copy link
Copy Markdown
Collaborator

The new version is not fully backwards compatible as it requires the user to change firmarXML with firmador in the w parameter;

Also, there are several warning in the console.

<b>Notice</b>: Undefined variable: p12File in <b>/home/jchavarria/Documents/local/API_Hacienda/api/contrib/firmador/firmador.php</b> on line <b>30</b><br />
<br />
<b>Warning</b>: file_get_contents(): Filename cannot be empty in <b>/home/jchavarria/Documents/local/API_Hacienda/api/contrib/firmador/firmador.php</b> on line <b>30</b><br />
<br />
<b>Notice</b>: Undefined variable: p12Passcode in <b>/home/jchavarria/Documents/local/API_Hacienda/api/contrib/firmador/firmador.php</b> on line <b>31</b><br />
<br />
<b>Notice</b>: Trying to access array offset on value of type null in <b>/home/jchavarria/Documents/local/API_Hacienda/api/contrib/firmador/firmador.php</b> on line <b>33</b><br />
<br />
<b>Warning</b>: openssl_x509_fingerprint(): cannot get cert from parameter 1 in <b>/home/jchavarria/Documents/local/API_Hacienda/api/contrib/firmador/firmador.php</b> on line <b>33</b><br />
<br />
<b>Notice</b>: Trying to access array offset on value of type null in <b>/home/jchavarria/Documents/local/API_Hacienda/api/contrib/firmador/firmador.php</b> on line <b>35</b><br />
<br />
<b>Notice</b>: Trying to access array offset on value of type bool in <b>/home/jchavarria/Documents/local/API_Hacienda/api/contrib/firmador/firmador.php</b> on line <b>37</b><br />
<br />
<b>Warning</b>: Invalid argument supplied for foreach() in <b>/home/jchavarria/Documents/local/API_Hacienda/api/contrib/firmador/firmador.php</b> on line <b>37</b><br />
<br />
<b>Notice</b>: Undefined variable: subject in <b>/home/jchavarria/Documents/local/API_Hacienda/api/contrib/firmador/firmador.php</b> on line <b>38</b><br />
<br />
<b>Warning</b>: array_reverse() expects parameter 1 to be array,
null given in <b>/home/jchavarria/Documents/local/API_Hacienda/api/contrib/firmador/firmador.php</b> on line <b>38</b><br />
<br />
<b>Warning</b>: implode(): Invalid arguments passed in <b>/home/jchavarria/Documents/local/API_Hacienda/api/contrib/firmador/firmador.php</b> on line <b>38</b><br />
<br />
<b>Notice</b>: Trying to access array offset on value of type null in <b>/home/jchavarria/Documents/local/API_Hacienda/api/contrib/firmador/firmador.php</b> on line <b>43</b><br />
<br />
<b>Warning</b>: openssl_x509_export(): cannot get cert from parameter 1 in <b>/home/jchavarria/Documents/local/API_Hacienda/api/contrib/firmador/firmador.php</b> on line <b>43</b><br />
<br />
<b>Notice</b>: Trying to access array offset on value of type bool in <b>/home/jchavarria/Documents/local/API_Hacienda/api/contrib/firmador/firmador.php</b> on line <b>48</b><br />
<br />
<b>Notice</b>: Trying to access array offset on value of type null in <b>/home/jchavarria/Documents/local/API_Hacienda/api/contrib/firmador/firmador.php</b> on line <b>114</b><br />
<br />
<b>Warning</b>: openssl_sign(): supplied key param cannot be coerced into a private key in <b>/home/jchavarria/Documents/local/API_Hacienda/api/contrib/firmador/firmador.php</b> on line <b>114</b><br />
{
"status": "ok",
"resp": {
"xmlFirmado": "PD94bWwgdmVyc2lvbj0i.........+RGlyZWNjacOzbiBkZSBwcnVlYmE8L090cmFzU2VuYXM+CiAgICA8L1ViE+Cg=="
}
}```

cc @fdelapena 

@JeanCarlosChavarriaHughes
Copy link
Copy Markdown
Collaborator

The latest changes are still failing since the firmarXML file does not longer exists, it fails with module not found:

[Tue Oct 14 18:45:22.591529 2025] [php7:notice] [pid 49] [client 192.168.88.61:54157] [d] 25-10-14 12:10:22 @ Loading in path: /var/www/html/api/contrib/firmarXML/module.php\n
[Tue Oct 14 18:45:22.591587 2025] [php7:notice] [pid 49] [client 192.168.88.61:54157] [d] 25-10-14 12:10:22 @ File does not exist\n

Screenshot 2025-10-14 at 12 46 32 PM Screenshot 2025-10-14 at 12 46 21 PM

@ghost
Copy link
Copy Markdown
Author

ghost commented Oct 31, 2025

Renamed to crearXML using same function name and file.
Also removed unused 4.2 xsd files.

@ghost ghost requested a review from JeanCarlosChavarriaHughes October 31, 2025 00:36
@ghost ghost linked an issue Oct 31, 2025 that may be closed by this pull request
@ghost ghost closed this by deleting the head repository Jan 23, 2026
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Eliminar deprecated signXML module in favor of firmarXML

2 participants