Bläddra i källkod

bring Mono Security to monotouch

svn path=/trunk/mcs/; revision=141615
Jb Evain 16 år sedan
förälder
incheckning
288e614ea4
59 ändrade filer med 89 tillägg och 65 borttagningar
  1. 2 0
      mcs/class/Makefile
  2. 4 0
      mcs/class/Mono.Security/Assembly/AssemblyInfo.cs
  3. 4 0
      mcs/class/Mono.Security/Mono.Security.Protocol.Tls/DebugHelper.cs
  4. 4 3
      mcs/class/System/Makefile
  5. 2 2
      mcs/class/System/System.Net.Security/RemoteCertificateValidationCallback.cs
  6. 1 1
      mcs/class/System/System.Net/ServicePointManager.cs
  7. 4 0
      mcs/class/System/System.Net/WebConnection.cs
  8. 1 1
      mcs/class/System/System.Security.Cryptography.X509Certificates/X509Chain.cs
  9. 9 0
      mcs/class/System/monotouch_System.dll.sources
  10. 1 1
      mcs/class/corlib/Assembly/AssemblyInfo.cs
  11. 1 1
      mcs/class/corlib/Mono.Security.Authenticode/AuthenticodeBase.cs
  12. 1 1
      mcs/class/corlib/Mono.Security.Authenticode/AuthenticodeDeformatter.cs
  13. 1 1
      mcs/class/corlib/Mono.Security.Cryptography/KeyPairPersistence.cs
  14. 1 1
      mcs/class/corlib/Mono.Security.Cryptography/PKCS1.cs
  15. 4 4
      mcs/class/corlib/Mono.Security.Cryptography/SymmetricTransform.cs
  16. 1 1
      mcs/class/corlib/Mono.Security/StrongName.cs
  17. 1 1
      mcs/class/corlib/System.Reflection/Assembly.cs
  18. 3 3
      mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs
  19. 3 3
      mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate20.cs
  20. 1 1
      mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509ContentType.cs
  21. 1 1
      mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509KeyStorageFlags.cs
  22. 1 1
      mcs/class/corlib/System.Security.Cryptography/CryptoConfig.cs
  23. 1 1
      mcs/class/corlib/System.Security.Cryptography/CryptoConfig_2_1.cs
  24. 1 1
      mcs/class/corlib/System.Security.Cryptography/DES.cs
  25. 1 1
      mcs/class/corlib/System.Security.Cryptography/DESCryptoServiceProvider.cs
  26. 1 1
      mcs/class/corlib/System.Security.Cryptography/DSACryptoServiceProvider.cs
  27. 1 1
      mcs/class/corlib/System.Security.Cryptography/HMACMD5.cs
  28. 1 1
      mcs/class/corlib/System.Security.Cryptography/HMACRIPEMD160.cs
  29. 1 1
      mcs/class/corlib/System.Security.Cryptography/HMACSHA384.cs
  30. 1 1
      mcs/class/corlib/System.Security.Cryptography/HMACSHA512.cs
  31. 1 1
      mcs/class/corlib/System.Security.Cryptography/MACTripleDES.cs
  32. 1 1
      mcs/class/corlib/System.Security.Cryptography/RC2.cs
  33. 1 1
      mcs/class/corlib/System.Security.Cryptography/RC2CryptoServiceProvider.cs
  34. 1 1
      mcs/class/corlib/System.Security.Cryptography/RIPEMD160.cs
  35. 1 1
      mcs/class/corlib/System.Security.Cryptography/RIPEMD160Managed.cs
  36. 1 1
      mcs/class/corlib/System.Security.Cryptography/RSACryptoServiceProvider.cs
  37. 1 1
      mcs/class/corlib/System.Security.Cryptography/Rijndael.cs
  38. 1 1
      mcs/class/corlib/System.Security.Cryptography/RijndaelManaged.cs
  39. 1 1
      mcs/class/corlib/System.Security.Cryptography/RijndaelManagedTransform.cs
  40. 1 1
      mcs/class/corlib/System.Security.Cryptography/SHA1CryptoServiceProvider.cs
  41. 1 1
      mcs/class/corlib/System.Security.Cryptography/SHA384.cs
  42. 1 1
      mcs/class/corlib/System.Security.Cryptography/SHA384Managed.cs
  43. 1 1
      mcs/class/corlib/System.Security.Cryptography/SHA512.cs
  44. 1 1
      mcs/class/corlib/System.Security.Cryptography/SHA512Managed.cs
  45. 2 2
      mcs/class/corlib/System.Security.Cryptography/SymmetricAlgorithm.cs
  46. 1 1
      mcs/class/corlib/System.Security.Cryptography/TripleDES.cs
  47. 1 1
      mcs/class/corlib/System.Security.Cryptography/TripleDESCryptoServiceProvider.cs
  48. 1 1
      mcs/class/corlib/System.Security.Permissions/PublisherIdentityPermissionAttribute.cs
  49. 1 1
      mcs/class/corlib/System.Security.Policy/Evidence.cs
  50. 1 1
      mcs/class/corlib/System.Security.Policy/Hash.cs
  51. 1 1
      mcs/class/corlib/System.Security.Policy/HashMembershipCondition.cs
  52. 1 1
      mcs/class/corlib/System.Security.Policy/PolicyLevel.cs
  53. 1 1
      mcs/class/corlib/System.Security.Policy/PolicyLevel_2_1.cs
  54. 1 1
      mcs/class/corlib/System.Security.Policy/Zone.cs
  55. 1 1
      mcs/class/corlib/System.Security.Policy/ZoneMembershipCondition.cs
  56. 1 1
      mcs/class/corlib/System.Security/SecurityManager.cs
  57. 1 1
      mcs/class/corlib/System.Security/SecurityManager_2_1.cs
  58. 1 1
      mcs/class/corlib/System.Security/SecuritySafeCriticalAttribute.cs
  59. 1 1
      mcs/class/corlib/System.Security/SecurityTransparentAttribute.cs

