Re-apply compatibility fix from 42504b8af5a0bf7f012e6c40668659ca45fd4e22, it was...
authorAlexis Christoforides <alexis@thenull.net>
Thu, 14 Apr 2016 19:30:40 +0000 (15:30 -0400)
committerMarek Safar <marek.safar@gmail.com>
Tue, 3 May 2016 09:45:08 +0000 (11:45 +0200)
mcs/class/referencesource/mscorlib/system/security/cryptography/utils.cs

index 1c1c3e72f06c41027c6ebff084bf205ea8c0490e..e8a95fc3be9bc98430dde2f658a65709cca7a3da 100644 (file)
@@ -142,9 +142,17 @@ namespace System.Security.Cryptography
         {
         }
 
+#if MONO
+        // The default provider value must remain '1' for Mono, otherwise we won't be able
+        // to locate keypairs that were serialized by Mono versions 4.0 and lower.
+        // (The ProviderType property in the CspParameters class affects serialization)
+        internal const int DefaultRsaProviderType = 1;
+#else
         // Provider type to use by default for RSA operations. We want to use RSA-AES CSP
         // since it enables access to SHA-2 operations. All currently supported OSes support RSA-AES.
         internal const int DefaultRsaProviderType = Constants.PROV_RSA_AES;
+#endif
+
 #if !MONO
 #if FEATURE_CRYPTO || FEATURE_LEGACYNETCFCRYPTO
         // Private object for locking instead of locking on a public type for SQL reliability work.