Merge branch 'upstream'

Former-commit-id: e502d3fc8e45051f2c29ec095aaa0d2957f1ac78
This commit is contained in:
Xamarin Public Jenkins (auto-signing) 2018-09-05 08:34:36 +00:00
commit 495f60b414
53 changed files with 201 additions and 108 deletions

View File

@ -1 +1 @@
d6e02f659617784f5dc88b30fcd809e5b88e0941
6a4b68ccb5c3097357e1a2d56cd89ebd9d38a301

View File

@ -1 +1 @@
4ba07eb03127098c4d335226ef0efc214a051b0c
600b9ac309a3b7f10e3d02596d7da316f96dd787

View File

@ -1 +1 @@
ad3837793c1a54bb1919f1b8685ba5e3c39c301b
3e5fbe0a8e9832a6c1fa10e9e6fcb9b7760767d7

View File

@ -1 +1 @@
24297e223be1a2ddc160f0b3bdaf01a0b73f3739
0e5ebabffda13f7e89b4933bf05bcaf7e5d7cdc3

View File

@ -1 +1 @@
6181969e24280652542eb81a3986d47fe16200f0
9bca9460d6b9cd74dd3d146987c845648fdb7094

View File

@ -34,7 +34,7 @@ static class Consts
// Use these assembly version constants to make code more maintainable.
//
public const string MonoVersion = "5.16.0.139";
public const string MonoVersion = "5.16.0.144";
public const string MonoCompany = "Mono development team";
public const string MonoProduct = "Mono Common Language Infrastructure";
public const string MonoCopyright = "(c) Various Mono authors";

View File