+ 2 - 0
mcs/class/Makefile

@@ -144,6 +144,8 @@ monotouch_dirs := \
 	Mono.CompilerServices.SymbolWriter	\
 	System	\
 	System.XML	\
+	Mono.Security	\
+	System	\
 	System.Core	\
 	System.Json	\
 	System.Xml.Linq

+ 4 - 0
mcs/class/Mono.Security/Assembly/AssemblyInfo.cs

@@ -59,3 +59,7 @@ using System.Runtime.InteropServices;
 
 [assembly: AssemblyDelaySign (true)]
 [assembly: AssemblyKeyFile ("../mono.pub")]
+
+#if MONOTOUCH
+[assembly: InternalsVisibleTo ("System, PublicKey=00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB")]
+#endif

+ 4 - 0
mcs/class/Mono.Security/Mono.Security.Protocol.Tls/DebugHelper.cs

@@ -36,10 +36,12 @@ namespace Mono.Security.Protocol.Tls
 		{
 			if (!isInitialized)
 			{
+#if !MONOTOUCH
 				Debug.Listeners.Add(new TextWriterTraceListener(Console.Out));
 				// Debug.Listeners.Add(new TextWriterTraceListener(@"c:\ssl.log"));
 				Debug.AutoFlush = true;
 				Debug.Indent();
+#endif
 
 				isInitialized = true;
 			}
@@ -83,7 +85,9 @@ namespace Mono.Security.Protocol.Tls
 				int count = (length - i) >= 16 ? 16 : (length - i);
 				for (int j = 0; j < count; j++)
 				{
+#if !MONOTOUCH
 					Debug.Write(buffer[i + j].ToString("x2") + " ");
+#endif
 				}
 				Debug.WriteLine("");
 			}

+ 4 - 3
mcs/class/System/Makefile

@@ -26,7 +26,8 @@ TEST_MCS_FLAGS = -r:System.Drawing.dll -r:Mono.Security.dll -r:System.Data -nowa
 ifneq (1, $(FRAMEWORK_VERSION_MAJOR))
 LIB_MCS_FLAGS = -nowarn:618 -d:CONFIGURATION_2_0 -unsafe $(RESOURCE_FILES:%=-resource:%)
 TEST_MCS_FLAGS += -r:System.Configuration
