Imported Upstream version 5.16.0.144
Former-commit-id: 2b9e8926e7df56dfea2d6991a64c8f5129cfffcb
This commit is contained in:
parent
6dab091a3e
commit
47a1b3e592
@ -1 +1 @@
|
||||
d6e02f659617784f5dc88b30fcd809e5b88e0941
|
||||
6a4b68ccb5c3097357e1a2d56cd89ebd9d38a301
|
@ -1 +1 @@
|
||||
4ba07eb03127098c4d335226ef0efc214a051b0c
|
||||
600b9ac309a3b7f10e3d02596d7da316f96dd787
|
@ -1 +1 @@
|
||||
ad3837793c1a54bb1919f1b8685ba5e3c39c301b
|
||||
3e5fbe0a8e9832a6c1fa10e9e6fcb9b7760767d7
|
@ -1 +1 @@
|
||||
24297e223be1a2ddc160f0b3bdaf01a0b73f3739
|
||||
0e5ebabffda13f7e89b4933bf05bcaf7e5d7cdc3
|
@ -1 +1 @@
|
||||
6181969e24280652542eb81a3986d47fe16200f0
|
||||
9bca9460d6b9cd74dd3d146987c845648fdb7094
|
@ -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";
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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 ();
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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 ()
|
||||
{
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
7fd0f29b958ae09cd0886bcc03cce09e6499d6f9
|
||||
b476d66491f42ba9702070a95bda42f29d948f1f
|
@ -1 +1 @@
|
||||
b1968f4963438e02eb6652af5656726534053110
|
||||
878faffe984e068a944a2fc43126094532feeb1d
|
Binary file not shown.
@ -1 +1 @@
|
||||
89701e6f58d7d1ad7ee62fb24b8a6543a90acfa9
|
||||
750af3b87930dbf16fac1c289546d928d1f4d0c0
|
@ -1 +1 @@
|
||||
8a001016d718b59aef44109fe756f75b6e539212
|
||||
34242f57fb1df8c257bf8f5fda7560d0de70839c
|
@ -1 +1 @@
|
||||
dd5ee03ddd4d5888b82846ec079aba2bb0ccbc10
|
||||
4041a27fbe712edacdc0404ea4d7d51ac6a0385d
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user