From: Alexander Kyte Date: Wed, 30 Aug 2017 19:59:18 +0000 (-0400) Subject: Merge pull request #5330 from alexanderkyte/dedup_mkbundle X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=9a287c04126d095e7371afee32632febd0dafd93;hp=6f270b372a359046154ecdaea58749da11f010be;p=mono.git Merge pull request #5330 from alexanderkyte/dedup_mkbundle [runtime] Add Dedup Support to MkBundle --- diff --git a/mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsProvider.cs b/mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsProvider.cs index 05f507a852e..5a03262e229 100644 --- a/mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsProvider.cs +++ b/mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsProvider.cs @@ -163,5 +163,14 @@ namespace Mono.Security.Interface X509CertificateCollection certificates, bool wantsChain, ref X509Chain chain, ref MonoSslPolicyErrors errors, ref int status11); #endregion + +#region Misc + + internal abstract bool SupportsCleanShutdown { + get; + } + +#endregion + } } diff --git a/mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsSettings.cs b/mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsSettings.cs index 6a1bf86ed1f..ee7e216cc21 100644 --- a/mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsSettings.cs +++ b/mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsSettings.cs @@ -86,6 +86,13 @@ namespace Mono.Security.Interface get; set; } + /* + * This is only supported if MonoTlsProvider.SupportsCleanShutdown is true. + */ + internal bool SendCloseNotify { + get; set; + } + /* * If you set this here, then it will override 'ServicePointManager.SecurityProtocol'. */ @@ -173,6 +180,7 @@ namespace Mono.Security.Interface EnabledProtocols = other.EnabledProtocols; EnabledCiphers = other.EnabledCiphers; CertificateValidationTime = other.CertificateValidationTime; + SendCloseNotify = other.SendCloseNotify; if (other.TrustAnchors != null) TrustAnchors = new X509CertificateCollection (other.TrustAnchors); if (other.CertificateSearchPaths != null) { diff --git a/mcs/class/System/Mono.AppleTls/AppleTlsContext.cs b/mcs/class/System/Mono.AppleTls/AppleTlsContext.cs index d30f1f484f9..0cc69e47648 100644 --- a/mcs/class/System/Mono.AppleTls/AppleTlsContext.cs +++ b/mcs/class/System/Mono.AppleTls/AppleTlsContext.cs @@ -848,24 +848,7 @@ namespace Mono.AppleTls public override void Shutdown () { - if (Interlocked.Exchange (ref pendingIO, 1) == 1) - throw new InvalidOperationException (); - - Debug ("Shutdown"); - - lastException = null; - - try { - if (closed || disposed) - return; - - var status = SSLClose (Handle); - Debug ("Shutdown done: {0}", status); - CheckStatusAndThrow (status); - } finally { - closed = true; - pendingIO = 0; - } + closed = true; } #endregion diff --git a/mcs/class/System/Mono.AppleTls/AppleTlsProvider.cs b/mcs/class/System/Mono.AppleTls/AppleTlsProvider.cs index 4fdabfd3ae3..9582f6aceb7 100644 --- a/mcs/class/System/Mono.AppleTls/AppleTlsProvider.cs +++ b/mcs/class/System/Mono.AppleTls/AppleTlsProvider.cs @@ -65,6 +65,10 @@ namespace Mono.AppleTls get { return true; } } + internal override bool SupportsCleanShutdown { + get { return false; } + } + public override SslProtocols SupportedProtocols { get { return SslProtocols.Tls12 | SslProtocols.Tls11 | SslProtocols.Tls; } } diff --git a/mcs/class/System/Mono.Btls/MonoBtlsContext.cs b/mcs/class/System/Mono.Btls/MonoBtlsContext.cs index 335be7d3090..559db4aca5d 100644 --- a/mcs/class/System/Mono.Btls/MonoBtlsContext.cs +++ b/mcs/class/System/Mono.Btls/MonoBtlsContext.cs @@ -357,7 +357,8 @@ namespace Mono.Btls public override void Shutdown () { Debug ("Shutdown!"); -// ssl.SetQuietShutdown (); + if (Settings == null || !Settings.SendCloseNotify) + ssl.SetQuietShutdown (); ssl.Shutdown (); } diff --git a/mcs/class/System/Mono.Btls/MonoBtlsProvider.cs b/mcs/class/System/Mono.Btls/MonoBtlsProvider.cs index bd979345e0d..0db248b9912 100644 --- a/mcs/class/System/Mono.Btls/MonoBtlsProvider.cs +++ b/mcs/class/System/Mono.Btls/MonoBtlsProvider.cs @@ -75,6 +75,10 @@ namespace Mono.Btls get { return true; } } + internal override bool SupportsCleanShutdown { + get { return true; } + } + public override SslProtocols SupportedProtocols { get { return SslProtocols.Tls12 | SslProtocols.Tls11 | SslProtocols.Tls; } } diff --git a/mcs/class/System/Mono.Net.Security/LegacyTlsProvider.cs b/mcs/class/System/Mono.Net.Security/LegacyTlsProvider.cs index a67b1ff069e..d5d66c2f5ee 100644 --- a/mcs/class/System/Mono.Net.Security/LegacyTlsProvider.cs +++ b/mcs/class/System/Mono.Net.Security/LegacyTlsProvider.cs @@ -68,6 +68,10 @@ namespace Mono.Net.Security get { return false; } } + internal override bool SupportsCleanShutdown { + get { return false; } + } + public override SslProtocols SupportedProtocols { get { return SslProtocols.Tls; } }