Bug 26154 - Mono.Security.ASN1..ctor throws System.ArgumentException exception on unknown SSL signature formats
Summary: Mono.Security.ASN1..ctor throws System.ArgumentException exception on unknown...
Status: RESOLVED DUPLICATE of bug 23013
Alias: None
Product: Class Libraries
Classification: Mono
Component: Mono.Security ()
Version: master
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2015-01-19 06:37 UTC by Jo Shields
Modified: 2015-01-19 08:12 UTC (History)
1 user (show)

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

broken Thawte CA cert (940 bytes, application/x-x509-ca-cert)
2015-01-19 06:37 UTC, Jo Shields

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 on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Jo Shields 2015-01-19 06:37:05 UTC
Created attachment 9397 [details]
broken Thawte CA cert

This is very similar to Bug 23013, but occurs on a different (attached) cert:

Unhandled Exception:
System.ArgumentException: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
  at System.Buffer.BlockCopy (System.Array src, Int32 srcOffset, System.Array dst, Int32 dstOffset, Int32 count) [0x000a7] in /home/directhex/Projects/mono/mcs/class/corlib/System/Buffer.cs:99 
  at Mono.Security.ASN1..ctor (System.Byte[] data) [0x00073] in /home/directhex/Projects/mono/mcs/class/Mono.Security/Mono.Security/ASN1.cs:86 
  at Mono.Security.X509.X509Certificate.get_RSA () [0x00013] in /home/directhex/Projects/mono/mcs/class/Mono.Security/Mono.Security.X509/X509Certificate.cs:334 
  at Mono.Security.X509.X509Certificate.get_IsSelfSigned () [0x00018] in /home/directhex/Projects/mono/mcs/class/Mono.Security/Mono.Security.X509/X509Certificate.cs:517 
  at Mono.Tools.CertificateManager.DisplayCertificate (Mono.Security.X509.X509Certificate x509, Boolean machine, Boolean verbose) [0x0000b] in /home/directhex/Projects/mono/mcs/tools/security/certmgr.cs:378 
  at Mono.Tools.CertificateManager.List (ObjectType type, Mono.Security.X509.X509Store store, Boolean machine, System.String file, Boolean verbose) [0x0002b] in /home/directhex/Projects/mono/mcs/tools/security/certmgr.cs:430 
  at Mono.Tools.CertificateManager.Main (System.String[] args) [0x00204] in /home/directhex/Projects/mono/mcs/tools/security/certmgr.cs:699 

The outcome is the same, i.e. SSL is broken entirely for sites whose CA is stored in an inode later on disk than this  cert
Comment 1 Jo Shields 2015-01-19 08:12:09 UTC
These are the same bug. The result differs, because the buffer size "nLength" overflows a different number of times on the two different certificates. For this one, it overflows to a negative number, on the other one it remains positive (in both cases nLength grows exponentially, but keeps overflowing at int.MaxLength)

*** This bug has been marked as a duplicate of bug 23013 ***