From: Rolf Bjarne Kvinge Date: Tue, 15 Mar 2016 12:41:13 +0000 (+0100) Subject: [System] Add new 'Mono.Security.Interface.MonoTlsProviderFactory' callback to let... X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=mono.git;a=commitdiff_plain;h=8831ab4f6b50bd2120ac113fc81d374e1b4e7580 [System] Add new 'Mono.Security.Interface.MonoTlsProviderFactory' callback to let the framework libraries select the provider at runtime. List of original contributors: Martin Baulig --- diff --git a/mcs/class/System/Assembly/AssemblyInfoEx.cs b/mcs/class/System/Assembly/AssemblyInfoEx.cs new file mode 100644 index 00000000000..22e5bcae292 --- /dev/null +++ b/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")] diff --git a/mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.MonoTouch.opt.cs b/mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.MonoTouch.opt.cs deleted file mode 100644 index b8c5d6db3e1..00000000000 --- a/mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.MonoTouch.opt.cs +++ /dev/null @@ -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 diff --git a/mcs/class/System/Mono.Net.Security/MonoTlsProviderFactoryExt.cs b/mcs/class/System/Mono.Net.Security/MonoTlsProviderFactoryExt.cs new file mode 100644 index 00000000000..f9f939bb4d2 --- /dev/null +++ b/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; + } + } +} diff --git a/mcs/class/System/Mono.Security.Interface/MonoTlsProviderFactoryExt.cs b/mcs/class/System/Mono.Security.Interface/MonoTlsProviderFactoryExt.cs new file mode 100644 index 00000000000..e902c802d36 --- /dev/null +++ b/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; + } +} diff --git a/mcs/class/System/monotouch_System.dll.sources b/mcs/class/System/monotouch_System.dll.sources index 8dce31d234c..8f3de2eff5d 100644 --- a/mcs/class/System/monotouch_System.dll.sources +++ b/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 diff --git a/mcs/class/System/monotouch_opt_System.dll.sources b/mcs/class/System/monotouch_opt_System.dll.sources deleted file mode 100644 index 68774577148..00000000000 --- a/mcs/class/System/monotouch_opt_System.dll.sources +++ /dev/null @@ -1 +0,0 @@ -Mono.Net.Security/MonoTlsProviderFactory.MonoTouch.opt.cs diff --git a/mcs/class/System/monotouch_runtime_opt_System.dll.sources b/mcs/class/System/monotouch_runtime_opt_System.dll.sources deleted file mode 100644 index 54025c51efd..00000000000 --- a/mcs/class/System/monotouch_runtime_opt_System.dll.sources +++ /dev/null @@ -1 +0,0 @@ -#include monotouch_opt_System.dll.sources diff --git a/mcs/class/System/monotouch_tv_opt_System.dll.sources b/mcs/class/System/monotouch_tv_opt_System.dll.sources deleted file mode 100644 index 54025c51efd..00000000000 --- a/mcs/class/System/monotouch_tv_opt_System.dll.sources +++ /dev/null @@ -1 +0,0 @@ -#include monotouch_opt_System.dll.sources diff --git a/mcs/class/System/monotouch_tv_runtime_opt_System.dll.sources b/mcs/class/System/monotouch_tv_runtime_opt_System.dll.sources deleted file mode 100644 index 54025c51efd..00000000000 --- a/mcs/class/System/monotouch_tv_runtime_opt_System.dll.sources +++ /dev/null @@ -1 +0,0 @@ -#include monotouch_opt_System.dll.sources diff --git a/mcs/class/System/monotouch_watch_opt_System.dll.sources b/mcs/class/System/monotouch_watch_opt_System.dll.sources deleted file mode 100644 index 54025c51efd..00000000000 --- a/mcs/class/System/monotouch_watch_opt_System.dll.sources +++ /dev/null @@ -1 +0,0 @@ -#include monotouch_opt_System.dll.sources diff --git a/mcs/class/System/monotouch_watch_runtime_opt_System.dll.sources b/mcs/class/System/monotouch_watch_runtime_opt_System.dll.sources deleted file mode 100644 index 54025c51efd..00000000000 --- a/mcs/class/System/monotouch_watch_runtime_opt_System.dll.sources +++ /dev/null @@ -1 +0,0 @@ -#include monotouch_opt_System.dll.sources diff --git a/mcs/class/System/xammac_System.dll.sources b/mcs/class/System/xammac_System.dll.sources index 70a77a6dbff..330f5106870 100644 --- a/mcs/class/System/xammac_System.dll.sources +++ b/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 diff --git a/mcs/class/System/xammac_net_4_5_System.dll.sources b/mcs/class/System/xammac_net_4_5_System.dll.sources index 3ff0aad1cfb..7e48f7ecc9d 100644 --- a/mcs/class/System/xammac_net_4_5_System.dll.sources +++ b/mcs/class/System/xammac_net_4_5_System.dll.sources @@ -1 +1,2 @@ #include System.dll.sources +Assembly/AssemblyInfoEx.cs diff --git a/mcs/class/System/xammac_net_4_5_opt_System.dll.sources b/mcs/class/System/xammac_net_4_5_opt_System.dll.sources deleted file mode 100644 index 86ff246428c..00000000000 --- a/mcs/class/System/xammac_net_4_5_opt_System.dll.sources +++ /dev/null @@ -1 +0,0 @@ -#include xammac_opt_System.dll.sources diff --git a/mcs/class/System/xammac_opt_System.dll.sources b/mcs/class/System/xammac_opt_System.dll.sources deleted file mode 100644 index 68774577148..00000000000 --- a/mcs/class/System/xammac_opt_System.dll.sources +++ /dev/null @@ -1 +0,0 @@ -Mono.Net.Security/MonoTlsProviderFactory.MonoTouch.opt.cs