@ -215,93 +215,100 @@ namespace Mono.Btls
bool success, ref MonoSslPolicyErrors errors, ref int status11)
{
status11 = unchecked((int)0);
if (!success) {
errors = MonoSslPolicyErrors.RemoteCertificateChainErrors;
var error = storeCtx.GetError();
if (error != Mono.Btls.MonoBtlsX509Error.OK &
error != Mono.Btls.MonoBtlsX509Error.CRL_NOT_YET_VALID) {
chain.Impl.AddStatus(MapVerifyErrorToChainStatus(error));
status11 = unchecked((int)0x800B010B);
}
if (success)
return;
errors = MonoSslPolicyErrors.RemoteCertificateChainErrors;
if (!wantsChain || storeCtx == null || chain == null) {
status11 = unchecked((int)0x800B010B);
return;
}
var error = storeCtx.GetError();
if (error != Mono.Btls.MonoBtlsX509Error.OK &
error != Mono.Btls.MonoBtlsX509Error.CRL_NOT_YET_VALID) {
chain.Impl.AddStatus(MapVerifyErrorToChainStatus(error));
status11 = unchecked((int)0x800B010B);
}
}
internal static X509ChainStatusFlags MapVerifyErrorToChainStatus(MonoBtlsX509Error code)
internal static X509ChainStatusFlags MapVerifyErrorToChainStatus (MonoBtlsX509Error code)
{
switch (code)
{
case Mono.Btls.MonoBtlsX509Error.OK :
return X509ChainStatusFlags.NoError;
switch (code) {
case MonoBtlsX509Error.OK :
return X509ChainStatusFlags.NoError;
case Mono.Btls.MonoBtlsX509Error.CERT_NOT_YET_VALID :
case Mono.Btls.MonoBtlsX509Error.CERT_HAS_EXPIRED:
case Mono.Btls.MonoBtlsX509Error.ERROR_IN_CERT_NOT_BEFORE_FIELD:
case Mono.Btls.MonoBtlsX509Error.ERROR_IN_CERT_NOT_AFTER_FIELD:
return X509ChainStatusFlags.NotTimeValid;
case MonoBtlsX509Error.CERT_NOT_YET_VALID :
case MonoBtlsX509Error.CERT_HAS_EXPIRED:
case MonoBtlsX509Error.ERROR_IN_CERT_NOT_BEFORE_FIELD:
case MonoBtlsX509Error.ERROR_IN_CERT_NOT_AFTER_FIELD:
return X509ChainStatusFlags.NotTimeValid;
case Mono.Btls.MonoBtlsX509Error.CERT_REVOKED:
return X509ChainStatusFlags.Revoked;
case MonoBtlsX509Error.CERT_REVOKED:
return X509ChainStatusFlags.Revoked;
case Mono.Btls.MonoBtlsX509Error.UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY:
case Mono.Btls.MonoBtlsX509Error.CERT_SIGNATURE_FAILURE:
return X509ChainStatusFlags.NotSignatureValid;
case MonoBtlsX509Error.UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY:
case MonoBtlsX509Error.CERT_SIGNATURE_FAILURE:
return X509ChainStatusFlags.NotSignatureValid;
case Mono.Btls.MonoBtlsX509Error.CERT_UNTRUSTED:
case Mono.Btls.MonoBtlsX509Error.DEPTH_ZERO_SELF_SIGNED_CERT:
case Mono.Btls.MonoBtlsX509Error.SELF_SIGNED_CERT_IN_CHAIN:
return X509ChainStatusFlags.UntrustedRoot;
case MonoBtlsX509Error.CERT_UNTRUSTED:
case MonoBtlsX509Error.DEPTH_ZERO_SELF_SIGNED_CERT:
case MonoBtlsX509Error.SELF_SIGNED_CERT_IN_CHAIN:
return X509ChainStatusFlags.UntrustedRoot;
case Mono.Btls.MonoBtlsX509Error.CRL_HAS_EXPIRED:
return X509ChainStatusFlags.OfflineRevocation;
case MonoBtlsX509Error.CRL_HAS_EXPIRED:
return X509ChainStatusFlags.OfflineRevocation;
case Mono.Btls.MonoBtlsX509Error.CRL_NOT_YET_VALID:
case Mono.Btls.MonoBtlsX509Error.CRL_SIGNATURE_FAILURE:
case Mono.Btls.MonoBtlsX509Error.ERROR_IN_CRL_LAST_UPDATE_FIELD:
case Mono.Btls.MonoBtlsX509Error.ERROR_IN_CRL_NEXT_UPDATE_FIELD:
case Mono.Btls.MonoBtlsX509Error.KEYUSAGE_NO_CRL_SIGN:
case Mono.Btls.MonoBtlsX509Error.UNABLE_TO_DECRYPT_CRL_SIGNATURE:
case Mono.Btls.MonoBtlsX509Error.UNABLE_TO_GET_CRL:
case Mono.Btls.MonoBtlsX509Error.UNABLE_TO_GET_CRL_ISSUER:
case Mono.Btls.MonoBtlsX509Error.UNHANDLED_CRITICAL_CRL_EXTENSION:
return X509ChainStatusFlags.RevocationStatusUnknown;
case MonoBtlsX509Error.CRL_NOT_YET_VALID:
case MonoBtlsX509Error.CRL_SIGNATURE_FAILURE:
case MonoBtlsX509Error.ERROR_IN_CRL_LAST_UPDATE_FIELD:
case MonoBtlsX509Error.ERROR_IN_CRL_NEXT_UPDATE_FIELD:
case MonoBtlsX509Error.KEYUSAGE_NO_CRL_SIGN:
case MonoBtlsX509Error.UNABLE_TO_DECRYPT_CRL_SIGNATURE:
case MonoBtlsX509Error.UNABLE_TO_GET_CRL:
case MonoBtlsX509Error.UNABLE_TO_GET_CRL_ISSUER:
case MonoBtlsX509Error.UNHANDLED_CRITICAL_CRL_EXTENSION:
return X509ChainStatusFlags.RevocationStatusUnknown;
case Mono.Btls.MonoBtlsX509Error.INVALID_EXTENSION:
return X509ChainStatusFlags.InvalidExtension;
case MonoBtlsX509Error.INVALID_EXTENSION:
return X509ChainStatusFlags.InvalidExtension;
case Mono.Btls.MonoBtlsX509Error.UNABLE_TO_GET_ISSUER_CERT:
case Mono.Btls.MonoBtlsX509Error.UNABLE_TO_GET_ISSUER_CERT_LOCALLY:
case Mono.Btls.MonoBtlsX509Error.UNABLE_TO_VERIFY_LEAF_SIGNATURE:
return X509ChainStatusFlags.PartialChain;
case MonoBtlsX509Error.UNABLE_TO_GET_ISSUER_CERT:
case MonoBtlsX509Error.UNABLE_TO_GET_ISSUER_CERT_LOCALLY:
case MonoBtlsX509Error.UNABLE_TO_VERIFY_LEAF_SIGNATURE:
return X509ChainStatusFlags.PartialChain;
case Mono.Btls.MonoBtlsX509Error.INVALID_PURPOSE:
return X509ChainStatusFlags.NotValidForUsage;
case MonoBtlsX509Error.INVALID_PURPOSE:
return X509ChainStatusFlags.NotValidForUsage;
case Mono.Btls.MonoBtlsX509Error.INVALID_CA:
case Mono.Btls.MonoBtlsX509Error.INVALID_NON_CA:
case Mono.Btls.MonoBtlsX509Error.PATH_LENGTH_EXCEEDED:
case Mono.Btls.MonoBtlsX509Error.KEYUSAGE_NO_CERTSIGN:
case Mono.Btls.MonoBtlsX509Error.KEYUSAGE_NO_DIGITAL_SIGNATURE:
return X509ChainStatusFlags.InvalidBasicConstraints;
case MonoBtlsX509Error.INVALID_CA:
case MonoBtlsX509Error.INVALID_NON_CA:
case MonoBtlsX509Error.PATH_LENGTH_EXCEEDED:
case MonoBtlsX509Error.KEYUSAGE_NO_CERTSIGN:
case MonoBtlsX509Error.KEYUSAGE_NO_DIGITAL_SIGNATURE:
return X509ChainStatusFlags.InvalidBasicConstraints;
case Mono.Btls.MonoBtlsX509Error.INVALID_POLICY_EXTENSION:
case Mono.Btls.MonoBtlsX509Error.NO_EXPLICIT_POLICY:
return X509ChainStatusFlags.InvalidPolicyConstraints;
case MonoBtlsX509Error.INVALID_POLICY_EXTENSION:
case MonoBtlsX509Error.NO_EXPLICIT_POLICY:
return X509ChainStatusFlags.InvalidPolicyConstraints;
case Mono.Btls.MonoBtlsX509Error.CERT_REJECTED:
return X509ChainStatusFlags.ExplicitDistrust;
case MonoBtlsX509Error.CERT_REJECTED:
return X509ChainStatusFlags.ExplicitDistrust;
case Mono.Btls.MonoBtlsX509Error.UNHANDLED_CRITICAL_EXTENSION:
return X509ChainStatusFlags.HasNotSupportedCriticalExtension;
case MonoBtlsX509Error.UNHANDLED_CRITICAL_EXTENSION:
return X509ChainStatusFlags.HasNotSupportedCriticalExtension;
case Mono.Btls.MonoBtlsX509Error.CERT_CHAIN_TOO_LONG:
throw new CryptographicException();
case MonoBtlsX509Error.HOSTNAME_MISMATCH:
// FIXME: we should have a better error flag for this.
return X509ChainStatusFlags.UntrustedRoot;
case Mono.Btls.MonoBtlsX509Error.OUT_OF_MEM:
throw new OutOfMemoryException();
case MonoBtlsX509Error.CERT_CHAIN_TOO_LONG:
throw new CryptographicException ();
case MonoBtlsX509Error.OUT_OF_MEM:
throw new OutOfMemoryException ();
default:
throw new CryptographicException("Unrecognized X509VerifyStatusCode:" + code);
}
throw new CryptographicException ("Unrecognized X509VerifyStatusCode:" + code);
}
}
internal static void SetupCertificateStore (MonoBtlsX509Store store, MonoTlsSettings settings, bool server)

View File

@ -77,7 +77,7 @@ namespace Mono.Net.Security
Settings = settings;
Provider = provider;
readBuffer = new BufferOffsetSize2 (16834);
readBuffer = new BufferOffsetSize2 (16500);
writeBuffer = new BufferOffsetSize2 (16384);
operation = Operation.None;
}

