[System]: Remove 'SECURITY_DEP' conditional from HttpListener and related classes...
authorMartin Baulig <mabaul@microsoft.com>
Tue, 9 May 2017 15:22:19 +0000 (11:22 -0400)
committerGitHub <noreply@github.com>
Tue, 9 May 2017 15:22:19 +0000 (11:22 -0400)
14 files changed:
mcs/class/System/System.Net/ChunkedInputStream.cs
mcs/class/System/System.Net/EndPointListener.cs
mcs/class/System/System.Net/EndPointManager.cs
mcs/class/System/System.Net/HttpConnection.cs
mcs/class/System/System.Net/HttpListener.Mono.cs
mcs/class/System/System.Net/HttpListener.cs
mcs/class/System/System.Net/HttpListenerContext.cs
mcs/class/System/System.Net/HttpListenerPrefixCollection.cs
mcs/class/System/System.Net/HttpListenerRequest.cs
mcs/class/System/System.Net/HttpListenerResponse.cs
mcs/class/System/System.Net/ListenerAsyncResult.cs
mcs/class/System/System.Net/ListenerPrefix.cs
mcs/class/System/System.Net/ResponseStream.cs
mcs/class/referencesource/System/net/System/Net/AuthenticationSchemeSelector.cs

index b62c92a5cb700ca287bf8111bf30730407c77ad8..04aa77310a62ee2f7181e3f65854e06d81fe4c6e 100644 (file)
@@ -25,8 +25,6 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-#if SECURITY_DEP
-
 using System.IO;
 using System.Net.Sockets;
 using System.Runtime.InteropServices;
@@ -173,4 +171,3 @@ namespace System.Net {
                }
        }
 }
-#endif
index b7aae27d7f9039e03d8d8810704e7e0c04bfdea4..58aa63ea062d168ebd33bfcebca1341e96dbc028 100644 (file)
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if SECURITY_DEP
-
-#if MONO_SECURITY_ALIAS
-extern alias MonoSecurity;
-using MonoSecurity::Mono.Security.Authenticode;
-#else
-using Mono.Security.Authenticode;
-#endif
-
 using System.IO;
 using System.Net.Sockets;
 using System.Collections;
@@ -372,5 +363,4 @@ namespace System.Net {
                }
        }
 }
-#endif
 
index 6db036a7f02a3e0c14431511ac0c6cafbc69a915..2f1658ab113ee155ffbb146e8c69ca85652d8abd 100644 (file)
@@ -26,8 +26,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if SECURITY_DEP
-
 using System.Collections;
 using System.Collections.Generic;
 namespace System.Net {
@@ -158,5 +156,4 @@ namespace System.Net {
                }
        }
 }
-#endif
 
index 1a145a0066ed1b70621827932c1ceba3694b0055..231de98ff9467e33b3ad5f2e65c61ce15870dfd4 100644 (file)
@@ -27,7 +27,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if SECURITY_DEP
 using System.IO;
 using System.Net.Sockets;
 using System.Text;
@@ -38,8 +37,7 @@ using System.Security.Cryptography;
 using System.Security.Cryptography.X509Certificates;
 
 namespace System.Net {
-       sealed class HttpConnection
-       {
+       sealed class HttpConnection {
                static AsyncCallback onread_cb = new AsyncCallback (OnRead);
                const int BufferSize = 8192;
                Socket sock;
@@ -485,5 +483,4 @@ namespace System.Net {
                }
        }
 }
-#endif
 
index 7be7cafe2e48c41d377253c5eeb3138f1fefc5a8..f6c88f02286f575f44980ceeb23240c5aa51ac27 100644 (file)
 #if MONO_SECURITY_ALIAS
 extern alias MonoSecurity;
 using MonoSecurity::Mono.Security.Authenticode;
-using MSI = MonoSecurity::Mono.Security.Interface;
+using MonoSecurity::Mono.Security.Interface;
 #else
 using Mono.Security.Authenticode;
-using MSI = Mono.Security.Interface;
+using Mono.Security.Interface;
+#endif
+using MNS = Mono.Net.Security;
 #endif
 
 using System.IO;
@@ -42,24 +44,26 @@ using System.Net.Security;
 using System.Security.Authentication.ExtendedProtection;
 using System.Security.Cryptography;
 using System.Security.Cryptography.X509Certificates;
-using MNS = Mono.Net.Security;
 
 namespace System.Net {
        partial class HttpListener {
-               MSI.MonoTlsProvider tlsProvider;
-               MSI.MonoTlsSettings tlsSettings;
+#if SECURITY_DEP
+               MonoTlsProvider tlsProvider;
+               MonoTlsSettings tlsSettings;
                X509Certificate certificate;
 
-               internal HttpListener (X509Certificate certificate, MSI.MonoTlsProvider tlsProvider, MSI.MonoTlsSettings tlsSettings)
+               internal HttpListener (X509Certificate certificate, MonoTlsProvider tlsProvider, MonoTlsSettings tlsSettings)
                        : this ()
                {
                        this.certificate = certificate;
                        this.tlsProvider = tlsProvider;
                        this.tlsSettings = tlsSettings;
                }
+#endif
 
                internal X509Certificate LoadCertificateAndKey (IPAddress addr, int port)
                {
+#if SECURITY_DEP
                        lock (_internalLock) {
                                if (certificate != null)
                                        return certificate;
@@ -85,21 +89,27 @@ namespace System.Net {
                                        return null;
                                }
                        }
+#else
+                       throw new PlatformNotSupportedException ();
+#endif
                }
 
                internal SslStream CreateSslStream (Stream innerStream, bool ownsStream, RemoteCertificateValidationCallback callback)
                {
+#if SECURITY_DEP
                        lock (_internalLock) {
                                if (tlsProvider == null)
-                                       tlsProvider = MSI.MonoTlsProviderFactory.GetProvider ();
+                                       tlsProvider = MonoTlsProviderFactory.GetProvider ();
                                if (tlsSettings == null)
-                                       tlsSettings = MSI.MonoTlsSettings.CopyDefaultSettings ();
+                                       tlsSettings = MonoTlsSettings.CopyDefaultSettings ();
                                if (tlsSettings.RemoteCertificateValidationCallback == null)
                                        tlsSettings.RemoteCertificateValidationCallback = MNS.Private.CallbackHelpers.PublicToMono (callback);
                                var sslStream = tlsProvider.CreateSslStream (innerStream, ownsStream, tlsSettings);
                                return sslStream.SslStream;
                        }
+#else
+                       throw new PlatformNotSupportedException ();
+#endif
                }
        }
 }
-#endif
index 663b92a1819dbd9cc6dc44667f2af8da2128d980..d886219bc6d8117e8a969ef967fdb626f58d1222 100644 (file)
@@ -28,7 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if SECURITY_DEP
 using System.IO;
 using System.Collections;
 using System.Threading;
@@ -416,11 +415,3 @@ namespace System.Net {
                }
        }
 }
