[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:24 UTC 2012


The following commit has been merged in the master branch:
commit 2050ee01b6e5e42f2ff1aa9d12f8dbdc24fdfabe
Author: Sebastien Pouliot <sebastien at ximian.com>
Date:   Mon Apr 4 11:15:29 2011 -0400

    Add MD4, SHA384 and SHA512 signature verification to X.509 certificates
    
    * X509Certificate.cs: Add MD4 (if available), SHA384 and SHA512
    RSA signature verification
    (cherry picked from commit 95ab3c8d2a43eb3fa47279a560e58340b7806615)

diff --git a/mcs/class/Mono.Security/Mono.Security.X509/X509Certificate.cs b/mcs/class/Mono.Security/Mono.Security.X509/X509Certificate.cs
index 5106ff6..0c48e71 100644
--- a/mcs/class/Mono.Security/Mono.Security.X509/X509Certificate.cs
+++ b/mcs/class/Mono.Security/Mono.Security.X509/X509Certificate.cs
@@ -295,6 +295,14 @@ namespace Mono.Security.X509 {
 							hash = Mono.Security.Cryptography.MD2.Create ();
 #endif
 							break;
+						case "1.2.840.113549.1.1.3":	// MD4 with RSA encryption 
+							// maybe someone installed MD4 ?
+#if INSIDE_CORLIB
+							hash = HashAlgorithm.Create ("MD4");
+#else
+							hash = Mono.Security.Cryptography.MD4.Create ();
+#endif
+							break;
 						case "1.2.840.113549.1.1.4":	// MD5 with RSA encryption 
 							hash = MD5.Create ();
 							break;
@@ -306,6 +314,12 @@ namespace Mono.Security.X509 {
 						case "1.2.840.113549.1.1.11":	// SHA-256 with RSA Encryption
 							hash = SHA256.Create ();
 							break;
+						case "1.2.840.113549.1.1.12":	// SHA-384 with RSA Encryption
+							hash = SHA384.Create ();
+							break;
+						case "1.2.840.113549.1.1.13":	// SHA-512 with RSA Encryption
+							hash = SHA512.Create ();
+							break;
 						default:
 							return null;
 					}
@@ -400,10 +414,13 @@ namespace Mono.Security.X509 {
 
 				switch (m_signaturealgo) {
 					case "1.2.840.113549.1.1.2":	// MD2 with RSA encryption 
+					case "1.2.840.113549.1.1.3":	// MD4 with RSA encryption 
 					case "1.2.840.113549.1.1.4":	// MD5 with RSA encryption 
 					case "1.2.840.113549.1.1.5":	// SHA-1 with RSA Encryption 
 					case "1.3.14.3.2.29":		// SHA1 with RSA signature
 					case "1.2.840.113549.1.1.11":	// SHA-256 with RSA Encryption
+					case "1.2.840.113549.1.1.12":	// SHA-384 with RSA Encryption
+					case "1.2.840.113549.1.1.13":	// SHA-512 with RSA Encryption
 						return (byte[]) signature.Clone ();
 
 					case "1.2.840.10040.4.3":	// SHA-1 with DSA
@@ -502,6 +519,11 @@ namespace Mono.Security.X509 {
 					// maybe someone installed MD2 ?
 					v.SetHashAlgorithm ("MD2");
 					break;
+				// MD4 with RSA encryption 
+				case "1.2.840.113549.1.1.3":
+					// maybe someone installed MD4 ?
+					v.SetHashAlgorithm ("MD4");
+					break;
 				// MD5 with RSA encryption 
 				case "1.2.840.113549.1.1.4":
 					v.SetHashAlgorithm ("MD5");
@@ -515,6 +537,14 @@ namespace Mono.Security.X509 {
 				case "1.2.840.113549.1.1.11":
 					v.SetHashAlgorithm ("SHA256");
 					break;
+				// SHA-384 with RSA Encryption 
+				case "1.2.840.113549.1.1.12":
+					v.SetHashAlgorithm ("SHA384");
+					break;
+				// SHA-512 with RSA Encryption 
+				case "1.2.840.113549.1.1.13":
+					v.SetHashAlgorithm ("SHA512");
+					break;
 				// SHA1-1 with DSA
 				case "1.2.840.10040.4.3":
 					// invalid but this can occurs when building a bad chain - e.g. missing certificate(s)

-- 
mono



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