Ver Fonte

[System] Remove PrebuiltSystem alias (it's not needed with any modern mcs)

Marek Safar há 9 anos atrás
pai
commit
aa77a6ddcc
27 ficheiros alterados com 69 adições e 260 exclusões
  1. 2 2
      mcs/class/System/Makefile
  2. 8 18
      mcs/class/System/Mono.Net.Security/CallbackHelpers.cs
  3. 4 12
      mcs/class/System/Mono.Net.Security/ChainValidationHelper.cs
  4. 0 6
      mcs/class/System/Mono.Net.Security/IMonoSslStream.cs
  5. 0 7
      mcs/class/System/Mono.Net.Security/IMonoTlsProvider.cs
  6. 0 6
      mcs/class/System/Mono.Net.Security/LegacySslStream.cs
  7. 0 9
      mcs/class/System/Mono.Net.Security/MonoDefaultTlsProvider.cs
  8. 24 48
      mcs/class/System/Mono.Net.Security/MonoSslStreamImpl.cs
  9. 11 25
      mcs/class/System/Mono.Net.Security/MonoSslStreamWrapper.cs
  10. 4 14
      mcs/class/System/Mono.Net.Security/MonoTlsProviderImpl.cs
  11. 2 12
      mcs/class/System/Mono.Net.Security/MonoTlsProviderWrapper.cs
  12. 1 8
      mcs/class/System/Mono.Net.Security/MonoTlsStream.cs
  13. 0 8
      mcs/class/System/Mono.Net.Security/SystemCertificateValidator.cs
  14. 0 3
      mcs/class/System/System.CodeDom.Compiler/Compiler.cs
  15. 0 5
      mcs/class/System/System.Configuration/AppSettingsReader.cs
  16. 0 4
      mcs/class/System/System.Configuration/ApplicationSettingsBase.cs
  17. 0 5
      mcs/class/System/System.Configuration/ConfigurationSettings.cs
  18. 1 4
      mcs/class/System/System.Configuration/CustomizableFileSettingsProvider.cs
  19. 0 4
      mcs/class/System/System.Configuration/LocalFileSettingsProvider.cs
  20. 0 8
      mcs/class/System/System.Net.Mail/SmtpClient.cs
  21. 0 4
      mcs/class/System/System.Net.Security/LocalCertificateSelectionCallback.cs
  22. 0 4
      mcs/class/System/System.Net.Security/RemoteCertificateValidationCallback.cs
  23. 10 20
      mcs/class/System/System.Net.Security/SslStream.cs
  24. 0 8
      mcs/class/System/System.Net/HttpConnection.cs
  25. 0 4
      mcs/class/System/System.Security.Authentication.ExtendedProtection.Configuration/ConfigUtil.cs
  26. 0 7
      mcs/class/System/System.Security.Cryptography.X509Certificates/OSX509Certificates.cs
  27. 2 5
      mcs/class/System/System.Security.Cryptography.X509Certificates/X509Helper2.cs

+ 2 - 2
mcs/class/System/Makefile

@@ -59,7 +59,7 @@ endif
 ifeq (secxml/, $(intermediate))
 LOCAL_MCS_FLAGS =
 LIB_REFS += bare/System.Xml MonoSecurity=Mono.Security
-LIB_MCS_FLAGS += -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=$(bare_libdir)/System.dll $(EXTERN_ALIAS_FLAGS)
+LIB_MCS_FLAGS += -d:SECURITY_DEP -d:XML_DEP $(EXTERN_ALIAS_FLAGS)
 endif
 
 #
@@ -67,7 +67,7 @@ endif
 #
 ifndef intermediate
 LIB_REFS += System.Xml MonoSecurity=Mono.Security
-LIB_MCS_FLAGS += -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=$(secxml_libdir)/System.dll $(EXTERN_ALIAS_FLAGS)
+LIB_MCS_FLAGS += -d:SECURITY_DEP -d:XML_DEP $(EXTERN_ALIAS_FLAGS)
 
 ifndef MOBILE_PROFILE
 LIB_REFS += System.Configuration

+ 8 - 18
mcs/class/System/Mono.Net.Security/CallbackHelpers.cs

@@ -26,9 +26,6 @@
 
 #if SECURITY_DEP
 
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
 #if MONO_SECURITY_ALIAS
 extern alias MonoSecurity;
 #endif
@@ -38,13 +35,6 @@ using MSI = MonoSecurity::Mono.Security.Interface;
 #else
 using MSI = Mono.Security.Interface;
 #endif
-#if MONO_X509_ALIAS
-using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-using XX509Chain = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509Chain;
-#else
-using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-using XX509Chain = System.Security.Cryptography.X509Certificates.X509Chain;
-#endif
 
 using System;
 using System.IO;
@@ -64,7 +54,7 @@ namespace Mono.Net.Security.Private
 			if (callback == null)
 				return null;
 
-			return (h, c, ch, e) => callback (h, c, (X509Chain)(object)ch, (SslPolicyErrors)e);
+			return (h, c, ch, e) => callback (h, c, ch, (SslPolicyErrors)e);
 		}
 
 		internal static MSI.MonoLocalCertificateSelectionCallback PublicToMono (LocalCertificateSelectionCallback callback)
