Bug 34768 - Signature verification issue with SignedXML files
Summary: Signature verification issue with SignedXML files
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Security ()
Version: master
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2015-10-12 12:55 UTC by RichardW
Modified: 2015-10-12 12:55 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

sample source (2.81 KB, text/plain)
2015-10-12 12:55 UTC, RichardW

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 34768 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description RichardW 2015-10-12 12:55:35 UTC
Created attachment 13285 [details]
sample source

I'm currently porting some managed Windows libs to run on OSX using Mono, and one of the issues I have is that some functionality that uses System.Security.Cryptography.Xml.SignedXml to sign XML files is failing.
I'm still trying to get to the bottom of it, but as the code works as is on the Microsoft\Windows libs and fails on Mono, I'm raising it as a mono issue.

The attached test app shows a case where the call to SignedXml.CheckSignature() fails on OSX/Mono, but works on Windows.

After a bit of testing, it seems that it fails with the XML

"<ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><string>1234567890123</string><string>0987654321234</string></ArrayOfString>"

but works with

"<ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns=""><string>1234567890123</string><string>0987654321234</string></ArrayOfString>"

and debugging through it, it looks like the issue in the first case is that the transformations performed on the XML during signing causes extra 'xmlns=""' attributes to be added to the <string> nodes, causing it to produce the wrong hash.

Anyone who knows more about how this stuff works have any ideas?