View File

@ -50,7 +50,7 @@ using System.Security.Cryptography;
namespace Mono.Net.Security
{
class MonoTlsStream
class MonoTlsStream : IDisposable
{
#if SECURITY_DEP
readonly MonoTlsProvider provider;
@ -136,6 +136,7 @@ namespace Mono.Net.Security
request.ServicePoint.UpdateClientCertificate (sslStream.InternalLocalCertificate);
else {
request.ServicePoint.UpdateClientCertificate (null);
sslStream.Dispose ();
sslStream = null;
}
}
@ -154,5 +155,13 @@ namespace Mono.Net.Security
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
#endif
}
public void Dispose ()
{
if (sslStream != null) {
sslStream.Dispose ();
sslStream = null;
}
}
}
}

View File

@ -405,6 +405,7 @@ namespace System.Net
void CloseSocket ()
{
lock (this) {
Debug ($"WC CLOSE SOCKET: Cnc={ID} NS={networkStream} TLS={monoTlsStream}");
if (networkStream != null) {
try {
networkStream.Dispose ();
@ -412,6 +413,13 @@ namespace System.Net
networkStream = null;
}
if (monoTlsStream != null) {
try {
monoTlsStream.Dispose ();
} catch { }
monoTlsStream = null;
}
if (socket != null) {
try {
socket.Dispose ();

View File

@ -41,7 +41,7 @@ namespace System.Net
}
#if MONO_WEB_DEBUG
internal string ME => $"WRS({GetType ().Name}:Op={operation.ID})";
internal string ME => $"WRS({GetType ().Name}:Op={Operation.ID})";
#else
internal string ME => null;
#endif

View File

@ -86,6 +86,13 @@ namespace System
return -1;
}
[CLSCompliant(false)]
public static String Concat(Object arg0, Object arg1, Object arg2, Object arg3, __arglist)
{
// Added to maintain backward compatibility, see https://github.com/mono/mono/issues/9996
throw new PlatformNotSupportedException();
}
internal unsafe int IndexOfUncheckedIgnoreCase (string value, int startIndex, int count)
{
int valueLen = value.Length;

View File

@ -31,6 +31,7 @@
using NUnit.Framework;
using System;
using System.Linq;
using System.Threading;
using System.Reflection;
#if !MONOTOUCH && !FULL_AOT_RUNTIME
@ -890,6 +891,60 @@ namespace MonoTests.System.Reflection
}
}
static void EnsureMethodExists (Type type, string name, params Type[] parameterTypes)
{
var method = type.GetTypeInfo ().GetDeclaredMethods (name)
.SingleOrDefault (m => m.GetParameters ().Select (p => p.ParameterType).SequenceEqual (parameterTypes));
Assert.IsNotNull (method, $"{type}.{name}");
}
public void EnsureEntityFrameworkMethodsExist ()
{
// EntityFramework6 relies on the following methods
// see https://github.com/aspnet/EntityFramework6/blob/master/src/EntityFramework/Core/Objects/ELinq/MethodCallTranslator.cs#L846
// also https://github.com/mono/mono/pull/10452
EnsureMethodExists (typeof (Math), "Ceiling", typeof (decimal));
EnsureMethodExists (typeof (Math), "Ceiling", typeof (double));
EnsureMethodExists (typeof (Math), "Floor", typeof (decimal));
EnsureMethodExists (typeof (Math), "Floor", typeof (double));
EnsureMethodExists (typeof (Math), "Round", typeof (decimal));
EnsureMethodExists (typeof (Math), "Round", typeof (double));
EnsureMethodExists (typeof (Math), "Round", typeof (decimal), typeof (int));
EnsureMethodExists (typeof (Math), "Round", typeof (double), typeof (int));
EnsureMethodExists (typeof (Decimal), "Floor", typeof (decimal));
EnsureMethodExists (typeof (Decimal), "Ceiling", typeof (decimal));
EnsureMethodExists (typeof (Decimal), "Round", typeof (decimal));
EnsureMethodExists (typeof (Decimal), "Round", typeof (decimal), typeof (int));
EnsureMethodExists (typeof (String), "Replace", typeof (String), typeof (String));
EnsureMethodExists (typeof (String), "ToLower");
EnsureMethodExists (typeof (String), "ToUpper");
EnsureMethodExists (typeof (String), "Trim");
EnsureMethodExists (typeof (Math), "Truncate", typeof (decimal));
EnsureMethodExists (typeof (Math), "Truncate", typeof (double));
EnsureMethodExists (typeof (Math), "Pow", typeof (double), typeof (double));
EnsureMethodExists (typeof (Guid), "NewGuid");
EnsureMethodExists (typeof (String), "Contains", typeof (string));
EnsureMethodExists (typeof (String), "IndexOf", typeof (string));
EnsureMethodExists (typeof (String), "StartsWith", typeof (string));
EnsureMethodExists (typeof (String), "EndsWith", typeof (string));
EnsureMethodExists (typeof (String), "Substring", typeof (int));
EnsureMethodExists (typeof (String), "Substring", typeof (int), typeof (int));
EnsureMethodExists (typeof (String), "Remove", typeof (int));
EnsureMethodExists (typeof (String), "Remove", typeof (int), typeof (int));
EnsureMethodExists (typeof (String), "IsNullOrEmpty", typeof (string));
EnsureMethodExists (typeof (String), "Concat", typeof (string), typeof (string));
EnsureMethodExists (typeof (String), "Concat", typeof (string), typeof (string), typeof (string));
EnsureMethodExists (typeof (String), "Concat", typeof (string), typeof (string), typeof (string), typeof (string));
EnsureMethodExists (typeof (String), "Concat", typeof (object), typeof (object));
EnsureMethodExists (typeof (String), "Concat", typeof (object), typeof (object), typeof (object));
EnsureMethodExists (typeof (String), "Concat", typeof (object), typeof (object), typeof (object), typeof (object));
EnsureMethodExists (typeof (String), "Concat", typeof (object[]));
EnsureMethodExists (typeof (String), "Concat", typeof (string[]));
EnsureMethodExists (typeof (String), "Trim", typeof (Char[]));
EnsureMethodExists (typeof (String), "TrimStart", typeof (Char[]));
EnsureMethodExists (typeof (String), "TrimEnd", typeof (Char[]));
}
[Test]
public void TestLocalVariableTypes ()
{

View File

@ -231,6 +231,13 @@ namespace MonoTests.System
Environment.SetEnvironmentVariable ("A3", "\0");
Assert.IsNull (Environment.GetEnvironmentVariables ()["A3"]);
}
[Test] // github issue #9839
public void MachineNameIsNotFullyQualifiedDomainName ()
{
Assert.IsNotNull (Environment.MachineName);
Assert.AreEqual (-1, Environment.MachineName.IndexOf("."));
}
#endif
}
}