@@ -72,7 +62,7 @@ namespace Mono.Net.Security.Private
 			if (callback == null)
 				return null;
 
-			return (t, lc, rc, ai) => callback (null, t, (XX509CertificateCollection)(object)lc, rc, ai);
+			return (t, lc, rc, ai) => callback (null, t, lc, rc, ai);
 		}
 
 		internal static MSI.MonoRemoteCertificateValidationCallback InternalToMono (RemoteCertValidationCallback callback)
@@ -80,7 +70,7 @@ namespace Mono.Net.Security.Private
 			if (callback == null)
 				return null;
 
-			return (h, c, ch, e) => callback (h, c, (X509Chain)(object)ch, (SslPolicyErrors)e);
+			return (h, c, ch, e) => callback (h, c, ch, (SslPolicyErrors)e);
 		}
 
 		internal static RemoteCertificateValidationCallback InternalToPublic (string hostname, RemoteCertValidationCallback callback)
@@ -96,7 +86,7 @@ namespace Mono.Net.Security.Private
 			if (callback == null)
 				return null;
 
-			return (t, lc, rc, ai) => callback (t, (XX509CertificateCollection)(object)lc, rc, ai);
+			return (t, lc, rc, ai) => callback (t, lc, rc, ai);
 		}
 
 		internal static RemoteCertificateValidationCallback MonoToPublic (MSI.MonoRemoteCertificateValidationCallback callback)
@@ -104,7 +94,7 @@ namespace Mono.Net.Security.Private
 			if (callback == null)
 				return null;
 
-			return (t, c, ch, e) => callback (null, c, (XX509Chain)(object)ch, (MSI.MonoSslPolicyErrors)e);
+			return (t, c, ch, e) => callback (null, c, ch, (MSI.MonoSslPolicyErrors)e);
 		}
 
 		internal static LocalCertificateSelectionCallback MonoToPublic (MSI.MonoLocalCertificateSelectionCallback callback)
@@ -112,7 +102,7 @@ namespace Mono.Net.Security.Private
 			if (callback == null)
 				return null;
 
-			return (s, t, lc, rc, ai) => callback (t, (XX509CertificateCollection)(object)lc, rc, ai);
+			return (s, t, lc, rc, ai) => callback (t, lc, rc, ai);
 		}
 
 		internal static RemoteCertValidationCallback MonoToInternal (MSI.MonoRemoteCertificateValidationCallback callback)
@@ -120,7 +110,7 @@ namespace Mono.Net.Security.Private
 			if (callback == null)
 				return null;
 
-			return (h, c, ch, e) => callback (h, c, (XX509Chain)(object)ch, (MSI.MonoSslPolicyErrors)e);
+			return (h, c, ch, e) => callback (h, c, ch, (MSI.MonoSslPolicyErrors)e);
 		}
 
 		internal static LocalCertSelectionCallback MonoToInternal (MSI.MonoLocalCertificateSelectionCallback callback)
@@ -128,7 +118,7 @@ namespace Mono.Net.Security.Private
 			if (callback == null)
 				return null;
 
-			return (t, lc, rc, ai) => callback (t, (XX509CertificateCollection)(object)lc, rc, ai);
+			return (t, lc, rc, ai) => callback (t, lc, rc, ai);
 		}
 
 	}

+ 4 - 12
mcs/class/System/Mono.Net.Security/ChainValidationHelper.cs

@@ -34,9 +34,6 @@
 #if MONO_SECURITY_ALIAS
 extern alias MonoSecurity;
 #endif
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
 
 #if MONO_SECURITY_ALIAS
 using MonoSecurity::Mono.Security.Interface;
@@ -47,13 +44,8 @@ using Mono.Security.Interface;
 using MSX = Mono.Security.X509;
 using Mono.Security.X509.Extensions;
 #endif
-#if MONO_X509_ALIAS
-using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-using XX509Chain = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509Chain;
-#else
 using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
 using XX509Chain = System.Security.Cryptography.X509Certificates.X509Chain;
-#endif
 
 using System;
 using System.Net;
