Procházet zdrojové kódy

[System] Add new 'Mono.Security.Interface.MonoTlsProviderFactory' callback to let the framework libraries select the provider at runtime.

List of original contributors:

Martin Baulig <[email protected]>
Rolf Bjarne Kvinge před 9 roky
rodič
revize
8831ab4f6b

+ 7 - 0
mcs/class/System/Assembly/AssemblyInfoEx.cs

@@ -0,0 +1,7 @@
+using System.Runtime.CompilerServices;
+
+[assembly: InternalsVisibleTo ("monotouch, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
+[assembly: InternalsVisibleTo ("Xamarin.iOS, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
+[assembly: InternalsVisibleTo ("Xamarin.Mac, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
+[assembly: InternalsVisibleTo ("Xamarin.WatchOS, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
+[assembly: InternalsVisibleTo ("Xamarin.TVOS, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]

+ 0 - 15
mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.MonoTouch.opt.cs

@@ -1,15 +0,0 @@
-#if MONOTOUCH || XAMMAC
-
-// this file is a shim to enable compiling monotouch profiles without mono-extensions
-namespace Mono.Net.Security
-{
-	static partial class MonoTlsProviderFactory
-	{
-		static IMonoTlsProvider CreateDefaultProvider ()
-		{
-			throw new System.NotSupportedException ();
-		}
-	}
-}
-
-#endif

+ 22 - 0
mcs/class/System/Mono.Net.Security/MonoTlsProviderFactoryExt.cs

@@ -0,0 +1,22 @@
+// Copyright 2015 Xamarin Inc. All rights reserved.
+
+using System;
+using MSI = Mono.Security.Interface;
+
+namespace Mono.Net.Security
+{
+	static partial class MonoTlsProviderFactory
+	{
+		static IMonoTlsProvider CreateDefaultProvider ()
+		{
+			#if SECURITY_DEP
+			MSI.MonoTlsProvider provider = null;
+			if (MSI.MonoTlsProviderFactory._PrivateFactoryDelegate != null)
+				provider = MSI.MonoTlsProviderFactory._PrivateFactoryDelegate ();
+			if (provider != null)
+				return new Private.MonoTlsProviderWrapper (provider);
+			#endif
+			return null;
+		}
+	}
+}

+ 9 - 0
mcs/class/System/Mono.Security.Interface/MonoTlsProviderFactoryExt.cs

@@ -0,0 +1,9 @@
+namespace Mono.Security.Interface
+{
+	public delegate MonoTlsProvider MonoTlsProviderFactoryDelegate ();
+
+	static partial class MonoTlsProviderFactory
+	{
+		public static MonoTlsProviderFactoryDelegate _PrivateFactoryDelegate;
+	}
+}

+ 3 - 0
mcs/class/System/monotouch_System.dll.sources

@@ -1,2 +1,5 @@
 #include mobile_System.dll.sources
 MonoTouch/MonoPInvokeCallbackAttribute.cs
+Assembly/AssemblyInfoEx.cs
+Mono.Net.Security/MonoTlsProviderFactoryExt.cs
+Mono.Security.Interface/MonoTlsProviderFactoryExt.cs

+ 0 - 1
mcs/class/System/monotouch_opt_System.dll.sources

@@ -1 +0,0 @@
-Mono.Net.Security/MonoTlsProviderFactory.MonoTouch.opt.cs

+ 0 - 1
mcs/class/System/monotouch_runtime_opt_System.dll.sources

@@ -1 +0,0 @@
-#include monotouch_opt_System.dll.sources

+ 0 - 1
mcs/class/System/monotouch_tv_opt_System.dll.sources

@@ -1 +0,0 @@
-#include monotouch_opt_System.dll.sources

+ 0 - 1
mcs/class/System/monotouch_tv_runtime_opt_System.dll.sources

@@ -1 +0,0 @@
-#include monotouch_opt_System.dll.sources

+ 0 - 1
mcs/class/System/monotouch_watch_opt_System.dll.sources

@@ -1 +0,0 @@
-#include monotouch_opt_System.dll.sources

+ 0 - 1
mcs/class/System/monotouch_watch_runtime_opt_System.dll.sources

@@ -1 +0,0 @@
-#include monotouch_opt_System.dll.sources

+ 3 - 0
mcs/class/System/xammac_System.dll.sources

@@ -1 +1,4 @@
 #include mobile_System.dll.sources
+Assembly/AssemblyInfoEx.cs
+Mono.Net.Security/MonoTlsProviderFactoryExt.cs
+Mono.Security.Interface/MonoTlsProviderFactoryExt.cs

+ 1 - 0
mcs/class/System/xammac_net_4_5_System.dll.sources

@@ -1 +1,2 @@
 #include System.dll.sources
+Assembly/AssemblyInfoEx.cs

+ 0 - 1
mcs/class/System/xammac_net_4_5_opt_System.dll.sources

@@ -1 +0,0 @@
-#include xammac_opt_System.dll.sources

+ 0 - 1
mcs/class/System/xammac_opt_System.dll.sources

@@ -1 +0,0 @@
-Mono.Net.Security/MonoTlsProviderFactory.MonoTouch.opt.cs