[System] Remove unused BTLS P/Invokes.
authorRolf Bjarne Kvinge <rolf@xamarin.com>
Fri, 28 Oct 2016 05:51:33 +0000 (07:51 +0200)
committerRolf Bjarne Kvinge <rolf@xamarin.com>
Fri, 28 Oct 2016 06:17:25 +0000 (08:17 +0200)
They point to internal functions that don't exist, causing compilation
problems for Xamarin.Mac apps.

Example test/compile failure: https://gist.github.com/rolfbjarne/43cf2228816bbe8a863f331da3e07c0d

mcs/class/System/Mono.Btls/MonoBtlsX509Lookup.cs
mcs/class/System/Mono.Btls/MonoBtlsX509NameList.cs [deleted file]
mcs/class/System/System-bare-net_4_x.csproj
mcs/class/System/System-net_4_x.csproj
mcs/class/System/System-secxml-net_4_x.csproj
mcs/class/System/System.dll.sources
mcs/class/System/mobile_System.dll.sources

index b2e863b085a0366ac5b43f8324aa8c41a919fba2..8a6bf30903dc24d7120aaa236f9afcf22ca11fb7 100644 (file)
@@ -64,10 +64,6 @@ namespace Mono.Btls
                [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_lookup_add_mono (IntPtr handle, IntPtr monoLookup);
 
-               [DllImport (BTLS_DYLIB)]
-               extern static void mono_btls_x509_lookup_method_mono_init (
-                       IntPtr handle, IntPtr instance, IntPtr by_subject_func);
-
                [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_lookup_init (IntPtr handle);
 
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsX509NameList.cs b/mcs/class/System/Mono.Btls/MonoBtlsX509NameList.cs
deleted file mode 100644 (file)
index 005ffd0..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-//
-// MonoBtlsX509NameList.cs
-//
-// Author:
-//       Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-#if SECURITY_DEP && MONO_FEATURE_BTLS
-using System;
-using System.IO;
-using System.Text;
-using System.Runtime.InteropServices;
-using System.Runtime.CompilerServices;
-
-namespace Mono.Btls
-{
-       class MonoBtlsX509NameList : MonoBtlsObject
-       {
-               internal class BoringX509NameListHandle : MonoBtlsHandle
-               {
-                       bool dontFree;
-
-                       internal BoringX509NameListHandle (IntPtr handle, bool ownsHandle)
-                               : base (handle, ownsHandle)
-                       {
-                               this.dontFree = !ownsHandle;
-                       }
-
-                       protected override bool ReleaseHandle ()
-                       {
-                               if (!dontFree)
-                                       mono_btls_x509_name_list_free (handle);
-                               return true;
-                       }
-               }
-
-               [DllImport (BTLS_DYLIB)]
-               extern static IntPtr mono_btls_x509_name_list_new ();
-
-               [DllImport (BTLS_DYLIB)]
-               extern static int mono_btls_x509_name_list_get_count (IntPtr handle);
-
-               [DllImport (BTLS_DYLIB)]
-               extern static int mono_btls_x509_name_list_add (IntPtr handle, IntPtr name);
-
-               [DllImport (BTLS_DYLIB)]
-               extern static IntPtr mono_btls_x509_name_list_get_item (IntPtr handle, int index);
-
-               [DllImport (BTLS_DYLIB)]
-               extern static void mono_btls_x509_name_list_free (IntPtr handle);
-
-               new internal BoringX509NameListHandle Handle {
-                       get { return (BoringX509NameListHandle)base.Handle; }
-               }
-
-               internal MonoBtlsX509NameList (BoringX509NameListHandle handle)
-                       : base (handle)
-               {
-               }
-
-               internal MonoBtlsX509NameList ()
-                       : this (Create_internal ())
-               {
-               }
-
-               static BoringX509NameListHandle Create_internal ()
-               {
-                       var handle = mono_btls_x509_name_list_new ();
-                       if (handle == IntPtr.Zero)
-                               throw new MonoBtlsException ();
-                       return new BoringX509NameListHandle (handle, true);
-               }
-
-               public int GetCount ()
-               {
-                       CheckThrow ();
-                       return mono_btls_x509_name_list_get_count (
-                               Handle.DangerousGetHandle ());
-               }
-
-               public MonoBtlsX509Name GetItem (int index)
-               {
-                       CheckThrow ();
-                       if (index < 0 || index >= GetCount ())
-                               throw new ArgumentOutOfRangeException ();
-                       var ptr = mono_btls_x509_name_list_get_item (
-                               Handle.DangerousGetHandle (), index);
-                       if (ptr == IntPtr.Zero)
-                               return null;
-                       return new MonoBtlsX509Name (
-                               new MonoBtlsX509Name.BoringX509NameHandle (ptr, true));
-               }
-
-               public void Add (MonoBtlsX509Name name)
-               {
-                       CheckThrow ();
-                       mono_btls_x509_name_list_add (
-                               Handle.DangerousGetHandle (),
-                               name.Handle.DangerousGetHandle ());
-               }
-       }
-}
-#endif
index 5979582c21dd72e6e5aa7e2eb199650288ae54ea..202a89c01be50b0925cf5efaa3cff81735ea8ada 100644 (file)
     <Compile Include="Mono.Btls\MonoBtlsX509LookupType.cs" />\r
     <Compile Include="Mono.Btls\MonoBtlsX509Name.cs" />\r
     <Compile Include="Mono.Btls\MonoBtlsX509NameEntryType.cs" />\r
-    <Compile Include="Mono.Btls\MonoBtlsX509NameList.cs" />\r
     <Compile Include="Mono.Btls\MonoBtlsX509Purpose.cs" />\r
     <Compile Include="Mono.Btls\MonoBtlsX509Revoked.cs" />\r
     <Compile Include="Mono.Btls\MonoBtlsX509Store.cs" />\r
index fa55d4fa95ccb1bb542fe4ee4d39c3c256493a99..382fa3b4a2a81cde0b90d0cb5657e12b3c4f0694 100644 (file)
     <Compile Include="Mono.Btls\MonoBtlsX509LookupType.cs" />\r
     <Compile Include="Mono.Btls\MonoBtlsX509Name.cs" />\r
     <Compile Include="Mono.Btls\MonoBtlsX509NameEntryType.cs" />\r
-    <Compile Include="Mono.Btls\MonoBtlsX509NameList.cs" />\r
     <Compile Include="Mono.Btls\MonoBtlsX509Purpose.cs" />\r
     <Compile Include="Mono.Btls\MonoBtlsX509Revoked.cs" />\r
     <Compile Include="Mono.Btls\MonoBtlsX509Store.cs" />\r
index fbb01b231b47026b59547d5b6b86734334446060..1b398a6e051afc92f159d19c5faaef84371f8917 100644 (file)
     <Compile Include="Mono.Btls\MonoBtlsX509LookupType.cs" />\r
     <Compile Include="Mono.Btls\MonoBtlsX509Name.cs" />\r
     <Compile Include="Mono.Btls\MonoBtlsX509NameEntryType.cs" />\r
-    <Compile Include="Mono.Btls\MonoBtlsX509NameList.cs" />\r
     <Compile Include="Mono.Btls\MonoBtlsX509Purpose.cs" />\r
     <Compile Include="Mono.Btls\MonoBtlsX509Revoked.cs" />\r
     <Compile Include="Mono.Btls\MonoBtlsX509Store.cs" />\r
index e1cabcf69ae5cddbf98a5542667b8eba0b381f83..a122ebe824475c6499e3930b1f623a92870942f3 100644 (file)
@@ -541,7 +541,6 @@ Mono.Btls/MonoBtlsX509LookupMonoCollection.cs
 Mono.Btls/MonoBtlsX509LookupMono.cs
 Mono.Btls/MonoBtlsX509LookupType.cs
 Mono.Btls/MonoBtlsX509Name.cs
-Mono.Btls/MonoBtlsX509NameList.cs
 Mono.Btls/MonoBtlsX509NameEntryType.cs
 Mono.Btls/MonoBtlsX509Purpose.cs
 Mono.Btls/MonoBtlsX509Revoked.cs
index 830e8c0db7ef2be804744d1a794e55acb39b20dd..ad9903a63e9f7d302384231f84f83e2389270669 100644 (file)
@@ -305,7 +305,6 @@ Mono.Btls/MonoBtlsX509LookupMonoCollection.cs
 Mono.Btls/MonoBtlsX509LookupMono.cs
 Mono.Btls/MonoBtlsX509LookupType.cs
 Mono.Btls/MonoBtlsX509Name.cs
-Mono.Btls/MonoBtlsX509NameList.cs
 Mono.Btls/MonoBtlsX509NameEntryType.cs
 Mono.Btls/MonoBtlsX509Purpose.cs
 Mono.Btls/MonoBtlsX509Revoked.cs