@@ -257,7 +249,7 @@ namespace Mono.Net.Security
 		public ValidationResult ValidateCertificate (string host, bool serverMode, X509Certificate leaf, XX509Chain xchain)
 		{
 			try {
-				var chain = (X509Chain)(object)xchain;
+				var chain = xchain;
 				var result = ValidateChain (host, serverMode, leaf, chain, null, 0);
 				if (tlsStream != null)
 					tlsStream.CertificateValidationFailed = result == null || !result.Trusted || result.UserDenied;
@@ -326,9 +318,9 @@ namespace Mono.Net.Security
 			bool providerValidated = false;
 			if (provider != null && provider.HasCustomSystemCertificateValidator) {
 				var xerrors = (MonoSslPolicyErrors)errors;
-				var xchain = (XX509Chain)(object)chain;
+				var xchain = chain;
 				providerValidated = provider.InvokeSystemCertificateValidator (this, host, server, certs, wantsChain, ref xchain, out result, ref xerrors, ref status11);
-				chain = (X509Chain)(object)xchain;
+				chain = xchain;
 				errors = (SslPolicyErrors)xerrors;
 			} else if (wantsChain) {
 				chain = SystemCertificateValidator.CreateX509Chain (certs);
@@ -363,7 +355,7 @@ namespace Mono.Net.Security
 
 		public bool InvokeSystemValidator (string targetHost, bool serverMode, XX509CertificateCollection certificates, XX509Chain xchain, ref MonoSslPolicyErrors xerrors, ref int status11)
 		{
-			X509Chain chain = (X509Chain)(object)xchain;
+			X509Chain chain = xchain;
 			var errors = (SslPolicyErrors)xerrors;
 			var result = SystemCertificateValidator.Evaluate (settings, targetHost, certificates, chain, ref errors, ref status11);
 			xerrors = (MonoSslPolicyErrors)errors;

+ 0 - 6
mcs/class/System/Mono.Net.Security/IMonoSslStream.cs

@@ -25,16 +25,10 @@
 // THE SOFTWARE.
 
 #if SECURITY_DEP
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
 #if MONO_SECURITY_ALIAS
 extern alias MonoSecurity;
 #endif
 
-#if MONO_X509_ALIAS
-using X509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#endif
 #if MONO_SECURITY_ALIAS
 using MSI = MonoSecurity::Mono.Security.Interface;
 #else

+ 0 - 7
mcs/class/System/Mono.Net.Security/IMonoTlsProvider.cs

@@ -28,21 +28,14 @@
 #if MONO_SECURITY_ALIAS
 extern alias MonoSecurity;
 #endif
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
 
 #if MONO_SECURITY_ALIAS
 using MonoSecurity::Mono.Security.Interface;
 #else
 using Mono.Security.Interface;
 #endif
-#if MONO_X509_ALIAS
-using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#else
 using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
 #endif
-#endif
 
 using System;
 using System.IO;

+ 0 - 6
mcs/class/System/Mono.Net.Security/LegacySslStream.cs

@@ -34,9 +34,6 @@
 
 #if SECURITY_DEP
 
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
 #if MONO_SECURITY_ALIAS
 extern alias MonoSecurity;
 #endif
@@ -56,9 +53,6 @@ using MonoSecurityProtocolType = Mono.Security.Protocol.Tls.SecurityProtocolType
 using Mono.Security.Protocol.Tls;
 using Mono.Security.Interface;
 #endif
-#if MONO_X509_ALIAS
-using X509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#endif
 
 using CipherAlgorithmType = System.Security.Authentication.CipherAlgorithmType;
 using HashAlgorithmType = System.Security.Authentication.HashAlgorithmType;

+ 0 - 9
mcs/class/System/Mono.Net.Security/MonoDefaultTlsProvider.cs

@@ -24,22 +24,13 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 #if SECURITY_DEP
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
 #if MONO_SECURITY_ALIAS
 extern alias MonoSecurity;
 #endif
 
-#if MONO_X509_ALIAS
-using XHttpWebRequest = PrebuiltSystem::System.Net.HttpWebRequest;
-using XSslProtocols = PrebuiltSystem::System.Security.Authentication.SslProtocols;
-using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#else
 using XHttpWebRequest = System.Net.HttpWebRequest;
 using XSslProtocols = System.Security.Authentication.SslProtocols;
 using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#endif
 
 #if MONO_SECURITY_ALIAS
 using MonoSecurity::Mono.Security.Interface;

+ 24 - 48
mcs/class/System/Mono.Net.Security/MonoSslStreamImpl.cs

@@ -26,9 +26,6 @@
 
 #if SECURITY_DEP
 
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
 #if MONO_SECURITY_ALIAS
 extern alias MonoSecurity;
 #endif
@@ -38,27 +35,6 @@ using MSI = MonoSecurity::Mono.Security.Interface;
 #else
 using MSI = Mono.Security.Interface;
 #endif
-#if MONO_X509_ALIAS
-using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-
-using XTransportContext = PrebuiltSystem::System.Net.TransportContext;
-using XAuthenticatedStream = PrebuiltSystem::System.Net.Security.AuthenticatedStream;
-
-using XCipherAlgorithmType = PrebuiltSystem::System.Security.Authentication.CipherAlgorithmType;
-using XHashAlgorithmType = PrebuiltSystem::System.Security.Authentication.HashAlgorithmType;
-using XExchangeAlgorithmType = PrebuiltSystem::System.Security.Authentication.ExchangeAlgorithmType;
-using XSslProtocols = PrebuiltSystem::System.Security.Authentication.SslProtocols;
-#else
-using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-
-using XTransportContext = System.Net.TransportContext;
-using XAuthenticatedStream = System.Net.Security.AuthenticatedStream;
-
-using XCipherAlgorithmType = System.Security.Authentication.CipherAlgorithmType;
-using XHashAlgorithmType = System.Security.Authentication.HashAlgorithmType;
-using XExchangeAlgorithmType = System.Security.Authentication.ExchangeAlgorithmType;
-using XSslProtocols = System.Security.Authentication.SslProtocols;
-#endif
 
 using System;
 using System.IO;
@@ -96,9 +72,9 @@ namespace Mono.Net.Security.Private
 			Impl.AuthenticateAsClient (targetHost);
 		}
 
-		public void AuthenticateAsClient (string targetHost, XX509CertificateCollection clientCertificates, XSslProtocols enabledSslProtocols, bool checkCertificateRevocation)
+		public void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
 		{
-			Impl.AuthenticateAsClient (targetHost, clientCertificates, (SslProtocols)enabledSslProtocols, checkCertificateRevocation);
+			Impl.AuthenticateAsClient (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation);
 		}
 
 		public IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState)
@@ -106,9 +82,9 @@ namespace Mono.Net.Security.Private
 			return Impl.BeginAuthenticateAsClient (targetHost, asyncCallback, asyncState);
 		}
 
-		public IAsyncResult BeginAuthenticateAsClient (string targetHost, XX509CertificateCollection clientCertificates, XSslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
+		public IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
 		{
-			return Impl.BeginAuthenticateAsClient (targetHost, clientCertificates, (SslProtocols)enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
+			return Impl.BeginAuthenticateAsClient (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
 		}
 
 		public void EndAuthenticateAsClient (IAsyncResult asyncResult)
@@ -121,9 +97,9 @@ namespace Mono.Net.Security.Private
 			Impl.AuthenticateAsServer (serverCertificate);
 		}
 
-		public void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, XSslProtocols enabledSslProtocols, bool checkCertificateRevocation)
+		public void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
 		{
-			Impl.AuthenticateAsServer (serverCertificate, clientCertificateRequired, (SslProtocols)enabledSslProtocols, checkCertificateRevocation);
+			Impl.AuthenticateAsServer (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation);
 		}
 
 		public IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback asyncCallback, object asyncState)
@@ -131,9 +107,9 @@ namespace Mono.Net.Security.Private
 			return Impl.BeginAuthenticateAsServer (serverCertificate, asyncCallback, asyncState);
 		}
 
