Bug 36297 - System.Security.Cryptography.Pkcs.SignedCms.CheckSignature() does not throw exception on empty SignedCms.
Summary: System.Security.Cryptography.Pkcs.SignedCms.CheckSignature() does not throw e...
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Security ()
Version: master
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Martin Baulig
Depends on:
Reported: 2015-11-26 16:29 UTC by Hin-Tak Leung
Modified: 2016-11-11 10:50 UTC (History)
2 users (show)

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

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 36297 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 Hin-Tak Leung 2015-11-26 16:29:39 UTC
while experimenting and not really under standing the correct call sequences,
I tried this:

using System.Security.Cryptography.Pkcs;

SignedCms cms = new SignedCms();

without calling Decode() first. This code is silently accepted by Mono, but
throw an exception under MS dot net:

Unhandled Exception: System.InvalidOperationException: The CMS message is not signed.
   at System.Security.Cryptography.Pkcs.SignedCms.CheckSignature(X509Certificate2Collection extraStore, Boolean verifySignatureOnly)
   at System.Security.Cryptography.Pkcs.SignedCms.CheckSignature(Boolean verifySignatureOnly)

Mono should throw an exception too.
Comment 1 Martin Baulig 2016-11-11 10:10:51 UTC
Bump, need to check whether this problem still exists.
Comment 2 Hin-Tak Leung 2016-11-11 10:50:16 UTC
Was there any related code change recently to require a revisit? AFAIC, the class libraries, especially the security related ones, have not been worked on for years. I am not holding my breath for an update.