Merge branch 'upstream'

Former-commit-id: 1151404604e19d548c2320c41934815d862267d5
This commit is contained in:
Xamarin Public Jenkins (auto-signing) 2017-02-22 17:50:43 +00:00
commit 461cb7ff69
19 changed files with 42 additions and 26 deletions

View File

@ -207,16 +207,6 @@ namespace Mono.Btls
isAuthenticated = true; isAuthenticated = true;
} }
void SetupCertificateStore ()
{
MonoBtlsProvider.SetupCertificateStore (ctx.CertificateStore);
if (Settings != null && Settings.TrustAnchors != null) {
var trust = IsServer ? MonoBtlsX509TrustKind.TRUST_CLIENT : MonoBtlsX509TrustKind.TRUST_SERVER;
ctx.CertificateStore.AddCollection (Settings.TrustAnchors, trust);
}
}
void InitializeConnection () void InitializeConnection ()
{ {
ctx = new MonoBtlsSslCtx (); ctx = new MonoBtlsSslCtx ();
@ -226,7 +216,7 @@ namespace Mono.Btls
ctx.SetDebugBio (errbio); ctx.SetDebugBio (errbio);
#endif #endif
SetupCertificateStore (); MonoBtlsProvider.SetupCertificateStore (ctx.CertificateStore, Settings, IsServer);
if (!IsServer || AskForClientCertificate) if (!IsServer || AskForClientCertificate)
ctx.SetVerifyCallback (VerifyCallback, false); ctx.SetVerifyCallback (VerifyCallback, false);

View File

@ -150,7 +150,7 @@ namespace Mono.Btls
using (var nativeChain = MonoBtlsProvider.GetNativeChain (certificates)) using (var nativeChain = MonoBtlsProvider.GetNativeChain (certificates))
using (var param = GetVerifyParam (targetHost, serverMode)) using (var param = GetVerifyParam (targetHost, serverMode))
using (var storeCtx = new MonoBtlsX509StoreCtx ()) { using (var storeCtx = new MonoBtlsX509StoreCtx ()) {
SetupCertificateStore (store); SetupCertificateStore (store, validator.Settings, serverMode);
storeCtx.Initialize (store, nativeChain); storeCtx.Initialize (store, nativeChain);
@ -201,19 +201,45 @@ namespace Mono.Btls
} }
} }
internal static void SetupCertificateStore (MonoBtlsX509Store store, MonoTlsSettings settings, bool server)
{
AddTrustedRoots (store, settings, server);
SetupCertificateStore (store);
}
internal static void SetupCertificateStore (MonoBtlsX509Store store) internal static void SetupCertificateStore (MonoBtlsX509Store store)
{ {
#if MONODROID #if MONODROID
store.SetDefaultPaths (); store.SetDefaultPaths ();
store.AddAndroidLookup (); store.AddAndroidLookup ();
#else #else
AddUserStore (store);
AddMachineStore (store);
#endif
}
#if !MONODROID
static void AddUserStore (MonoBtlsX509Store store)
{
var userPath = MonoBtlsX509StoreManager.GetStorePath (MonoBtlsX509StoreType.UserTrustedRoots); var userPath = MonoBtlsX509StoreManager.GetStorePath (MonoBtlsX509StoreType.UserTrustedRoots);
if (Directory.Exists (userPath)) if (Directory.Exists (userPath))
store.AddDirectoryLookup (userPath, MonoBtlsX509FileType.PEM); store.AddDirectoryLookup (userPath, MonoBtlsX509FileType.PEM);
}
static void AddMachineStore (MonoBtlsX509Store store)
{
var machinePath = MonoBtlsX509StoreManager.GetStorePath (MonoBtlsX509StoreType.MachineTrustedRoots); var machinePath = MonoBtlsX509StoreManager.GetStorePath (MonoBtlsX509StoreType.MachineTrustedRoots);
if (Directory.Exists (machinePath)) if (Directory.Exists (machinePath))
store.AddDirectoryLookup (machinePath, MonoBtlsX509FileType.PEM); store.AddDirectoryLookup (machinePath, MonoBtlsX509FileType.PEM);
}
#endif #endif
static void AddTrustedRoots (MonoBtlsX509Store store, MonoTlsSettings settings, bool server)
{
if (settings?.TrustAnchors == null)
return;
var trust = server ? MonoBtlsX509TrustKind.TRUST_CLIENT : MonoBtlsX509TrustKind.TRUST_SERVER;
store.AddCollection (settings.TrustAnchors, trust);
} }
public static string GetSystemStoreLocation () public static string GetSystemStoreLocation ()

