[Pkg-mono-svn-commits] [SCM] mono branch, master, updated. debian/2.10.5-1-10-g4067135

Mirco Bauer meebey at meebey.net
Mon Jan 16 06:01:18 UTC 2012


The following commit has been merged in the master branch:
commit 977f0e04f887be0bfef284d212da0bd13f96d845
Author: Sebastien Pouliot <sebastien at ximian.com>
Date:   Wed Mar 30 14:07:30 2011 -0400

    Avoid ANE when a key algorithm parameters is really null (not just ASN.1 null)
    
    * PublicKey.cs: Avoid an ArgumentNullException when the EndodedParameters
    is from (Mono's X509Certificate) public key is null (instead of the more
    common ASN.1 null). Fix parsing some certificates, see bnc #682619
    (cherry picked from commit a5f66c48354fa73f256db6fb16a5ba2a6e4abb4e)

diff --git a/mcs/class/System/System.Security.Cryptography.X509Certificates/PublicKey.cs b/mcs/class/System/System.Security.Cryptography.X509Certificates/PublicKey.cs
index a1f65e7..94587ec 100644
--- a/mcs/class/System/System.Security.Cryptography.X509Certificates/PublicKey.cs
+++ b/mcs/class/System/System.Security.Cryptography.X509Certificates/PublicKey.cs
@@ -47,6 +47,8 @@ namespace System.Security.Cryptography.X509Certificates {
 		private AsnEncodedData _params;
 		private Oid _oid;
 
+		static byte[] Empty = new byte [0];
+
 		public PublicKey (Oid oid, AsnEncodedData parameters, AsnEncodedData keyValue)
 		{
 			if (oid == null)
@@ -108,7 +110,7 @@ namespace System.Security.Cryptography.X509Certificates {
 
 			_oid = new Oid (certificate.KeyAlgorithm);
 			_keyValue = new AsnEncodedData (_oid, certificate.PublicKey);
-			_params = new AsnEncodedData (_oid, certificate.KeyAlgorithmParameters);
+			_params = new AsnEncodedData (_oid, certificate.KeyAlgorithmParameters ?? Empty);
 		}
 
 		// properties

-- 
mono



More information about the Pkg-mono-svn-commits mailing list