View File

@ -1 +1 @@
7fd0f29b958ae09cd0886bcc03cce09e6499d6f9
b476d66491f42ba9702070a95bda42f29d948f1f

View File

@ -1 +1 @@
b1968f4963438e02eb6652af5656726534053110
878faffe984e068a944a2fc43126094532feeb1d

View File

@ -1 +1 @@
89701e6f58d7d1ad7ee62fb24b8a6543a90acfa9
750af3b87930dbf16fac1c289546d928d1f4d0c0

View File

@ -1 +1 @@
8a001016d718b59aef44109fe756f75b6e539212
34242f57fb1df8c257bf8f5fda7560d0de70839c

View File

@ -1 +1 @@
dd5ee03ddd4d5888b82846ec079aba2bb0ccbc10
4041a27fbe712edacdc0404ea4d7d51ac6a0385d

View File

@ -1 +1 @@
ee989464bba21bcece33919ef912d836328b37d5
ac09e6dbb5c2c2789307be8796fbb1b44fcde632

View File

@ -1 +1 @@
db895a4b7836cbec1dede19919c17e5265019177
1c48b6e5747c1bfea10074434209ae606aece0f0

View File

@ -1 +1 @@
71adae68ab4ed4722d7f82d082c7fdc005edc07f
6a92d149fc3c9b5afe123962bcc0aa78f76fd932

