XML signature containing a line break is generated in JBoss EAP 7.4.9+ and 8.0.x
Issue
Our application creates XML signatures in the way explained in Java SE 8 document XML Digital Signature API. The behavior of XML signature has changed between JBoss EAP 7.4.8 and 7.4.9, and line breaks has been included as the follows. Is there any workaround for avoiding the addition of the line breaks?
JBoss EAP 7.4.8 or earlier
<?xml version="1.0" encoding="UTF-8"?><Envelope xmlns="urn:envelope">
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"/><SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></Transforms><DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/><DigestValue>/juoQ4bDxElf1M+KJauO20euW+QAvvPP0nDCruCQooM=</DigestValue></Reference></SignedInfo><SignatureValue>WY+z1yTacQ5dnkQZ++XAPpsDS4S3wYYrNVJraQBCCs85KFOYe8Z4oLweY0x4Stjz63X2ZXrWClOHl17zKTNRA6SRzYdffWdrwVpHZlxH1/XKVRodxty/n1ehVXngandqDHz15vvd1biIBUDwXi3W+1jkij/gcsVjZmB0R2EstYy0foNHd2sFRq+gZtQa7U3Vk01h9PcUrJQhM8QkghUb/vFfJ+iU6wINx18/wPkATSu/n+CfA/1o8h228CpihRCHojPxL/XHwUGSR0r7iBk7/45lzqxpONBdc1OpGsFbztG2ZTENjQ054zlvZ7fh1C3esGougSKOw/o+JgJsynaBjg==</SignatureValue><KeyInfo><KeyValue><RSAKeyValue><Modulus>vX/mlkkS+TTQSP66uIYc+wH6PgHw0zVgCZLD6gROmAUZNEhbHOr+zLJLqb69q5pEjT8siJ9+AOtSCfIvGPD6iOg2N/Iews1vQq3icA6L+6lSisjwQX2DF3Oli3Im7J639P+GvwbX7QHnSYYlmHqemBXUVzLk/5u6TGCoZDdeZavWCwWiXpsVKR/rGX2lj4UBe6X1A/DXhJXpS5FdC/EctN6gcMQC9Ma1pIsGNPSN7eQQfzpjl3pUpYijZg0bR72YxBzzhnEzKbY3ASslYEdcBjPUi2c0DsaRy9szdvBmfXGB5D6k7g5k2Ox6Ba1Cm8J5aUgDgssgFsmFcQg6bwXc0w==</Modulus><Exponent>AQAB</Exponent></RSAKeyValue></KeyValue></KeyInfo></Signature></Envelope>
JBoss EAP 7.4.9+ and 8.0.0+
<?xml version="1.0" encoding="UTF-8"?><Envelope xmlns="urn:envelope">
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"/><SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></Transforms><DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/><DigestValue>/juoQ4bDxElf1M+KJauO20euW+QAvvPP0nDCruCQooM=</DigestValue></Reference></SignedInfo><SignatureValue>P6velcy/Iix9WE7+eMrcHw3A1IAVt54jdSmi2n+EIBfRclMjD1yQvQcG5HvcFD4BEmg+kG3TE58T
vcdGavBRsoxax2wUVykVAB6Xs9gZrlpCeArisan8JyfOMVrX8xgkDyG6H+yO6QVNsF6fPiQ6p9NJ
eUNCIrzFtEmG5T6TL5rduFmkZ1Eh5blSdL8u8mTbbFYRCGTXta4E1MzxcP8PimR8WeA+qFEz1bqs
26V0b/VoGpA52FkrM2HRua77gO5xaQafMDpczuzp+KutdpCBq8bs87nYj5xYaJiOHZlyomTv3CHf
vpU/pWOHGuuvat6oRqFGByLVhaDghO+TpSPuYA==</SignatureValue><KeyInfo><KeyValue><RSAKeyValue><Modulus>3L3v4KkSuIm4l3v1X7RJTYDxUmIuPuvMvFI8FkDn/NEkEPMuHhD9mNqU65OOhmQZZTh3ICBLyNr6
89EhW5K6Xw56eABhfBBZeUG3/CVGcH4Rkmf+gMd9ntiB7SSTOBG/EWenHNKbkPwWitavllgAdLD5
X+jiqdQ0cIiPx10iwWdjOsXRC76XKxAQoKKIW4Oy8LfJvOPbwOT7Dohwri/bCdwJuUu28MQUtyve
SzMpSafTMsHLCgZtolRS/JGBsIdAXIfDOdmwE7QzXYmherGTdAfG//Hc+DIQnSxB37M8Pxs2yw5f
MrSRxE5iVAIxFMJciboobz0USeVNE6j023Hpbw==</Modulus><Exponent>AQAB</Exponent></RSAKeyValue></KeyValue></KeyInfo></Signature></Envelope>
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 7.4.9 or later
- 8.0.0 or later
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.