[corlib] Add back X509 support for watchOS.
authorRolf Bjarne Kvinge <rolf@xamarin.com>
Thu, 23 Mar 2017 17:43:29 +0000 (18:43 +0100)
committerMarek Safar <marek.safar@gmail.com>
Tue, 28 Mar 2017 09:19:20 +0000 (11:19 +0200)
Otherwise we'd be regressing existing (and working) behavior.

mcs/build/profiles/monotouch_watch.make
mcs/build/profiles/monotouch_watch_runtime.make
mcs/class/corlib/CoreFoundation/CFHelpers.cs
mcs/class/corlib/Makefile
mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509CertificateImplApple.cs
mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Helper.Apple.cs
mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Helper.cs

index c221aa43c10e224ca7ef161e140f3172e23aa989..d78b268303e6ad2432576bb0fc66197bb2a337eb 100644 (file)
@@ -11,3 +11,4 @@ NO_PROCESS_START=1
 NO_MONO_SECURITY=1
 MONO_FEATURE_APPLETLS=
 ONLY_APPLETLS=
+MONO_FEATURE_APPLE_X509=1
index e1edd9999c5488d281bad465df9dcfb329504a31..75dc474e1eda3691c61d826e17d6b53f46b3796d 100644 (file)
@@ -12,3 +12,4 @@ NO_THREAD_SUSPEND_RESUME=1
 NO_MONO_SECURITY=1
 MONO_FEATURE_APPLETLS=
 ONLY_APPLETLS=
+MONO_FEATURE_APPLE_X509=1
index aa8356730c3f14431e7c54bfabf9c57605025634..6475f6f271acf51e328cff87ea062042f70a422f 100644 (file)
@@ -1,4 +1,4 @@
-#if MONO_FEATURE_APPLETLS
+#if MONO_FEATURE_APPLETLS || MONO_FEATURE_APPLE_X509
 using System;
 using System.Runtime.InteropServices;
 
index 0bc4d0693fd15d9c6c5921eec1672076579db399..ba8f3e4015ec7ea8b546a4e9e4c9a07616ef8f15 100644 (file)
@@ -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 =
index 63ed7a3371111b90bf3e0ce575ee8532f4208d83..3ffe8ee3f82ee700e05d89ab1af433806aee68a4 100644 (file)
@@ -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;
index 6c15bbb54f4788fb034f61d73be312b678227b80..410f94674443d0cc9118ba8c47d4101f55595c5e 100644 (file)
@@ -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;
index 05575d9d58c0f5632081f661ce5b7bb70f96bee6..4272f8d2e0bd6f09ad6eaabebd506c883bcab2c5 100644 (file)
@@ -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)