From a5366237dee1cad676d865e6224f2e958c2cbe3d Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 28 Oct 2016 07:51:33 +0200 Subject: [PATCH] [System] Remove unused BTLS P/Invokes. 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 --- .../System/Mono.Btls/MonoBtlsX509Lookup.cs | 4 - .../System/Mono.Btls/MonoBtlsX509NameList.cs | 121 ------------------ mcs/class/System/System-bare-net_4_x.csproj | 1 - mcs/class/System/System-net_4_x.csproj | 1 - mcs/class/System/System-secxml-net_4_x.csproj | 1 - mcs/class/System/System.dll.sources | 1 - mcs/class/System/mobile_System.dll.sources | 1 - 7 files changed, 130 deletions(-) delete mode 100644 mcs/class/System/Mono.Btls/MonoBtlsX509NameList.cs diff --git a/mcs/class/System/Mono.Btls/MonoBtlsX509Lookup.cs b/mcs/class/System/Mono.Btls/MonoBtlsX509Lookup.cs index b2e863b085a..8a6bf30903d 100644 --- a/mcs/class/System/Mono.Btls/MonoBtlsX509Lookup.cs +++ b/mcs/class/System/Mono.Btls/MonoBtlsX509Lookup.cs @@ -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 index 005ffd03eab..00000000000 --- a/mcs/class/System/Mono.Btls/MonoBtlsX509NameList.cs +++ /dev/null @@ -1,121 +0,0 @@ -// -// MonoBtlsX509NameList.cs -// -// Author: -// Martin Baulig -// -// 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 diff --git a/mcs/class/System/System-bare-net_4_x.csproj b/mcs/class/System/System-bare-net_4_x.csproj index 5979582c21d..202a89c01be 100644 --- a/mcs/class/System/System-bare-net_4_x.csproj +++ b/mcs/class/System/System-bare-net_4_x.csproj @@ -776,7 +776,6 @@ - diff --git a/mcs/class/System/System-net_4_x.csproj b/mcs/class/System/System-net_4_x.csproj index fa55d4fa95c..382fa3b4a2a 100644 --- a/mcs/class/System/System-net_4_x.csproj +++ b/mcs/class/System/System-net_4_x.csproj @@ -776,7 +776,6 @@ - diff --git a/mcs/class/System/System-secxml-net_4_x.csproj b/mcs/class/System/System-secxml-net_4_x.csproj index fbb01b231b4..1b398a6e051 100644 --- a/mcs/class/System/System-secxml-net_4_x.csproj +++ b/mcs/class/System/System-secxml-net_4_x.csproj @@ -776,7 +776,6 @@ - diff --git a/mcs/class/System/System.dll.sources b/mcs/class/System/System.dll.sources index e1cabcf69ae..a122ebe8244 100644 --- a/mcs/class/System/System.dll.sources +++ b/mcs/class/System/System.dll.sources @@ -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 diff --git a/mcs/class/System/mobile_System.dll.sources b/mcs/class/System/mobile_System.dll.sources index 830e8c0db7e..ad9903a63e9 100644 --- a/mcs/class/System/mobile_System.dll.sources +++ b/mcs/class/System/mobile_System.dll.sources @@ -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 -- 2.25.1