-		public IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, XSslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
+		public IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
 		{
-			return Impl.BeginAuthenticateAsServer (serverCertificate, clientCertificateRequired, (SslProtocols)enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
+			return Impl.BeginAuthenticateAsServer (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
 		}
 
 		public void EndAuthenticateAsServer (IAsyncResult asyncResult)
@@ -146,9 +122,9 @@ namespace Mono.Net.Security.Private
 			return Impl.AuthenticateAsClientAsync (targetHost);
 		}
 
-		public Task AuthenticateAsClientAsync (string targetHost, XX509CertificateCollection clientCertificates, XSslProtocols enabledSslProtocols, bool checkCertificateRevocation)
+		public Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
 		{
-			return Impl.AuthenticateAsClientAsync (targetHost, clientCertificates, (SslProtocols)enabledSslProtocols, checkCertificateRevocation);
+			return Impl.AuthenticateAsClientAsync (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation);
 		}
 
 		public Task AuthenticateAsServerAsync (X509Certificate serverCertificate)
@@ -156,9 +132,9 @@ namespace Mono.Net.Security.Private
 			return Impl.AuthenticateAsServerAsync (serverCertificate);
 		}
 
-		public Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, XSslProtocols enabledSslProtocols, bool checkCertificateRevocation)
+		public Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
 		{
-			return Impl.AuthenticateAsServerAsync (serverCertificate, clientCertificateRequired, (SslProtocols)enabledSslProtocols, checkCertificateRevocation);
+			return Impl.AuthenticateAsServerAsync (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation);
 		}
 
 		public void Flush ()
@@ -201,8 +177,8 @@ namespace Mono.Net.Security.Private
 			Impl.EndWrite (asyncResult);
 		}
 
