From a55f339a8fd29a93a01264b96e04d3610405492b Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Wed, 29 Apr 2009 14:23:19 +0000 Subject: [PATCH] In Mono.Security.Cryptography: 2009-04-29 Sebastien Pouliot * PKCS1.cs: Make this work under NET_2_1 where SHA384 and SHA512 are not available in the BCL. In System.Security.Cryptography: 2009-04-29 Sebastien Pouliot * DES.cs, DESCryptoServiceProvider.cs: Do not include in NET_2_1 * HMACMD5.cs, HMACRIPEMD160.cs, HMACSHA384.cs, HMACSHA512.cs: Do not include in NET_2_1 * MACTripleDES.cs: Do not include in NET_2_1 * RC2.cs, RC2CryptoServiceProvider.cs: Do not include in NET_2_1 * Rijndael.cs, RijndaelManaged.cs, RijndaelManagedTransform.cs: Do not include in NET_2_1 (AES is available in System.Core.dll) * RIPEMD160.cs, RIPEMD160Managed.cs: Do not include in NET_2_1 * SHA1CryptoServiceProvider.cs: Do not include in NET_2_1, however SHA1Managed is available. * SHA384.cs, SHA384Managed.cs: Do not include in NET_2_1 * SHA512.cs, SHA512Managed.cs: Do not include in NET_2_1 * TripleDES.cs, TripleDESCryptoServiceProvider.cs: Do not include in NET_2_1 svn path=/trunk/mcs/; revision=133013 --- .../corlib/Mono.Security.Cryptography/ChangeLog | 5 +++++ .../corlib/Mono.Security.Cryptography/PKCS1.cs | 2 ++ .../System.Security.Cryptography/ChangeLog | 17 +++++++++++++++++ .../corlib/System.Security.Cryptography/DES.cs | 5 +++++ .../DESCryptoServiceProvider.cs | 5 +++++ .../System.Security.Cryptography/HMACMD5.cs | 2 +- .../HMACRIPEMD160.cs | 2 +- .../System.Security.Cryptography/HMACSHA384.cs | 2 +- .../System.Security.Cryptography/HMACSHA512.cs | 2 +- .../MACTripleDES.cs | 5 +++++ .../corlib/System.Security.Cryptography/RC2.cs | 5 +++++ .../RC2CryptoServiceProvider.cs | 5 +++++ .../System.Security.Cryptography/RIPEMD160.cs | 2 +- .../RIPEMD160Managed.cs | 2 +- .../System.Security.Cryptography/Rijndael.cs | 4 ++++ .../RijndaelManaged.cs | 5 +++++ .../RijndaelManagedTransform.cs | 2 +- .../SHA1CryptoServiceProvider.cs | 3 +++ .../System.Security.Cryptography/SHA384.cs | 4 ++++ .../SHA384Managed.cs | 5 +++++ .../System.Security.Cryptography/SHA512.cs | 4 ++++ .../SHA512Managed.cs | 5 +++++ .../System.Security.Cryptography/TripleDES.cs | 5 +++++ .../TripleDESCryptoServiceProvider.cs | 5 +++++ 24 files changed, 96 insertions(+), 7 deletions(-) diff --git a/mcs/class/corlib/Mono.Security.Cryptography/ChangeLog b/mcs/class/corlib/Mono.Security.Cryptography/ChangeLog index f56354d7873..96a0e2d4edd 100644 --- a/mcs/class/corlib/Mono.Security.Cryptography/ChangeLog +++ b/mcs/class/corlib/Mono.Security.Cryptography/ChangeLog @@ -1,3 +1,8 @@ +2009-04-29 Sebastien Pouliot + + * PKCS1.cs: Make this work under NET_2_1 where SHA384 and SHA512 + are not available in the BCL. + 2008-08-07 Sebastien Pouliot * SymmetricTransform.cs: Make this (more) usable with SL2 limited diff --git a/mcs/class/corlib/Mono.Security.Cryptography/PKCS1.cs b/mcs/class/corlib/Mono.Security.Cryptography/PKCS1.cs index 2aad2426d97..3ca015f9e3b 100644 --- a/mcs/class/corlib/Mono.Security.Cryptography/PKCS1.cs +++ b/mcs/class/corlib/Mono.Security.Cryptography/PKCS1.cs @@ -77,10 +77,12 @@ namespace Mono.Security.Cryptography { return emptySHA1; else if (hash is SHA256) return emptySHA256; +#if !NET_2_1 else if (hash is SHA384) return emptySHA384; else if (hash is SHA512) return emptySHA512; +#endif else return hash.ComputeHash ((byte[])null); } diff --git a/mcs/class/corlib/System.Security.Cryptography/ChangeLog b/mcs/class/corlib/System.Security.Cryptography/ChangeLog index c189996f571..b8022fa6f10 100644 --- a/mcs/class/corlib/System.Security.Cryptography/ChangeLog +++ b/mcs/class/corlib/System.Security.Cryptography/ChangeLog @@ -1,3 +1,20 @@ +2009-04-29 Sebastien Pouliot + + * DES.cs, DESCryptoServiceProvider.cs: Do not include in NET_2_1 + * HMACMD5.cs, HMACRIPEMD160.cs, HMACSHA384.cs, HMACSHA512.cs: Do + not include in NET_2_1 + * MACTripleDES.cs: Do not include in NET_2_1 + * RC2.cs, RC2CryptoServiceProvider.cs: Do not include in NET_2_1 + * Rijndael.cs, RijndaelManaged.cs, RijndaelManagedTransform.cs: + Do not include in NET_2_1 (AES is available in System.Core.dll) + * RIPEMD160.cs, RIPEMD160Managed.cs: Do not include in NET_2_1 + * SHA1CryptoServiceProvider.cs: Do not include in NET_2_1, however + SHA1Managed is available. + * SHA384.cs, SHA384Managed.cs: Do not include in NET_2_1 + * SHA512.cs, SHA512Managed.cs: Do not include in NET_2_1 + * TripleDES.cs, TripleDESCryptoServiceProvider.cs: Do not include + in NET_2_1 + 2009-04-29 Sebastien Pouliot * CryptoConfig.cs: Change to partial class and don't include this diff --git a/mcs/class/corlib/System.Security.Cryptography/DES.cs b/mcs/class/corlib/System.Security.Cryptography/DES.cs index 4fa766da7a3..ceb597214f7 100644 --- a/mcs/class/corlib/System.Security.Cryptography/DES.cs +++ b/mcs/class/corlib/System.Security.Cryptography/DES.cs @@ -28,6 +28,8 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // +#if !NET_2_1 + using System.Globalization; using System.Runtime.InteropServices; @@ -191,3 +193,6 @@ public abstract class DES : SymmetricAlgorithm { } } + +#endif + diff --git a/mcs/class/corlib/System.Security.Cryptography/DESCryptoServiceProvider.cs b/mcs/class/corlib/System.Security.Cryptography/DESCryptoServiceProvider.cs index d8ca27891ce..4336fe7bc04 100644 --- a/mcs/class/corlib/System.Security.Cryptography/DESCryptoServiceProvider.cs +++ b/mcs/class/corlib/System.Security.Cryptography/DESCryptoServiceProvider.cs @@ -28,6 +28,8 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // +#if !NET_2_1 + using System.Runtime.InteropServices; using Mono.Security.Cryptography; @@ -689,3 +691,6 @@ namespace System.Security.Cryptography { } } } + +#endif + diff --git a/mcs/class/corlib/System.Security.Cryptography/HMACMD5.cs b/mcs/class/corlib/System.Security.Cryptography/HMACMD5.cs index 44659b62f17..c504f567335 100644 --- a/mcs/class/corlib/System.Security.Cryptography/HMACMD5.cs +++ b/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 +#if NET_2_0 && !NET_2_1 using System.Runtime.InteropServices; diff --git a/mcs/class/corlib/System.Security.Cryptography/HMACRIPEMD160.cs b/mcs/class/corlib/System.Security.Cryptography/HMACRIPEMD160.cs index 2720e17da7b..d6cac70ee3c 100644 --- a/mcs/class/corlib/System.Security.Cryptography/HMACRIPEMD160.cs +++ b/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 +#if NET_2_0 && !NET_2_1 using System.Runtime.InteropServices; diff --git a/mcs/class/corlib/System.Security.Cryptography/HMACSHA384.cs b/mcs/class/corlib/System.Security.Cryptography/HMACSHA384.cs index 2a40ecd9939..f5d272104ac 100644 --- a/mcs/class/corlib/System.Security.Cryptography/HMACSHA384.cs +++ b/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 +#if NET_2_0 && !NET_2_1 using System.Runtime.InteropServices; diff --git a/mcs/class/corlib/System.Security.Cryptography/HMACSHA512.cs b/mcs/class/corlib/System.Security.Cryptography/HMACSHA512.cs index 09eeb5d8262..113ec2066cd 100644 --- a/mcs/class/corlib/System.Security.Cryptography/HMACSHA512.cs +++ b/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 +#if NET_2_0 && !NET_2_1 using System.Runtime.InteropServices; diff --git a/mcs/class/corlib/System.Security.Cryptography/MACTripleDES.cs b/mcs/class/corlib/System.Security.Cryptography/MACTripleDES.cs index 623efb53e79..303de11c82e 100644 --- a/mcs/class/corlib/System.Security.Cryptography/MACTripleDES.cs +++ b/mcs/class/corlib/System.Security.Cryptography/MACTripleDES.cs @@ -27,6 +27,8 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // +#if !NET_2_1 + using System.Runtime.InteropServices; using Mono.Security.Cryptography; @@ -153,3 +155,6 @@ namespace System.Security.Cryptography { } } } + +#endif + diff --git a/mcs/class/corlib/System.Security.Cryptography/RC2.cs b/mcs/class/corlib/System.Security.Cryptography/RC2.cs index e402770505e..e24eccd74fb 100644 --- a/mcs/class/corlib/System.Security.Cryptography/RC2.cs +++ b/mcs/class/corlib/System.Security.Cryptography/RC2.cs @@ -27,6 +27,8 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // +#if !NET_2_1 + using System.Runtime.InteropServices; namespace System.Security.Cryptography { @@ -92,3 +94,6 @@ namespace System.Security.Cryptography { } } } + +#endif + diff --git a/mcs/class/corlib/System.Security.Cryptography/RC2CryptoServiceProvider.cs b/mcs/class/corlib/System.Security.Cryptography/RC2CryptoServiceProvider.cs index ce49e0803a3..e43834b0efd 100644 --- a/mcs/class/corlib/System.Security.Cryptography/RC2CryptoServiceProvider.cs +++ b/mcs/class/corlib/System.Security.Cryptography/RC2CryptoServiceProvider.cs @@ -28,6 +28,8 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // +#if !NET_2_1 + using System.Globalization; using System.Runtime.InteropServices; @@ -321,3 +323,6 @@ namespace System.Security.Cryptography { }; } } + +#endif + diff --git a/mcs/class/corlib/System.Security.Cryptography/RIPEMD160.cs b/mcs/class/corlib/System.Security.Cryptography/RIPEMD160.cs index 9b936c95d78..257121e63d4 100644 --- a/mcs/class/corlib/System.Security.Cryptography/RIPEMD160.cs +++ b/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 +#if NET_2_0 && !NET_2_1 using System.Runtime.InteropServices; diff --git a/mcs/class/corlib/System.Security.Cryptography/RIPEMD160Managed.cs b/mcs/class/corlib/System.Security.Cryptography/RIPEMD160Managed.cs index 0397cf166ec..250cfa80542 100644 --- a/mcs/class/corlib/System.Security.Cryptography/RIPEMD160Managed.cs +++ b/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 +#if NET_2_0 && !NET_2_1 using System.Runtime.InteropServices; diff --git a/mcs/class/corlib/System.Security.Cryptography/Rijndael.cs b/mcs/class/corlib/System.Security.Cryptography/Rijndael.cs index 4104dfbd909..1a67b8e43ab 100644 --- a/mcs/class/corlib/System.Security.Cryptography/Rijndael.cs +++ b/mcs/class/corlib/System.Security.Cryptography/Rijndael.cs @@ -26,6 +26,8 @@ // 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 !NET_2_1 using System.Runtime.InteropServices; @@ -68,3 +70,5 @@ namespace System.Security.Cryptography { } } } +#endif + diff --git a/mcs/class/corlib/System.Security.Cryptography/RijndaelManaged.cs b/mcs/class/corlib/System.Security.Cryptography/RijndaelManaged.cs index 0cec18a0d37..a4de45bc062 100644 --- a/mcs/class/corlib/System.Security.Cryptography/RijndaelManaged.cs +++ b/mcs/class/corlib/System.Security.Cryptography/RijndaelManaged.cs @@ -31,6 +31,8 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // +#if !NET_2_1 + using System.Runtime.InteropServices; using Mono.Security.Cryptography; @@ -1460,3 +1462,6 @@ namespace System.Security.Cryptography { #endregion } } + +#endif + diff --git a/mcs/class/corlib/System.Security.Cryptography/RijndaelManagedTransform.cs b/mcs/class/corlib/System.Security.Cryptography/RijndaelManagedTransform.cs index e4bf019f610..31e20cf4918 100644 --- a/mcs/class/corlib/System.Security.Cryptography/RijndaelManagedTransform.cs +++ b/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 +#if NET_2_0 && !NET_2_1 using System.Runtime.InteropServices; diff --git a/mcs/class/corlib/System.Security.Cryptography/SHA1CryptoServiceProvider.cs b/mcs/class/corlib/System.Security.Cryptography/SHA1CryptoServiceProvider.cs index 7a96e16586d..512b04cc485 100644 --- a/mcs/class/corlib/System.Security.Cryptography/SHA1CryptoServiceProvider.cs +++ b/mcs/class/corlib/System.Security.Cryptography/SHA1CryptoServiceProvider.cs @@ -317,6 +317,8 @@ namespace System.Security.Cryptography { } } +#if !NET_2_1 + #if NET_2_0 [ComVisible (true)] #endif @@ -357,4 +359,5 @@ namespace System.Security.Cryptography { sha.Initialize (); } } +#endif // NET_2_1 } diff --git a/mcs/class/corlib/System.Security.Cryptography/SHA384.cs b/mcs/class/corlib/System.Security.Cryptography/SHA384.cs index 4ede5d50edf..23265a908dd 100644 --- a/mcs/class/corlib/System.Security.Cryptography/SHA384.cs +++ b/mcs/class/corlib/System.Security.Cryptography/SHA384.cs @@ -29,6 +29,8 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // +#if !NET_2_1 + using System.Runtime.InteropServices; namespace System.Security.Cryptography { @@ -58,3 +60,5 @@ namespace System.Security.Cryptography { } } } +#endif + diff --git a/mcs/class/corlib/System.Security.Cryptography/SHA384Managed.cs b/mcs/class/corlib/System.Security.Cryptography/SHA384Managed.cs index 3314d1559b0..04a0b46a45b 100644 --- a/mcs/class/corlib/System.Security.Cryptography/SHA384Managed.cs +++ b/mcs/class/corlib/System.Security.Cryptography/SHA384Managed.cs @@ -30,6 +30,8 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // +#if !NET_2_1 + using System.Runtime.InteropServices; namespace System.Security.Cryptography { @@ -259,3 +261,6 @@ public class SHA384Managed : SHA384 { } } + +#endif + diff --git a/mcs/class/corlib/System.Security.Cryptography/SHA512.cs b/mcs/class/corlib/System.Security.Cryptography/SHA512.cs index a17b8f2b995..6ec92207bfa 100644 --- a/mcs/class/corlib/System.Security.Cryptography/SHA512.cs +++ b/mcs/class/corlib/System.Security.Cryptography/SHA512.cs @@ -29,6 +29,8 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // +#if !NET_2_1 + using System.Runtime.InteropServices; namespace System.Security.Cryptography { @@ -58,3 +60,5 @@ namespace System.Security.Cryptography { } } } +#endif + diff --git a/mcs/class/corlib/System.Security.Cryptography/SHA512Managed.cs b/mcs/class/corlib/System.Security.Cryptography/SHA512Managed.cs index cb7d8b5b8e1..128605fb469 100644 --- a/mcs/class/corlib/System.Security.Cryptography/SHA512Managed.cs +++ b/mcs/class/corlib/System.Security.Cryptography/SHA512Managed.cs @@ -30,6 +30,8 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // +#if !NET_2_1 + using System.Runtime.InteropServices; namespace System.Security.Cryptography { @@ -282,3 +284,6 @@ public class SHA512Managed : SHA512 { } } + +#endif + diff --git a/mcs/class/corlib/System.Security.Cryptography/TripleDES.cs b/mcs/class/corlib/System.Security.Cryptography/TripleDES.cs index 4c818a3f8a2..98166aaafd4 100644 --- a/mcs/class/corlib/System.Security.Cryptography/TripleDES.cs +++ b/mcs/class/corlib/System.Security.Cryptography/TripleDES.cs @@ -27,6 +27,8 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // +#if !NET_2_1 + using System.Globalization; using System.Runtime.InteropServices; using System.Security.Cryptography; @@ -139,3 +141,6 @@ public abstract class TripleDES : SymmetricAlgorithm { } } + +#endif + diff --git a/mcs/class/corlib/System.Security.Cryptography/TripleDESCryptoServiceProvider.cs b/mcs/class/corlib/System.Security.Cryptography/TripleDESCryptoServiceProvider.cs index b0da7beb3ac..e1899ef5198 100644 --- a/mcs/class/corlib/System.Security.Cryptography/TripleDESCryptoServiceProvider.cs +++ b/mcs/class/corlib/System.Security.Cryptography/TripleDESCryptoServiceProvider.cs @@ -27,6 +27,8 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // +#if !NET_2_1 + using System.Runtime.InteropServices; using Mono.Security.Cryptography; @@ -147,3 +149,6 @@ namespace System.Security.Cryptography { } } } + +#endif + -- 2.25.1