View File

@ -1 +1 @@
7fd0f29b958ae09cd0886bcc03cce09e6499d6f9
b476d66491f42ba9702070a95bda42f29d948f1f

View File

@ -1 +1 @@
b1968f4963438e02eb6652af5656726534053110
878faffe984e068a944a2fc43126094532feeb1d

View File

@ -1 +1 @@
89701e6f58d7d1ad7ee62fb24b8a6543a90acfa9
750af3b87930dbf16fac1c289546d928d1f4d0c0

View File

@ -1 +1 @@
8a001016d718b59aef44109fe756f75b6e539212
34242f57fb1df8c257bf8f5fda7560d0de70839c

View File

@ -1 +1 @@
dd5ee03ddd4d5888b82846ec079aba2bb0ccbc10
4041a27fbe712edacdc0404ea4d7d51ac6a0385d

View File

@ -1 +1 @@
ee989464bba21bcece33919ef912d836328b37d5
ac09e6dbb5c2c2789307be8796fbb1b44fcde632

View File

@ -1 +1 @@
db895a4b7836cbec1dede19919c17e5265019177
1c48b6e5747c1bfea10074434209ae606aece0f0

View File

@ -1 +1 @@
71adae68ab4ed4722d7f82d082c7fdc005edc07f
6a92d149fc3c9b5afe123962bcc0aa78f76fd932

