robrichards / xmlseclibs

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

Enc, DSig: Add public preserveWhiteSpace and formatOutput switches #221

Open sprytnyserek opened 3 years ago

sprytnyserek commented 3 years ago

This is somehow related to following issues and pull requests:

I propose to enable ability to skip whitespaces and formatting from the XML Enc and Sig templates using the generic options from DOMDocument class: preserveWhiteSpace and formatOutput, and make it configurable with options with the same names. Current behavior is set as default one.

Some relying parties may be highly sensitive to redundant spaces, tabs and newlines in the XML payload while they can (and should) be considered as true XML text nodes. It appears in e.g. WSFed module in .NET Core 3.1 and .NET 5.

Enabling solution like this to the upstream brings no risk to existing relying solutions.

tvdijen commented 2 years ago

Hi @robrichards ! You see any problem merging this?