You've already forked linux-packaging-mono
Imported Upstream version 5.2.0.175
Former-commit-id: bb0468d0f257ff100aa895eb5fe583fb5dfbf900
This commit is contained in:
parent
4bdbaf4a88
commit
966bba02bb
@@ -30,10 +30,6 @@ using System.Text;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
#if MONOTOUCH
|
||||
using MonoTouch;
|
||||
#endif
|
||||
|
||||
namespace Mono.Btls
|
||||
{
|
||||
class MonoBtlsBio : MonoBtlsObject
|
||||
@@ -308,9 +304,7 @@ namespace Mono.Btls
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if MONOTOUCH
|
||||
[MonoPInvokeCallback (typeof (BioReadFunc))]
|
||||
#endif
|
||||
[Mono.Util.MonoPInvokeCallback (typeof (BioReadFunc))]
|
||||
static int OnRead (IntPtr instance, IntPtr data, int dataLength, out int wantMore)
|
||||
{
|
||||
var c = (MonoBtlsBioMono)GCHandle.FromIntPtr (instance).Target;
|
||||
@@ -331,9 +325,7 @@ namespace Mono.Btls
|
||||
return ok ? dataLength : -1;
|
||||
}
|
||||
|
||||
#if MONOTOUCH
|
||||
[MonoPInvokeCallback (typeof (BioWriteFunc))]
|
||||
#endif
|
||||
[Mono.Util.MonoPInvokeCallback (typeof (BioWriteFunc))]
|
||||
static int OnWrite (IntPtr instance, IntPtr data, int dataLength)
|
||||
{
|
||||
var c = (MonoBtlsBioMono)GCHandle.FromIntPtr (instance).Target;
|
||||
@@ -345,9 +337,7 @@ namespace Mono.Btls
|
||||
}
|
||||
}
|
||||
|
||||
#if MONOTOUCH
|
||||
[MonoPInvokeCallback (typeof (BioControlFunc))]
|
||||
#endif
|
||||
[Mono.Util.MonoPInvokeCallback (typeof (BioControlFunc))]
|
||||
static long Control (IntPtr instance, ControlCommand command, long arg)
|
||||
{
|
||||
var c = (MonoBtlsBioMono)GCHandle.FromIntPtr (instance).Target;
|
||||
|
||||
@@ -203,8 +203,43 @@ namespace Mono.Btls
|
||||
|
||||
internal static void SetupCertificateStore (MonoBtlsX509Store store, MonoTlsSettings settings, bool server)
|
||||
{
|
||||
AddTrustedRoots (store, settings, server);
|
||||
if (settings?.CertificateSearchPaths == null)
|
||||
AddTrustedRoots (store, settings, server);
|
||||
|
||||
#if MONODROID
|
||||
SetupCertificateStore (store);
|
||||
return;
|
||||
#else
|
||||
if (settings?.CertificateSearchPaths == null) {
|
||||
SetupCertificateStore (store);
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var path in settings.CertificateSearchPaths) {
|
||||
if (string.Equals (path, "@default", StringComparison.Ordinal)) {
|
||||
AddTrustedRoots (store, settings, server);
|
||||
AddUserStore (store);
|
||||
AddMachineStore (store);
|
||||
} else if (string.Equals (path, "@user", StringComparison.Ordinal))
|
||||
AddUserStore (store);
|
||||
else if (string.Equals (path, "@machine", StringComparison.Ordinal))
|
||||
AddMachineStore (store);
|
||||
else if (string.Equals (path, "@trusted", StringComparison.Ordinal))
|
||||
AddTrustedRoots (store, settings, server);
|
||||
else if (path.StartsWith ("@pem:", StringComparison.Ordinal)) {
|
||||
var realPath = path.Substring (5);
|
||||
if (Directory.Exists (realPath))
|
||||
store.AddDirectoryLookup (realPath, MonoBtlsX509FileType.PEM);
|
||||
} else if (path.StartsWith ("@der:", StringComparison.Ordinal)) {
|
||||
var realPath = path.Substring (5);
|
||||
if (Directory.Exists (realPath))
|
||||
store.AddDirectoryLookup (realPath, MonoBtlsX509FileType.ASN1);
|
||||
} else {
|
||||
if (Directory.Exists (path))
|
||||
store.AddDirectoryLookup (path, MonoBtlsX509FileType.PEM);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
internal static void SetupCertificateStore (MonoBtlsX509Store store)
|
||||
|
||||
@@ -30,10 +30,6 @@ using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
#if MONOTOUCH
|
||||
using MonoTouch;
|
||||
#endif
|
||||
|
||||
namespace Mono.Btls
|
||||
{
|
||||
delegate int MonoBtlsVerifyCallback (MonoBtlsX509StoreCtx ctx);
|
||||
@@ -250,9 +246,7 @@ namespace Mono.Btls
|
||||
|
||||
delegate int PrintErrorsCallbackFunc (IntPtr str, IntPtr len, IntPtr ctx);
|
||||
|
||||
#if MONOTOUCH
|
||||
[MonoPInvokeCallback (typeof (PrintErrorsCallbackFunc))]
|
||||
#endif
|
||||
[Mono.Util.MonoPInvokeCallback (typeof (PrintErrorsCallbackFunc))]
|
||||
static int PrintErrorsCallback (IntPtr str, IntPtr len, IntPtr ctx)
|
||||
{
|
||||
var sb = (StringBuilder)GCHandle.FromIntPtr (ctx).Target;
|
||||
|
||||
@@ -28,10 +28,6 @@ using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
#if MONOTOUCH
|
||||
using MonoTouch;
|
||||
#endif
|
||||
|
||||
namespace Mono.Btls
|
||||
{
|
||||
class MonoBtlsSslCtx : MonoBtlsObject
|
||||
@@ -141,9 +137,7 @@ namespace Mono.Btls
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if MONOTOUCH
|
||||
[MonoPInvokeCallback (typeof (NativeVerifyFunc))]
|
||||
#endif
|
||||
[Mono.Util.MonoPInvokeCallback (typeof (NativeVerifyFunc))]
|
||||
static int NativeVerifyCallback (IntPtr instance, int preverify_ok, IntPtr store_ctx)
|
||||
{
|
||||
var c = (MonoBtlsSslCtx)GCHandle.FromIntPtr (instance).Target;
|
||||
@@ -164,9 +158,7 @@ namespace Mono.Btls
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if MONOTOUCH
|
||||
[MonoPInvokeCallback (typeof (NativeSelectFunc))]
|
||||
#endif
|
||||
[Mono.Util.MonoPInvokeCallback (typeof (NativeSelectFunc))]
|
||||
static int NativeSelectCallback (IntPtr instance)
|
||||
{
|
||||
var c = (MonoBtlsSslCtx)GCHandle.FromIntPtr (instance).Target;
|
||||
|
||||
@@ -93,9 +93,7 @@ namespace Mono.Btls
|
||||
|
||||
protected abstract MonoBtlsX509 OnGetBySubject (MonoBtlsX509Name name);
|
||||
|
||||
#if MONOTOUCH
|
||||
[MonoTouch.MonoPInvokeCallback (typeof (BySubjectFunc))]
|
||||
#endif
|
||||
[Mono.Util.MonoPInvokeCallback (typeof (BySubjectFunc))]
|
||||
static int OnGetBySubject (IntPtr instance, IntPtr name_ptr, out IntPtr x509_ptr)
|
||||
{
|
||||
try {
|
||||
|
||||
@@ -68,7 +68,6 @@ namespace Mono.Btls
|
||||
|
||||
protected override MonoBtlsX509 OnGetBySubject (MonoBtlsX509Name name)
|
||||
{
|
||||
Console.WriteLine ("COLLECTION LOOKUP: {0:x} - {1}", name.GetHash (), name.GetString ());
|
||||
Initialize ();
|
||||
|
||||
var hash = name.GetHash ();
|
||||
|
||||
Reference in New Issue
Block a user