-		public XTransportContext TransportContext {
-			get { return (XTransportContext)(object)Impl.TransportContext; }
+		public TransportContext TransportContext {
+			get { return Impl.TransportContext; }
 		}
 
 		public bool IsAuthenticated {
@@ -225,24 +201,24 @@ namespace Mono.Net.Security.Private
 			get { return Impl.IsServer; }
 		}
 
-		public XCipherAlgorithmType CipherAlgorithm {
-			get { return (XCipherAlgorithmType)Impl.CipherAlgorithm; }
+		public CipherAlgorithmType CipherAlgorithm {
+			get { return Impl.CipherAlgorithm; }
 		}
 
 		public int CipherStrength {
 			get { return Impl.CipherStrength; }
 		}
 
-		public XHashAlgorithmType HashAlgorithm {
-			get { return (XHashAlgorithmType)Impl.HashAlgorithm; }
+		public HashAlgorithmType HashAlgorithm {
+			get { return Impl.HashAlgorithm; }
 		}
 
 		public int HashStrength {
 			get { return Impl.HashStrength; }
 		}
 
-		public XExchangeAlgorithmType KeyExchangeAlgorithm {
-			get { return (XExchangeAlgorithmType)Impl.KeyExchangeAlgorithm; }
+		public ExchangeAlgorithmType KeyExchangeAlgorithm {
+			get { return Impl.KeyExchangeAlgorithm; }
 		}
 
 		public int KeyExchangeStrength {
@@ -274,8 +250,8 @@ namespace Mono.Net.Security.Private
 			Impl.SetLength (value);
 		}
 
-		public XAuthenticatedStream AuthenticatedStream {
-			get { return (XAuthenticatedStream)(Stream)Impl.AuthenticatedStream; }
+		public AuthenticatedStream AuthenticatedStream {
+			get { return Impl.AuthenticatedStream; }
 		}
 
 		public int ReadTimeout {
@@ -304,8 +280,8 @@ namespace Mono.Net.Security.Private
 			get { return Impl.RemoteCertificate; }
 		}
 
-		public XSslProtocols SslProtocol {
-			get { return (XSslProtocols)Impl.SslProtocol; }
+		public SslProtocols SslProtocol {
+			get { return Impl.SslProtocol; }
 		}
 
 		public MSI.MonoTlsProvider Provider {

+ 11 - 25
mcs/class/System/Mono.Net.Security/MonoSslStreamWrapper.cs

@@ -26,9 +26,6 @@
 
 #if SECURITY_DEP
 
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
 #if MONO_SECURITY_ALIAS
 extern alias MonoSecurity;
 #endif
@@ -38,17 +35,6 @@ using MSI = MonoSecurity::Mono.Security.Interface;
 #else
 using MSI = Mono.Security.Interface;
 #endif
-#if MONO_X509_ALIAS
-using XSslProtocols = PrebuiltSystem::System.Security.Authentication.SslProtocols;
-using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#else
-using XSslProtocols = System.Security.Authentication.SslProtocols;
-using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#endif
-
-using CipherAlgorithmType = System.Security.Authentication.CipherAlgorithmType;
-using HashAlgorithmType = System.Security.Authentication.HashAlgorithmType;
-using ExchangeAlgorithmType = System.Security.Authentication.ExchangeAlgorithmType;
 
 using System;
 using System.IO;
@@ -84,9 +70,9 @@ namespace Mono.Net.Security.Private
 			Impl.AuthenticateAsClient (targetHost);
 		}
 
-		public void AuthenticateAsClient (string targetHost, XX509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
+		public void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
 		{
-			Impl.AuthenticateAsClient (targetHost, (XX509CertificateCollection)(object)clientCertificates, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation);
+			Impl.AuthenticateAsClient (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation);
 		}
 
 		public IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState)
@@ -94,9 +80,9 @@ namespace Mono.Net.Security.Private
 			return Impl.BeginAuthenticateAsClient (targetHost, asyncCallback, asyncState);
 		}
 
-		public IAsyncResult BeginAuthenticateAsClient (string targetHost, XX509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
+		public IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
 		{
-			return Impl.BeginAuthenticateAsClient (targetHost, (XX509CertificateCollection)(object)clientCertificates, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
+			return Impl.BeginAuthenticateAsClient (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
 		}
 
 		public void EndAuthenticateAsClient (IAsyncResult asyncResult)
@@ -111,7 +97,7 @@ namespace Mono.Net.Security.Private
 
 		public void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
 		{
-			Impl.AuthenticateAsServer (serverCertificate, clientCertificateRequired, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation);
+			Impl.AuthenticateAsServer (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation);
 		}
 
 		public IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback asyncCallback, object asyncState)
@@ -121,7 +107,7 @@ namespace Mono.Net.Security.Private
 
 		public IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
 		{
-			return Impl.BeginAuthenticateAsServer (serverCertificate, clientCertificateRequired, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
+			return Impl.BeginAuthenticateAsServer (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
 		}
 
 		public void EndAuthenticateAsServer (IAsyncResult asyncResult)
@@ -134,9 +120,9 @@ namespace Mono.Net.Security.Private
 			return Impl.AuthenticateAsClientAsync (targetHost);
 		}
 
-		public Task AuthenticateAsClientAsync (string targetHost, XX509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
+		public Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
 		{
-			return Impl.AuthenticateAsClientAsync (targetHost, clientCertificates, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation);
+			return Impl.AuthenticateAsClientAsync (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation);
 		}
 
 		public Task AuthenticateAsServerAsync (X509Certificate serverCertificate)
@@ -146,7 +132,7 @@ namespace Mono.Net.Security.Private
 
 		public Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
 		{
-			return Impl.AuthenticateAsServerAsync (serverCertificate, clientCertificateRequired, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation);
+			return Impl.AuthenticateAsServerAsync (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation);
 		}
 
 		public void Flush ()
@@ -190,7 +176,7 @@ namespace Mono.Net.Security.Private
 		}
 
 		public TransportContext TransportContext {
-			get { return (TransportContext)(object)Impl.TransportContext; }
+			get { return Impl.TransportContext; }
 		}
 
 		public bool IsAuthenticated {
@@ -263,7 +249,7 @@ namespace Mono.Net.Security.Private
 		}
 
 		public AuthenticatedStream AuthenticatedStream {
-			get { return (AuthenticatedStream)(object)Impl.AuthenticatedStream; }
+			get { return Impl.AuthenticatedStream; }
 		}
 
 		public int ReadTimeout {

+ 4 - 14
mcs/class/System/Mono.Net.Security/MonoTlsProviderImpl.cs

@@ -26,9 +26,6 @@
 
 #if SECURITY_DEP
 
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
 #if MONO_SECURITY_ALIAS
 extern alias MonoSecurity;
 #endif
@@ -38,13 +35,6 @@ using MSI = MonoSecurity::Mono.Security.Interface;
 #else
 using MSI = Mono.Security.Interface;
 #endif
-#if MONO_X509_ALIAS
-using XHttpWebRequest = PrebuiltSystem::System.Net.HttpWebRequest;
-using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#else
-using XHttpWebRequest = System.Net.HttpWebRequest;
-using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#endif
 
 using System;
 using System.IO;
@@ -84,13 +74,13 @@ namespace Mono.Net.Security.Private
 
 		MSI.IMonoTlsContext IMonoTlsProvider.CreateTlsContext (
 			string hostname, bool serverMode, MSI.TlsProtocols protocolFlags,
-			X509Certificate serverCertificate, XX509CertificateCollection clientCertificates,
+			X509Certificate serverCertificate, X509CertificateCollection clientCertificates,
 			bool remoteCertRequired, bool checkCertName, bool checkCertRevocationStatus,
 			MSI.MonoEncryptionPolicy encryptionPolicy, MSI.MonoTlsSettings settings)
 		{
 			return CreateTlsContextImpl (
 				hostname, serverMode, protocolFlags,
-				serverCertificate, (X509CertificateCollection)(object)clientCertificates,
+				serverCertificate, clientCertificates,
 				remoteCertRequired, encryptionPolicy, settings);
 		}
 
@@ -102,13 +92,13 @@ namespace Mono.Net.Security.Private
 
 		internal override MSI.IMonoTlsContext CreateTlsContext (
 			string hostname, bool serverMode, MSI.TlsProtocols protocolFlags,
-			X509Certificate serverCertificate, XX509CertificateCollection clientCertificates,
+			X509Certificate serverCertificate, X509CertificateCollection clientCertificates,
 			bool remoteCertRequired, MSI.MonoEncryptionPolicy encryptionPolicy,
 			MSI.MonoTlsSettings settings)
 		{
 			return CreateTlsContextImpl (
 				hostname, serverMode, (MSI.TlsProtocols)protocolFlags,
-				serverCertificate, (X509CertificateCollection)(object)clientCertificates,
+				serverCertificate, clientCertificates,
 				remoteCertRequired, (MSI.MonoEncryptionPolicy)encryptionPolicy,
 				settings);
 		}

+ 2 - 12
mcs/class/System/Mono.Net.Security/MonoTlsProviderWrapper.cs

@@ -26,9 +26,6 @@
 
 #if SECURITY_DEP
 
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
 #if MONO_SECURITY_ALIAS
 extern alias MonoSecurity;
 #endif
@@ -38,13 +35,6 @@ using MSI = MonoSecurity::Mono.Security.Interface;
 #else
 using MSI = Mono.Security.Interface;
 #endif
-#if MONO_X509_ALIAS
-using XHttpWebRequest = PrebuiltSystem::System.Net.HttpWebRequest;
-using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#else
-using XHttpWebRequest = System.Net.HttpWebRequest;
-using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#endif
 
 using System;
 using System.IO;
@@ -86,13 +76,13 @@ namespace Mono.Net.Security.Private
 
 		public MSI.IMonoTlsContext CreateTlsContext (
 			string hostname, bool serverMode, MSI.TlsProtocols protocolFlags,
-			X509Certificate serverCertificate, XX509CertificateCollection clientCertificates,
+			X509Certificate serverCertificate, X509CertificateCollection clientCertificates,
 			bool remoteCertRequired, bool checkCertName, bool checkCertRevocationStatus,
 			MSI.MonoEncryptionPolicy encryptionPolicy, MSI.MonoTlsSettings settings)
 		{
 			return provider.CreateTlsContext (
 				hostname, serverMode, protocolFlags,
-				serverCertificate, (XX509CertificateCollection)(object)clientCertificates,
+				serverCertificate, clientCertificates,
 				remoteCertRequired, (MSI.MonoEncryptionPolicy)encryptionPolicy,
 				settings);
 		}

+ 1 - 8
mcs/class/System/Mono.Net.Security/MonoTlsStream.cs

@@ -28,21 +28,14 @@
 #if MONO_SECURITY_ALIAS
 extern alias MonoSecurity;
 #endif
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
 
 #if MONO_SECURITY_ALIAS
 using MonoSecurity::Mono.Security.Interface;
 #else
 using Mono.Security.Interface;
 #endif
-#if MONO_X509_ALIAS
-using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#else
 using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
 #endif
-#endif
 
 using System;
 using System.IO;
@@ -104,7 +97,7 @@ namespace Mono.Net.Security
 
 			try {
 				sslStream.AuthenticateAsClient (
-					request.Address.Host, (XX509CertificateCollection)(object)request.ClientCertificates,
+					request.Address.Host, request.ClientCertificates,
 					(SslProtocols)ServicePointManager.SecurityProtocol,
 					ServicePointManager.CheckCertificateRevocationList);
 

+ 0 - 8
mcs/class/System/Mono.Net.Security/SystemCertificateValidator.cs

@@ -3,9 +3,6 @@
 #if MONO_SECURITY_ALIAS
 extern alias MonoSecurity;
 #endif
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
 
 #if MONO_SECURITY_ALIAS
 using MonoSecurity::Mono.Security.Interface;
@@ -16,13 +13,8 @@ using Mono.Security.Interface;
 using MSX = Mono.Security.X509;
 using Mono.Security.X509.Extensions;
 #endif
-#if MONO_X509_ALIAS
-using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-using XX509Chain = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509Chain;
-#else
 using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
 using XX509Chain = System.Security.Cryptography.X509Certificates.X509Chain;
-#endif
 
 using System;
 using System.Net;

+ 0 - 3
mcs/class/System/System.CodeDom.Compiler/Compiler.cs

@@ -29,9 +29,6 @@
 //
 
 #if CONFIGURATION_DEP
-extern alias PrebuiltSystem;
-using TypeDescriptor = PrebuiltSystem.System.ComponentModel.TypeDescriptor;
-
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;

+ 0 - 5
mcs/class/System/System.Configuration/AppSettingsReader.cs

@@ -28,11 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if CONFIGURATION_DEP
-extern alias PrebuiltSystem;
-using NameValueCollection = PrebuiltSystem.System.Collections.Specialized.NameValueCollection;
-#endif
-
 using System.Reflection;
 using System.Collections.Specialized;
 

+ 0 - 4
mcs/class/System/System.Configuration/ApplicationSettingsBase.cs

@@ -20,10 +20,6 @@
 // Copyright (C) 2005, 2006 Novell, Inc (http://www.novell.com)
 //
 
-#if CONFIGURATION_DEP
-extern alias PrebuiltSystem;
-using NameValueCollection = PrebuiltSystem.System.Collections.Specialized.NameValueCollection;
-#endif
 #if CONFIGURATION_DEP
 using System.IO;
 using System.Xml.Serialization;

+ 0 - 5
mcs/class/System/System.Configuration/ConfigurationSettings.cs

@@ -32,11 +32,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if CONFIGURATION_DEP
-extern alias PrebuiltSystem;
-using NameValueCollection = PrebuiltSystem.System.Collections.Specialized.NameValueCollection;
-#endif
-
 using System;
 using System.Collections;
 using System.Collections.Specialized;

+ 1 - 4
mcs/class/System/System.Configuration/CustomizableFileSettingsProvider.cs

@@ -29,11 +29,10 @@
 
 #if CONFIGURATION_DEP
 
-extern alias PrebuiltSystem;
-
 using System;
 using System.Collections;
 using System.Collections.Generic;
+using System.Collections.Specialized;
 using System.Configuration;
 using System.Globalization;
 using System.IO;
@@ -42,8 +41,6 @@ using System.Security.Cryptography;
 using System.Text;
 using System.Xml;
 
-using NameValueCollection = PrebuiltSystem.System.Collections.Specialized.NameValueCollection;
-
 namespace System.Configuration
 {
 	// location to store user configuration settings.

+ 0 - 4
mcs/class/System/System.Configuration/LocalFileSettingsProvider.cs

@@ -28,10 +28,6 @@
 //
 
 #if CONFIGURATION_DEP
-#if CONFIGURATION_DEP
-extern alias PrebuiltSystem;
-using NameValueCollection = PrebuiltSystem.System.Collections.Specialized.NameValueCollection;
-#endif
 
 using System;
 using System.Collections.Specialized;

+ 0 - 8
mcs/class/System/System.Net.Mail/SmtpClient.cs

@@ -32,20 +32,12 @@
 #if MONO_SECURITY_ALIAS
 extern alias MonoSecurity;
 #endif
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
 
 #if MONO_SECURITY_ALIAS
 using MSI = MonoSecurity::Mono.Security.Interface;
 #else
 using MSI = Mono.Security.Interface;
 #endif
-#if MONO_X509_ALIAS
-using X509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#else
-using X509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#endif
 using System.Security.Cryptography.X509Certificates;
 #endif
 

+ 0 - 4
mcs/class/System/System.Net.Security/LocalCertificateSelectionCallback.cs

@@ -29,10 +29,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 #if SECURITY_DEP && !MONO_FEATURE_NEW_TLS
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-using X509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#endif
 
 using System.Security.Cryptography.X509Certificates;
 

+ 0 - 4
mcs/class/System/System.Net.Security/RemoteCertificateValidationCallback.cs

@@ -29,10 +29,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 #if !MONO_FEATURE_NEW_TLS
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-using X509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#endif
 
 using System.Security.Cryptography.X509Certificates;
 

+ 10 - 20
mcs/class/System/System.Net.Security/SslStream.cs

@@ -27,9 +27,6 @@
 #if !MONO_FEATURE_NEW_TLS
 #if SECURITY_DEP
 
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
 #if MONO_SECURITY_ALIAS
 extern alias MonoSecurity;
 #endif
@@ -39,13 +36,6 @@ using MonoSecurity::Mono.Security.Interface;
 #else
 using Mono.Security.Interface;
 #endif
-#if MONO_X509_ALIAS
-using XSslProtocols = PrebuiltSystem::System.Security.Authentication.SslProtocols;
-using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#else
-using XSslProtocols = System.Security.Authentication.SslProtocols;
-using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#endif
 
 using CipherAlgorithmType = System.Security.Authentication.CipherAlgorithmType;
 using HashAlgorithmType = System.Security.Authentication.HashAlgorithmType;
@@ -80,7 +70,7 @@ namespace System.Net.Security
 
 	internal delegate X509Certificate LocalCertSelectionCallback (
 		string targetHost,
-		XX509CertificateCollection localCertificates,
+		X509CertificateCollection localCertificates,
 		X509Certificate remoteCertificate,
 		string[] acceptableIssuers);
 
@@ -146,9 +136,9 @@ namespace System.Net.Security
 			Impl.AuthenticateAsClient (targetHost);
 		}
 
-		public virtual void AuthenticateAsClient (string targetHost, XX509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
+		public virtual void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
 		{
-			Impl.AuthenticateAsClient (targetHost, (XX509CertificateCollection)(object)clientCertificates, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation);
+			Impl.AuthenticateAsClient (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation);
 		}
 
 		// [HostProtection (ExternalThreading=true)]
@@ -158,9 +148,9 @@ namespace System.Net.Security
 		}
 
 		// [HostProtection (ExternalThreading=true)]
-		public virtual IAsyncResult BeginAuthenticateAsClient (string targetHost, XX509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
+		public virtual IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
 		{
-			return Impl.BeginAuthenticateAsClient (targetHost, (XX509CertificateCollection)(object)clientCertificates, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
+			return Impl.BeginAuthenticateAsClient (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
 		}
 
 		public virtual void EndAuthenticateAsClient (IAsyncResult asyncResult)
@@ -175,7 +165,7 @@ namespace System.Net.Security
 
 		public virtual void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
 		{
-			Impl.AuthenticateAsServer (serverCertificate, clientCertificateRequired, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation);
+			Impl.AuthenticateAsServer (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation);
 		}
 
 		// [HostProtection (ExternalThreading=true)]
@@ -186,7 +176,7 @@ namespace System.Net.Security
 
 		public virtual IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
 		{
-			return Impl.BeginAuthenticateAsServer (serverCertificate, clientCertificateRequired, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
+			return Impl.BeginAuthenticateAsServer (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
 		}
 
 		public virtual void EndAuthenticateAsServer (IAsyncResult asyncResult)
@@ -206,9 +196,9 @@ namespace System.Net.Security
 			return Impl.AuthenticateAsClientAsync (targetHost);
 		}
 
-		public virtual Task AuthenticateAsClientAsync (string targetHost, XX509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
+		public virtual Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
 		{
-			return Impl.AuthenticateAsClientAsync (targetHost, clientCertificates, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation);
+			return Impl.AuthenticateAsClientAsync (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation);
 		}
 
 		public virtual Task AuthenticateAsServerAsync (X509Certificate serverCertificate)
@@ -218,7 +208,7 @@ namespace System.Net.Security
 
 		public virtual Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
 		{
-			return Impl.AuthenticateAsServerAsync (serverCertificate, clientCertificateRequired, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation);
+			return Impl.AuthenticateAsServerAsync (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation);
 		}
 
 		public override bool IsAuthenticated {

+ 0 - 8
mcs/class/System/System.Net/HttpConnection.cs

@@ -31,20 +31,12 @@
 #if MONO_SECURITY_ALIAS
 extern alias MonoSecurity;
 #endif
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
 
 #if MONO_SECURITY_ALIAS
 using MSI = MonoSecurity::Mono.Security.Interface;
 #else
 using MSI = Mono.Security.Interface;
 #endif
-#if MONO_X509_ALIAS
-using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#else
-using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#endif
 
 using System.IO;
 using System.Net.Sockets;

+ 0 - 4
mcs/class/System/System.Security.Authentication.ExtendedProtection.Configuration/ConfigUtil.cs

@@ -27,8 +27,6 @@
 //
 #if CONFIGURATION_DEP
 
-extern alias PrebuiltSystem;
-
 using System;
 using System.Collections;
 using System.Collections.Generic;
@@ -42,8 +40,6 @@ using System.Runtime.Serialization;
 using System.Text;
 using System.Xml;
 
-using TypeConverter = PrebuiltSystem::System.ComponentModel.TypeConverter;
-
 namespace System.Security.Authentication.ExtendedProtection.Configuration
 {
 	internal static class ConfigUtil

+ 0 - 7
mcs/class/System/System.Security.Cryptography.X509Certificates/OSX509Certificates.cs

@@ -21,15 +21,8 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 #if SECURITY_DEP
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
 
-#if MONO_X509_ALIAS
-using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#else
 using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#endif
 
 using System;
 using System.Runtime.InteropServices;

+ 2 - 5
mcs/class/System/System.Security.Cryptography.X509Certificates/X509Helper2.cs

@@ -30,9 +30,6 @@
 #if MONO_SECURITY_ALIAS
 extern alias MonoSecurity;
 #endif
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
 
 #if MONO_SECURITY_ALIAS
 using MonoSecurity::Mono.Security.Interface;
@@ -59,7 +56,7 @@ namespace System.Security.Cryptography.X509Certificates
 			var provider = MonoTlsProviderFactory.GetProvider ();
 			if (provider.HasNativeCertificates) {
 				var impl = provider.GetNativeCertificate (rawData, password, keyStorageFlags);
-				return (X509Certificate2Impl)(object)impl;
+				return impl;
 			} else {
 				var impl = new X509Certificate2ImplMono ();
 				impl.Import (rawData, password, keyStorageFlags);
@@ -72,7 +69,7 @@ namespace System.Security.Cryptography.X509Certificates
 			var provider = MonoTlsProviderFactory.GetProvider ();
 			if (provider.HasNativeCertificates) {
 				var impl = provider.GetNativeCertificate (cert);
-				return (X509Certificate2Impl)(object)impl;
+				return impl;
 			}
 			var impl2 = cert.Impl as X509Certificate2Impl;
 			if (impl2 != null)