-PROFILE_2_OR_4 := $(filter net_2_0 net_4_0, $(PROFILE))	
+PROFILE_2_OR_4 := $(filter net_2_0 net_4_0, $(PROFILE))
+NOT_SL := $(filter net_2_0 net_4_0 monotouch, $(PROFILE))
 endif
 
 EXTRA_DISTFILES = \
@@ -43,7 +44,7 @@ EXTRA_DISTFILES = \
 
 lib_file := $(wildcard ../lib/$(PROFILE)/System.dll)
 ifdef lib_file
-ifdef PROFILE_2_OR_4
+ifdef NOT_SL
 LIB_MCS_FLAGS += -r:PrebuiltSystem=$(lib_file)
 endif
 else
@@ -90,7 +91,7 @@ endif
 
 endif
 
-ifdef PROFILE_2_OR_4
+ifdef NOT_SL
 # $(eval $(call cyclic-dep,Mono.Security.dll,SECURITY_DEP))
 CYCLIC_DEPS += Mono.Security.dll
 ifndef USE_BOOT_COMPILE

+ 2 - 2
mcs/class/System/System.Net.Security/RemoteCertificateValidationCallback.cs

@@ -35,12 +35,12 @@ using System.Security.Cryptography.X509Certificates;
 
 namespace System.Net.Security 
 {
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 	public
 #endif
 	delegate bool RemoteCertificateValidationCallback (
 		object sender,
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 		X509Certificate certificate,
 		X509Chain chain,
 #else

+ 1 - 1
mcs/class/System/System.Net/ServicePointManager.cs

@@ -247,7 +247,7 @@ namespace System.Net
 			set { _securityProtocol = value; }
 		}
 
-#if NET_2_0 && !MONOTOUCH
+#if NET_2_0
 		public static RemoteCertificateValidationCallback ServerCertificateValidationCallback
 		{
 			get {

+ 4 - 0
mcs/class/System/System.Net/WebConnection.cs

@@ -194,6 +194,9 @@ namespace System.Net
 				if (sslStream != null)
 					return;
 
+#if MONOTOUCH && SECURITY_DEP
+				sslStream = typeof (Mono.Security.Protocol.Tls.HttpsClientStream);
+#else
 				// HttpsClientStream is an internal glue class in Mono.Security.dll
 				sslStream = Type.GetType ("Mono.Security.Protocol.Tls.HttpsClientStream, " +
 							Consts.AssemblyMono_Security, false);
@@ -204,6 +207,7 @@ namespace System.Net
 
 					throw new NotSupportedException (msg);
 				}
+#endif
 				piClient = sslStream.GetProperty ("SelectedClientCertificate");
 				piServer = sslStream.GetProperty ("ServerCertificate");
 				piTrustFailure = sslStream.GetProperty ("TrustFailure");

+ 1 - 1
mcs/class/System/System.Security.Cryptography.X509Certificates/X509Chain.cs

@@ -857,7 +857,7 @@ namespace System.Security.Cryptography.X509Certificates {
 		}
 	}
 }
