From 7e24a650a83ea4d05906d8f8d8badc37925cd86b Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 23 Mar 2017 18:43:29 +0100 Subject: [PATCH] [corlib] Add back X509 support for watchOS. Otherwise we'd be regressing existing (and working) behavior. --- mcs/build/profiles/monotouch_watch.make | 1 + mcs/build/profiles/monotouch_watch_runtime.make | 1 + mcs/class/corlib/CoreFoundation/CFHelpers.cs | 2 +- mcs/class/corlib/Makefile | 4 ++++ .../X509CertificateImplApple.cs | 2 +- .../X509Helper.Apple.cs | 2 +- .../X509Helper.cs | 8 ++------ 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/mcs/build/profiles/monotouch_watch.make b/mcs/build/profiles/monotouch_watch.make index c221aa43c10..d78b268303e 100644 --- a/mcs/build/profiles/monotouch_watch.make +++ b/mcs/build/profiles/monotouch_watch.make @@ -11,3 +11,4 @@ NO_PROCESS_START=1 NO_MONO_SECURITY=1 MONO_FEATURE_APPLETLS= ONLY_APPLETLS= +MONO_FEATURE_APPLE_X509=1 diff --git a/mcs/build/profiles/monotouch_watch_runtime.make b/mcs/build/profiles/monotouch_watch_runtime.make index e1edd9999c5..75dc474e1ed 100644 --- a/mcs/build/profiles/monotouch_watch_runtime.make +++ b/mcs/build/profiles/monotouch_watch_runtime.make @@ -12,3 +12,4 @@ NO_THREAD_SUSPEND_RESUME=1 NO_MONO_SECURITY=1 MONO_FEATURE_APPLETLS= ONLY_APPLETLS= +MONO_FEATURE_APPLE_X509=1 diff --git a/mcs/class/corlib/CoreFoundation/CFHelpers.cs b/mcs/class/corlib/CoreFoundation/CFHelpers.cs index aa8356730c3..6475f6f271a 100644 --- a/mcs/class/corlib/CoreFoundation/CFHelpers.cs +++ b/mcs/class/corlib/CoreFoundation/CFHelpers.cs @@ -1,4 +1,4 @@ -#if MONO_FEATURE_APPLETLS +#if MONO_FEATURE_APPLETLS || MONO_FEATURE_APPLE_X509 using System; using System.Runtime.InteropServices; diff --git a/mcs/class/corlib/Makefile b/mcs/class/corlib/Makefile index 0bc4d0693fd..ba8f3e4015e 100644 --- a/mcs/class/corlib/Makefile +++ b/mcs/class/corlib/Makefile @@ -80,6 +80,10 @@ ifdef ONLY_APPLETLS LIB_MCS_FLAGS += -d:ONLY_APPLETLS endif +ifdef MONO_FEATURE_APPLE_X509 +LIB_MCS_FLAGS += -d:MONO_FEATURE_APPLE_X509 +endif + WARNING_ABOUT_DISABLED_WARNING=1635 LOCAL_MCS_FLAGS = -unsafe -nostdlib -nowarn:612,618,$(WARNING_ABOUT_DISABLED_WARNING) -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC $(REFERENCE_SOURCES_FLAGS) DEFAULT_REFERENCES = diff --git a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509CertificateImplApple.cs b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509CertificateImplApple.cs index 63ed7a33711..3ffe8ee3f82 100644 --- a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509CertificateImplApple.cs +++ b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509CertificateImplApple.cs @@ -1,4 +1,4 @@ -#if MONO_FEATURE_APPLETLS +#if MONO_FEATURE_APPLETLS || MONO_FEATURE_APPLE_X509 using System; using System.Text; using System.Runtime.InteropServices; diff --git a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Helper.Apple.cs b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Helper.Apple.cs index 6c15bbb54f4..410f9467444 100644 --- a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Helper.Apple.cs +++ b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Helper.Apple.cs @@ -1,4 +1,4 @@ -#if MONO_FEATURE_APPLETLS +#if MONO_FEATURE_APPLETLS || MONO_FEATURE_APPLE_X509 using System; using System.Runtime.InteropServices; using MX = Mono.Security.X509; diff --git a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Helper.cs b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Helper.cs index 05575d9d58c..4272f8d2e0b 100644 --- a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Helper.cs +++ b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Helper.cs @@ -65,10 +65,8 @@ namespace System.Security.Cryptography.X509Certificates public static X509CertificateImpl InitFromHandle (IntPtr handle) { -#if MONO_FEATURE_APPLETLS && ONLY_APPLETLS // ONLY_APPLETLS should not support any other option +#if (MONO_FEATURE_APPLETLS && ONLY_APPLETLS) || MONO_FEATURE_APPLE_X509 // ONLY_APPLETLS should not support any other option return InitFromHandleApple (handle); -#elif MONOTOUCH_WATCH - throw new PlatformNotSupportedException (); #else #if MONO_FEATURE_APPLETLS // If we support AppleTls, which is the default, and not overriding to legacy @@ -85,10 +83,8 @@ namespace System.Security.Cryptography.X509Certificates static X509CertificateImpl Import (byte[] rawData) { -#if MONO_FEATURE_APPLETLS && ONLY_APPLETLS // ONLY_APPLETLS should not support any other option +#if (MONO_FEATURE_APPLETLS && ONLY_APPLETLS) || MONO_FEATURE_APPLE_X509 // ONLY_APPLETLS should not support any other option return ImportApple (rawData); -#elif MONOTOUCH_WATCH - throw new PlatformNotSupportedException (); #else #if MONO_FEATURE_APPLETLS if (ShouldUseAppleTls) -- 2.25.1