-#else // SECURITY_DEP
-namespace System.Net
-{
-       public sealed class HttpListener
-       {
-       }
-}
-#endif
index 947662dc070e1ec0e7dcb2920335f9479f5d241d..ffb88651509db98c5a8d6c93889a728b66b1118a 100644 (file)
@@ -26,8 +26,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if SECURITY_DEP
-
 using System.Collections.Specialized;
 using System.IO;
 using System.Security.Principal;
@@ -162,10 +160,3 @@ namespace System.Net {
                }
        }
 }
-#else
-namespace System.Net {
-       public sealed class HttpListenerContext {
-       }
-}
-#endif
-
index 5c9416e70b0fb10994946adfd2ad7a0a48e0c867..c4bdad2c89d7b277effa740008c5b5676f4498eb 100644 (file)
@@ -25,7 +25,6 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if SECURITY_DEP
 
 using System.Collections;
 using System.Collections.Generic;
@@ -113,5 +112,4 @@ namespace System.Net {
                }
        }
 }
-#endif
 
index fc0125df25a8fbd10362b6bfb2acea030bcdfde9..2a690b0e3b2519630622fb0e815026af226ab65b 100644 (file)
@@ -28,8 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if SECURITY_DEP
-
 using System.Collections;
 using System.Collections.Specialized;
 using System.Globalization;
@@ -579,5 +577,4 @@ namespace System.Net {
                }
        }
 }
-#endif
 
index 73aa6396b5343e27c1ae1808bc72a7c6470053a5..367c977c0edc4ffa36964f48d1fd8c3f6c9ab0ac 100644 (file)
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if SECURITY_DEP
-
 using System.Globalization;
 using System.IO;
 using System.Text;
+
 namespace System.Net {
        public sealed class HttpListenerResponse : IDisposable
        {
@@ -518,5 +517,4 @@ namespace System.Net {
                }
        }
 }
-#endif
 
index 88f75e88a9941e4c7457f763497bc9f04416d6b7..f73922e032ff2f4bf3394061fc6c69890efaff06 100644 (file)
@@ -28,8 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if SECURITY_DEP
-
 using System.Threading;
 namespace System.Net {
        class ListenerAsyncResult : IAsyncResult {
@@ -181,5 +179,4 @@ namespace System.Net {
                }
        }
 }
-#endif
 
index f0b7ef8398e5f83e43ef92f093c97994cc23719a..f7cb7b381458a7b3b8d621f76111e478cddc7cad 100644 (file)
@@ -27,8 +27,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if SECURITY_DEP
-
 namespace System.Net {
        sealed class ListenerPrefix
        {
@@ -160,4 +158,3 @@ namespace System.Net {
                }
        }
 }
-#endif
index 81e1d6f67d4be3308554d97eb4f01a2ecc97bafa..5d33e477d1c2b7d733188dfe3ee309fdc07ec1e8 100644 (file)
@@ -26,8 +26,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if SECURITY_DEP
-
 using System.IO;
 using System.Net.Sockets;
 using System.Text;
@@ -248,5 +246,4 @@ namespace System.Net {
                }
        }
 }
-#endif
 
index d111e81a484a72aa398bec43d6278c4a4fce11ff..886a2fee29ca24b9db3cfccb052b4e2372f80a19 100644 (file)
@@ -5,8 +5,6 @@
 //------------------------------------------------------------------------------
 
 namespace System.Net {
-#if SECURITY_DEP
     public delegate AuthenticationSchemes AuthenticationSchemeSelector(HttpListenerRequest httpRequest);
-#endif
 }