Imported Upstream version 5.18.0.161

Former-commit-id: 4db48158d3a35497b8f118ab21b5f08ac3d86d98
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-10-19 08:34:24 +00:00
parent 37fbf886a3
commit e19d552987
28702 changed files with 3868076 additions and 803 deletions

View File

@@ -33,7 +33,6 @@ using System.Runtime.InteropServices;
using System.Security.Cryptography.Apple;
using System.Security.Cryptography.X509Certificates;
using Microsoft.Win32.SafeHandles;
using Mono.Net;
namespace Mono.AppleTls
{
@@ -56,7 +55,7 @@ namespace Mono.AppleTls
if (Interlocked.CompareExchange (ref initialized, 1, 0) != 0)
return;
var handle = CFObject.dlopen (AppleTlsContext.SecurityLibrary, 0);
var handle = CFObject.dlopen (SecurityLibrary, 0);
if (handle == IntPtr.Zero)
return;
@@ -93,7 +92,7 @@ namespace Mono.AppleTls
}
}
[DllImport (AppleTlsContext.SecurityLibrary)]
[DllImport (SecurityLibrary)]
extern static SecStatusCode SecPKCS12Import (IntPtr pkcs12_data, IntPtr options, out IntPtr items);
static SecStatusCode ImportPkcs12 (byte[] buffer, CFDictionary options, out CFDictionary[] array)
@@ -134,7 +133,7 @@ namespace Mono.AppleTls
return identity ?? new SafeSecIdentityHandle ();
}
[DllImport (AppleTlsContext.SecurityLibrary)]
[DllImport (SecurityLibrary)]
extern static SecStatusCode SecItemCopyMatching (/* CFDictionaryRef */ IntPtr query, /* CFTypeRef* */ out IntPtr result);
public static SafeSecIdentityHandle FindIdentity (SafeSecCertificateHandle certificate, bool throwOnError = false)

View File

@@ -33,13 +33,14 @@ using System.Runtime.InteropServices;
using System.Security.Cryptography.Apple;
using System.Security.Cryptography.X509Certificates;
using Microsoft.Win32.SafeHandles;
using Mono.Net;
namespace Mono.AppleTls
{
static partial class MonoCertificatePal
{
[DllImport (AppleTlsContext.SecurityLibrary)]
const string SecurityLibrary = OSX509Certificates.SecurityLibrary;
[DllImport (SecurityLibrary)]
extern static IntPtr SecCertificateCreateWithData (IntPtr allocator, IntPtr cfData);
public static SafeSecCertificateHandle FromOtherCertificate (X509Certificate certificate)
@@ -66,7 +67,7 @@ namespace Mono.AppleTls
}
}
[DllImport (AppleTlsContext.SecurityLibrary)]
[DllImport (SecurityLibrary)]
extern static IntPtr SecIdentityGetTypeID ();
public static bool IsSecIdentity (IntPtr ptr)
@@ -76,7 +77,7 @@ namespace Mono.AppleTls
return CFType.GetTypeID (ptr) == SecIdentityGetTypeID ();
}
[DllImport (AppleTlsContext.SecurityLibrary)]
[DllImport (SecurityLibrary)]
public extern static IntPtr SecKeyGetTypeID ();
public static bool IsSecKey (IntPtr ptr)
@@ -86,7 +87,7 @@ namespace Mono.AppleTls
return CFType.GetTypeID (ptr) == SecKeyGetTypeID ();
}
[DllImport (AppleTlsContext.SecurityLibrary)]
[DllImport (SecurityLibrary)]
extern static /* OSStatus */ SecStatusCode SecIdentityCopyCertificate (/* SecIdentityRef */ IntPtr identityRef, /* SecCertificateRef* */ out IntPtr certificateRef);
public static SafeSecCertificateHandle GetCertificate (SafeSecIdentityHandle identity)
@@ -99,7 +100,7 @@ namespace Mono.AppleTls
return new SafeSecCertificateHandle (cert, true);
}
[DllImport (AppleTlsContext.SecurityLibrary)]
[DllImport (SecurityLibrary)]
extern static IntPtr SecCertificateCopySubjectSummary (IntPtr cert);
public static string GetSubjectSummary (SafeSecCertificateHandle certificate)
@@ -117,7 +118,7 @@ namespace Mono.AppleTls
}
}
[DllImport (AppleTlsContext.SecurityLibrary)]
[DllImport (SecurityLibrary)]
extern static /* CFDataRef */ IntPtr SecCertificateCopyData (/* SecCertificateRef */ IntPtr cert);
public static byte[] GetRawData (SafeSecCertificateHandle certificate)

View File

@@ -26,7 +26,7 @@
using System.Runtime.InteropServices;
using System.Security.Cryptography.Apple;
using Microsoft.Win32.SafeHandles;
using Mono.Net;
using Mono;
namespace System.Security.Cryptography.X509Certificates
{

View File

@@ -26,7 +26,7 @@
using System.Runtime.InteropServices;
using System.Security.Cryptography.Apple;
using Microsoft.Win32.SafeHandles;
using Mono.Net;
using Mono;
namespace System.Security.Cryptography.X509Certificates
{