View File

@ -159,8 +159,7 @@ namespace Mono.Btls
internal void AddTrustedRoots () internal void AddTrustedRoots ()
{ {
var systemRoot = MonoBtlsProvider.GetSystemStoreLocation (); MonoBtlsProvider.SetupCertificateStore (this);
LoadLocations (null, systemRoot);
} }
public MonoBtlsX509Lookup AddLookup (MonoBtlsX509LookupType type) public MonoBtlsX509Lookup AddLookup (MonoBtlsX509LookupType type)

View File

@ -1 +1 @@
5e769f86c6e601eeed6a547e159a1e065ec48f06 dd943c55962ea9b83f4ea03f975d288bc9cef06b

View File

@ -861,7 +861,7 @@ EXTRA_DIST = TestDriver.cs \
Makefile.am.in Makefile.am.in
version.h: Makefile version.h: Makefile
echo "#define FULL_VERSION \"Stable 4.8.0.489/9ac5bf2\"" > version.h echo "#define FULL_VERSION \"Stable 4.8.0.495/e4a3cf3\"" > version.h
# Utility target for patching libtool to speed up linking # Utility target for patching libtool to speed up linking
patch-libtool: patch-libtool:

View File

@ -861,7 +861,7 @@ EXTRA_DIST = TestDriver.cs \
Makefile.am.in Makefile.am.in
version.h: Makefile version.h: Makefile
echo "#define FULL_VERSION \"Stable 4.8.0.489/9ac5bf2\"" > version.h echo "#define FULL_VERSION \"Stable 4.8.0.495/e4a3cf3\"" > version.h
# Utility target for patching libtool to speed up linking # Utility target for patching libtool to speed up linking
patch-libtool: patch-libtool:

View File

@ -1 +1 @@
d78d3160cb95346fa22eb7f257a9e51030af6b97 1d2d50a79752da03d88b373dcfa4536e767c289d

View File

@ -1 +1 @@
8f2ef218cc4e9047676a88b73fef6c609e45b6fd 1b752cd4d3afff4c3c4fa86f3c53cad92fa6ca37

View File

@ -1 +1 @@
#define FULL_VERSION "Stable 4.8.0.489/9ac5bf2" #define FULL_VERSION "Stable 4.8.0.495/e4a3cf3"

View File

@ -379,7 +379,8 @@ mono_threads_platform_set_priority (MonoThreadInfo *info, MonoThreadPriority pri
param.sched_priority = 0; param.sched_priority = 0;
break; break;
default: default:
g_error ("%s: unknown policy %d", __func__, policy); g_warning ("%s: unknown policy %d", __func__, policy);
return;
} }
} }

Binary file not shown.

View File

@ -1 +1 @@
da2fd49923155b32b5bca18fb07cf7c7e320a8dc 24891e68bb877147f45264905411a3d29b9697a2

Binary file not shown.

View File

@ -1 +1 @@
e4a9bbec1f2d716b4b646529ce5394539d5aaf92 9a0004e54942d65f96b8db4923ab25ae00b98111

Binary file not shown.

View File

@ -1 +1 @@
6b60ac7183d65ee9d7f074c8a23f3799d762e2b6 23ce3caec9ef14b46dd2699cb25dc0b6ba1e24b2

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: mono 4.8.0\n" "Project-Id-Version: mono 4.8.0\n"
"Report-Msgid-Bugs-To: http://www.mono-project.com/Bugs\n" "Report-Msgid-Bugs-To: http://www.mono-project.com/Bugs\n"
"POT-Creation-Date: 2017-02-15 09:35+0000\n" "POT-Creation-Date: 2017-02-22 17:10+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"

Binary file not shown.

View File

@ -1 +1 @@
593851f8ddc8ae23de4aecfe19261ca7f69713f9 d89d14404907c8feee684d37888501a226d846e8