-#elif NET_2_0 && !NET_2_1
+#elif NET_2_0 && (!NET_2_1 || MONOTOUCH)
 namespace System.Security.Cryptography.X509Certificates {
 	public class X509Chain {
 		public bool Build (X509Certificate2 cert)

+ 9 - 0
mcs/class/System/monotouch_System.dll.sources

@@ -48,6 +48,8 @@ System.Diagnostics/ThreadPriorityLevel.cs
 System.Diagnostics/ThreadState.cs
 System.Diagnostics/ThreadWaitReason.cs
 System.IO/MonoSyncFileStream.cs
+System.IO/MonoIO.cs
+System.IO/MonoIOError.cs
 
 System.IO.Compression/CompressionMode.cs
 System.IO.Compression/DeflateStream.cs
@@ -286,6 +288,13 @@ System.Net/UploadValuesCompletedEventHandler.cs
 System.Net/UploadStringCompletedEventHandler.cs
 System.Net/DownloadStringCompletedEventHandler.cs
 
+System.Security.Cryptography/AsnEncodedDataCollection.cs
+System.Security.Cryptography/AsnEncodedData.cs
+System.Security.Cryptography/AsnEncodedDataEnumerator.cs
+System.Security.Cryptography/OidCollection.cs
+System.Security.Cryptography/Oid.cs
+System.Security.Cryptography/OidEnumerator.cs
+
 System.Security.Cryptography.X509Certificates/OpenFlags.cs
 System.Security.Cryptography.X509Certificates/PublicKey.cs
 System.Security.Cryptography.X509Certificates/StoreLocation.cs

+ 1 - 1
mcs/class/corlib/Assembly/AssemblyInfo.cs

@@ -86,7 +86,7 @@ using System.Runtime.InteropServices;
 	[assembly: TypeLibVersion (1, 10)]
 #endif
 
-#if NET_2_1
+#if NET_2_1 && !MONOTOUCH
 	[assembly: InternalsVisibleTo ("System, PublicKey=00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB")]
 	[assembly: InternalsVisibleTo ("System.Windows, PublicKey=00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB")]
 	[assembly: InternalsVisibleTo ("System.Windows.Browser, PublicKey=00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB")]

+ 1 - 1
mcs/class/corlib/Mono.Security.Authenticode/AuthenticodeBase.cs

@@ -27,7 +27,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 
 using System;
 using System.IO;

+ 1 - 1
mcs/class/corlib/Mono.Security.Authenticode/AuthenticodeDeformatter.cs

@@ -27,7 +27,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 
 using System;
 using System.IO;

+ 1 - 1
mcs/class/corlib/Mono.Security.Cryptography/KeyPairPersistence.cs

@@ -26,7 +26,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 
 using System;
 using System.Globalization;

+ 1 - 1
mcs/class/corlib/Mono.Security.Cryptography/PKCS1.cs

@@ -77,7 +77,7 @@ namespace Mono.Security.Cryptography {
 				return emptySHA1;
 			else if (hash is SHA256)
 				return emptySHA256;
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 			else if (hash is SHA384)
 				return emptySHA384;
 			else if (hash is SHA512)

+ 4 - 4
mcs/class/corlib/Mono.Security.Cryptography/SymmetricTransform.cs

@@ -50,7 +50,7 @@ namespace Mono.Security.Cryptography {
 		private byte[] temp2;
 		private byte[] workBuff;
 		private byte[] workout;
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 		// Silverlight 2.0 does not support any feedback mode
 		private int FeedBackByte;
 		private int FeedBackIter;
@@ -81,7 +81,7 @@ namespace Mono.Security.Cryptography {
 			temp = new byte [BlockSizeByte];
 			Buffer.BlockCopy (rgbIV, 0, temp, 0, System.Math.Min (BlockSizeByte, rgbIV.Length));
 			temp2 = new byte [BlockSizeByte];
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 			FeedBackByte = (algo.FeedbackSize >> 3);
 			if (FeedBackByte != 0)
 				FeedBackIter = (int) BlockSizeByte / FeedBackByte;
@@ -185,7 +185,7 @@ namespace Mono.Security.Cryptography {
 			}
 		}
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 		// Cipher-FeedBack (CFB)
 		protected virtual void CFB (byte[] input, byte[] output) 
 		{
@@ -340,7 +340,7 @@ namespace Mono.Security.Cryptography {
 			return total;
 		}
 
-#if NET_2_0 && !NET_2_1
+#if NET_2_0 && !NET_2_1 || MONOTOUCH
 		RandomNumberGenerator _rng;
 
 		private void Random (byte[] buffer, int start, int length)

+ 1 - 1
mcs/class/corlib/Mono.Security/StrongName.cs

@@ -160,7 +160,7 @@ namespace Mono.Security {
 			get {
 				if (rsa == null)
 					return false;
-#if INSIDE_CORLIB && !NET_2_1
+#if INSIDE_CORLIB && (!NET_2_1 || MONOTOUCH)
 				// the easy way
 				if (RSA is RSACryptoServiceProvider) {
 					// available as internal for corlib

+ 1 - 1
mcs/class/corlib/System.Reflection/Assembly.cs

@@ -796,7 +796,7 @@ namespace System.Reflection {
 		}
 #endif
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 		// Code Access Security
 
 		internal void Resolve () 

+ 3 - 3
mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs

@@ -38,7 +38,7 @@ using Mono.Security.X509;
 #if NET_2_0
 using System.Runtime.Serialization;
 #endif
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 using Mono.Security.Authenticode;
 #endif
 
@@ -104,7 +104,7 @@ namespace System.Security.Cryptography.X509Certificates {
 			return new X509Certificate (data);
 		}
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 		[MonoTODO ("Incomplete - minimal validation in this version")]
 		public static X509Certificate CreateFromSignedFile (string filename)
 		{
@@ -183,7 +183,7 @@ namespace System.Security.Cryptography.X509Certificates {
 #endif
 		}
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 		[SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
 		private void InitFromHandle (IntPtr handle)
 		{

+ 3 - 3
mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate20.cs

@@ -42,7 +42,7 @@ namespace System.Security.Cryptography.X509Certificates {
 
 	[ComVisible (true)]
 	[MonoTODO ("X509ContentType.SerializedCert isn't supported (anywhere in the class)")]
-#if NET_2_1
+#if NET_2_1 && !MONOTOUCH
 	public partial class X509Certificate {
 #else
 	public partial class X509Certificate : IDeserializationCallback, ISerializable {
@@ -180,7 +180,7 @@ namespace System.Security.Cryptography.X509Certificates {
 				switch (contentType) {
 				case X509ContentType.Cert:
 					return x509.RawData;
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 				case X509ContentType.Pfx: // this includes Pkcs12
 					// TODO
 					throw new NotSupportedException ();
@@ -274,7 +274,7 @@ namespace System.Security.Cryptography.X509Certificates {
 			byte[] rawData = Load (fileName);
 			Import (rawData, (string)null, keyStorageFlags);
 		}
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 		void IDeserializationCallback.OnDeserialization (object sender)
 		{
 		}

+ 1 - 1
mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509ContentType.cs

@@ -41,7 +41,7 @@ namespace System.Security.Cryptography.X509Certificates {
 	enum X509ContentType {
 		Unknown,
 		Cert,
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 		// not supported by Silverlight 2.0 (NET_2_1)
 		SerializedCert,
 		Pfx,

+ 1 - 1
mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509KeyStorageFlags.cs

@@ -37,7 +37,7 @@ namespace System.Security.Cryptography.X509Certificates {
 	[ComVisible (true)]
 	public enum X509KeyStorageFlags	{
 		DefaultKeySet = 0,
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 		// not supported by Silverlight 2.0 (NET_2_1)
 		UserKeySet = 1,
 		MachineKeySet = 2,

+ 1 - 1
mcs/class/corlib/System.Security.Cryptography/CryptoConfig.cs

@@ -29,7 +29,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 
 using System.Collections;
 using System.Globalization;

+ 1 - 1
mcs/class/corlib/System.Security.Cryptography/CryptoConfig_2_1.cs

@@ -126,7 +126,7 @@ namespace System.Security.Cryptography {
 			}
 			return num;
 		}
-#if NET_2_1
+#if NET_2_1 && !MONOTOUCH
 		// we need SHA1 support to verify the codecs binary integrity
 		public static string MapNameToOID (string name)
 		{

+ 1 - 1
mcs/class/corlib/System.Security.Cryptography/DES.cs

@@ -28,7 +28,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 
 using System.Globalization;
 using System.Runtime.InteropServices;

+ 1 - 1
mcs/class/corlib/System.Security.Cryptography/DESCryptoServiceProvider.cs

@@ -28,7 +28,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 
 using System.Runtime.InteropServices;
 using Mono.Security.Cryptography;

+ 1 - 1
mcs/class/corlib/System.Security.Cryptography/DSACryptoServiceProvider.cs

@@ -31,7 +31,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 
 using System.IO;
 using System.Globalization;

+ 1 - 1
mcs/class/corlib/System.Security.Cryptography/HMACMD5.cs

@@ -27,7 +27,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0 && !NET_2_1
+#if NET_2_0 && !NET_2_1 || MONOTOUCH
 
 using System.Runtime.InteropServices;
 

+ 1 - 1
mcs/class/corlib/System.Security.Cryptography/HMACRIPEMD160.cs

@@ -27,7 +27,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0 && !NET_2_1
+#if NET_2_0 && !NET_2_1 || MONOTOUCH
 
 using System.Runtime.InteropServices;
 

+ 1 - 1
mcs/class/corlib/System.Security.Cryptography/HMACSHA384.cs

@@ -27,7 +27,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0 && !NET_2_1
+#if NET_2_0 && !NET_2_1 || MONOTOUCH
 
 using System.Runtime.InteropServices;
 

+ 1 - 1
mcs/class/corlib/System.Security.Cryptography/HMACSHA512.cs

@@ -27,7 +27,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0 && !NET_2_1
+#if NET_2_0 && !NET_2_1 || MONOTOUCH
 
 using System.Runtime.InteropServices;
 

+ 1 - 1
mcs/class/corlib/System.Security.Cryptography/MACTripleDES.cs

@@ -27,7 +27,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 
 using System.Runtime.InteropServices;
 

+ 1 - 1
mcs/class/corlib/System.Security.Cryptography/RC2.cs

@@ -27,7 +27,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 
 using System.Runtime.InteropServices;
 

+ 1 - 1
mcs/class/corlib/System.Security.Cryptography/RC2CryptoServiceProvider.cs

@@ -28,7 +28,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 
 using System.Globalization;
 using System.Runtime.InteropServices;

+ 1 - 1
mcs/class/corlib/System.Security.Cryptography/RIPEMD160.cs

@@ -27,7 +27,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0 && !NET_2_1
+#if NET_2_0 && !NET_2_1 || MONOTOUCH
 
 using System.Runtime.InteropServices;
 

+ 1 - 1
mcs/class/corlib/System.Security.Cryptography/RIPEMD160Managed.cs

@@ -30,7 +30,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0 && !NET_2_1
+#if NET_2_0 && !NET_2_1 || MONOTOUCH
 
 using System.Runtime.InteropServices;
 

+ 1 - 1
mcs/class/corlib/System.Security.Cryptography/RSACryptoServiceProvider.cs

@@ -29,7 +29,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 
 using System.IO;
 using System.Runtime.InteropServices;

+ 1 - 1
mcs/class/corlib/System.Security.Cryptography/Rijndael.cs

@@ -27,7 +27,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 
 using System.Runtime.InteropServices;
 

+ 1 - 1
mcs/class/corlib/System.Security.Cryptography/RijndaelManaged.cs

@@ -31,7 +31,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 
 using System.Runtime.InteropServices;
 using Mono.Security.Cryptography;

+ 1 - 1
mcs/class/corlib/System.Security.Cryptography/RijndaelManagedTransform.cs

@@ -26,7 +26,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0 && !NET_2_1
+#if NET_2_0 && !NET_2_1 || MONOTOUCH
 
 using System.Runtime.InteropServices;
 

+ 1 - 1
mcs/class/corlib/System.Security.Cryptography/SHA1CryptoServiceProvider.cs

@@ -317,7 +317,7 @@ namespace System.Security.Cryptography {
 		}
 	}
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 
 #if NET_2_0
 	[ComVisible (true)]

+ 1 - 1
mcs/class/corlib/System.Security.Cryptography/SHA384.cs

@@ -29,7 +29,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 
 using System.Runtime.InteropServices;
 

+ 1 - 1
mcs/class/corlib/System.Security.Cryptography/SHA384Managed.cs

@@ -30,7 +30,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 
 using System.Runtime.InteropServices;
 

+ 1 - 1
mcs/class/corlib/System.Security.Cryptography/SHA512.cs

@@ -29,7 +29,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 
 using System.Runtime.InteropServices;
 

+ 1 - 1
mcs/class/corlib/System.Security.Cryptography/SHA512Managed.cs

@@ -30,7 +30,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 
 using System.Runtime.InteropServices;
 

+ 2 - 2
mcs/class/corlib/System.Security.Cryptography/SymmetricAlgorithm.cs

@@ -44,7 +44,7 @@ namespace System.Security.Cryptography {
 		protected byte[] KeyValue; 
 		protected KeySizes[] LegalBlockSizesValue; 
 		protected KeySizes[] LegalKeySizesValue; 
-#if NET_2_1
+#if NET_2_1 && !MONOTOUCH
 		// Silverlight 2.0 only supports CBC
 		internal int FeedbackSizeValue;
 		internal CipherMode ModeValue;
@@ -67,7 +67,7 @@ namespace System.Security.Cryptography {
 			m_disposed = false;
 		}
 
-#if NET_2_1
+#if NET_2_1 && !MONOTOUCH
 		// No Finalizer or IDisposable.Dispose in Silverlight 2.0
 		// Documentation makes it "clear" that Clear MUST BE CALLED to zero out sensitive information
 #else		

+ 1 - 1
mcs/class/corlib/System.Security.Cryptography/TripleDES.cs

@@ -27,7 +27,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 
 using System.Globalization;
 using System.Runtime.InteropServices;

+ 1 - 1
mcs/class/corlib/System.Security.Cryptography/TripleDESCryptoServiceProvider.cs

@@ -27,7 +27,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 
 using System.Runtime.InteropServices;
 using Mono.Security.Cryptography;

+ 1 - 1
mcs/class/corlib/System.Security.Permissions/PublisherIdentityPermissionAttribute.cs

@@ -27,7 +27,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 
 using System.Runtime.InteropServices;
 using SSCX = System.Security.Cryptography.X509Certificates;

+ 1 - 1
mcs/class/corlib/System.Security.Policy/Evidence.cs

@@ -39,7 +39,7 @@ using System.Runtime.InteropServices;
 using System.Security.Permissions;
 using System.Security.Cryptography.X509Certificates;
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 using Mono.Security.Authenticode;
 #endif
 

+ 1 - 1
mcs/class/corlib/System.Security.Policy/Hash.cs

@@ -29,7 +29,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 
 using System.IO;
 using System.Reflection;

+ 1 - 1
mcs/class/corlib/System.Security.Policy/HashMembershipCondition.cs

@@ -28,7 +28,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 
 using System.Collections;
 using System.Globalization;

+ 1 - 1
mcs/class/corlib/System.Security.Policy/PolicyLevel.cs

@@ -31,7 +31,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 
 using System.Collections; // for IList
 using System.Globalization;

+ 1 - 1
mcs/class/corlib/System.Security.Policy/PolicyLevel_2_1.cs

@@ -31,7 +31,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_1
+#if NET_2_1 && !MONOTOUCH
 
 using System.Reflection;
 

+ 1 - 1
mcs/class/corlib/System.Security.Policy/Zone.cs

@@ -28,7 +28,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 
 using System.IO;
 using System.Globalization;

+ 1 - 1
mcs/class/corlib/System.Security.Policy/ZoneMembershipCondition.cs

@@ -28,7 +28,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 
 using System.Collections;
 using System.Globalization;

+ 1 - 1
mcs/class/corlib/System.Security/SecurityManager.cs

@@ -29,7 +29,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 
 using System.Collections;
 using System.Globalization;

+ 1 - 1
mcs/class/corlib/System.Security/SecurityManager_2_1.cs

@@ -29,7 +29,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_1
+#if NET_2_1 && !MONOTOUCH
 
 using System.Reflection;
 using System.Security.Policy;

+ 1 - 1
mcs/class/corlib/System.Security/SecuritySafeCriticalAttribute.cs

@@ -30,7 +30,7 @@
 
 namespace System.Security {
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 	[MonoTODO ("Only supported by the runtime when CoreCLR is enabled")]
 #endif
 	[AttributeUsage (AttributeTargets.All, AllowMultiple=false, Inherited=false)]

+ 1 - 1
mcs/class/corlib/System.Security/SecurityTransparentAttribute.cs

@@ -30,7 +30,7 @@
 
 namespace System.Security {
 
-#if !NET_2_1
+#if !NET_2_1 || MONOTOUCH
 	[MonoTODO ("Only supported by the runtime when CoreCLR is enabled")]
 #endif
 	[AttributeUsage (AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)]