robrichards / xmlseclibs

A PHP library for XML Security
BSD 3-Clause "New" or "Revised" License
386 stars 180 forks source link

Transforms element is optionnal #232

Open chaouchAbderraouf opened 2 years ago

chaouchAbderraouf commented 2 years ago

Hello,

It's my first use of Xml signature , giving the good implementation of your library i used it and i think you for your work.

Actually, the API that i consume didn't accept the transforms element and breaks if it's present. I read the official documentation of xmlDSig and i found that the transforms element is optionnal. The implemenation here does not permit it ufortunately.

I suggest to surround the transforms node creation and it's traitement after in if condition. https://github.com/robrichards/xmlseclibs/blob/master/src/XMLSecurityDSig.php#L665-L666

exp :

if (!empty($options['transforms'])) { $transNodes = $this->createNewSignNode('Transforms'); $refNode->appendChild($transNodes); if (is_array($arTransforms)) { .......................... } elseif (! empty($this->canonicalMethod)) { ................................ } }

Regards. Raouf.

chaouchAbderraouf commented 2 years ago

Hello,

Please can you consider/review my request.

Thanks. Raouf.

chaouchAbderraouf commented 2 years ago

Hello @robrichards can you please make a review for my issue/PR ?

Thanks, Raouf.