View File

@ -1 +1 @@
7fd0f29b958ae09cd0886bcc03cce09e6499d6f9
b476d66491f42ba9702070a95bda42f29d948f1f

View File

@ -1 +1 @@
b1968f4963438e02eb6652af5656726534053110
878faffe984e068a944a2fc43126094532feeb1d

View File

@ -1 +1 @@
89701e6f58d7d1ad7ee62fb24b8a6543a90acfa9
750af3b87930dbf16fac1c289546d928d1f4d0c0

View File

@ -1 +1 @@
8a001016d718b59aef44109fe756f75b6e539212
34242f57fb1df8c257bf8f5fda7560d0de70839c

View File

@ -1 +1 @@
dd5ee03ddd4d5888b82846ec079aba2bb0ccbc10
4041a27fbe712edacdc0404ea4d7d51ac6a0385d

View File

@ -1 +1 @@
ee989464bba21bcece33919ef912d836328b37d5
ac09e6dbb5c2c2789307be8796fbb1b44fcde632

View File

@ -1 +1 @@
db895a4b7836cbec1dede19919c17e5265019177
1c48b6e5747c1bfea10074434209ae606aece0f0

View File

@ -1 +1 @@
71adae68ab4ed4722d7f82d082c7fdc005edc07f
6a92d149fc3c9b5afe123962bcc0aa78f76fd932

View File

@ -1 +1 @@
87bbec07e2dd27d618a22a4af43e7b77d6a6dd7c
becef867c4e00b9271b0c68c840dd1a03396d4c4

View File

@ -1 +1 @@
c01fe52cc7b6f7b52ff0d18738de654974150a05
ba09dfa7f38c0d32081101e05cb28f8575de20ef

View File

@ -1 +1 @@
#define FULL_VERSION "explicit/330eec3"
#define FULL_VERSION "explicit/d02452f"

Binary file not shown.

View File

@ -1 +1 @@
a40af7352861cc759251316dcb455c37ad02fd8f
be123fc7658826e3e7efed533003394e23cfd91e

Binary file not shown.

View File

@ -1 +1 @@
89c427a304fb3f85344a94d4e8dbc936c0d078e2
03d3d8ccd03b644bc480a129d18799ccfd95ed12

Binary file not shown.

View File

@ -1 +1 @@
383658d48ee847a5dba73adba2dd5f9159c46a63
ed3a2aaadeded63a615ac0868250186820e62b34

View File

@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: mono 5.16.0.139\n"
"Project-Id-Version: mono 5.16.0.144\n"
"Report-Msgid-Bugs-To: http://www.mono-project.com/Bugs\n"
"POT-Creation-Date: 2018-09-03 08:11+0000\n"
"POT-Creation-Date: 2018-09-05 08:04+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

Binary file not shown.

View File

@ -1 +1 @@
a18e7c398cc78a5b0b4eb6b457140a908abb3693
98981781e9e2e8a2f059a1d667a7b5b67b15539b