Commit Graph
226 Commits
Author SHA1 Message Date
Sebastien Pouliot b647abaadc 2010-07-21 Sebastien Pouliot <[email protected]>
* CryptoConfig_2_1.cs: Ensure Aes[Managed] can be created from
	our managed SSL/TLS implementation


svn path=/trunk/mcs/; revision=160673
2010-07-21 13:28:22 +00:00
Sebastien Pouliot a4bdc71082 2010-05-10 Sebastien Pouliot <[email protected]>
* DES.cs:
	* DESCryptoServiceProvider.cs:
	* RC2.cs:
	* RC2CryptoServiceProvider.cs:
	* TripleDES.cs:
	* TripleDESCryptoServiceProvider.cs:
		Remove !MOONLIGHT check since we need those for SSL


svn path=/trunk/mcs/; revision=157053
2010-05-10 19:50:31 +00:00
Jb Evain a3f7ce80a7 use MOONLIGHT symbol
svn path=/trunk/mcs/; revision=153667
2010-03-16 12:19:11 +00:00
Sebastien Pouliot a2e11561a7 In System:
2010-01-07  Sebastien Pouliot  <[email protected]>

	* Convert.cs: Fix line endings in ToBase64String (bug #568778)
	and also the default line length. Code changed to not require
	a BinaryReader over a MemoryStream to reduce memory requirements.

In Test/System:
2010-01-07  Sebastien Pouliot  <[email protected]>

	* ConvertTest.cs: Add test case for #568778 and the default
	line length.

In System.Security.Cryptography:
2010-01-07  Sebastien Pouliot  <[email protected]>

	* ToBase64Transform.cs: Static-ify some methods to make it easier 
	to use from System.Convert


svn path=/trunk/mcs/; revision=149171
2010-01-07 15:22:08 +00:00
Sebastien Pouliot 5f3328fa48 2009-12-01 Sebastien Pouliot <[email protected]>
* CryptoConfig_2_1.cs: Add mapping for SHA256 since it's used 
	internally in corlib (e.g. HMAC256)
	* KeySizes.cs, RandomNumberGenerator.cs, RNGCryptoServiceProvider.cs:
	Remove [ComVisible] attribute from NET_2_1 build.


svn path=/trunk/mcs/; revision=147225
2009-12-01 14:02:23 +00:00
Sebastien Pouliot 63476c73a4 In Test/System.Security.Cryptography:
2009-09-22  Sebastien Pouliot  <[email protected]> 

	* CryptoStreamTest.cs: Add (nunit-ized) test cases provided by
	Santa Marta (via Atsushi) as repro for bugs #539288 and #539229

In System.Security.Cryptography:
2009-09-22  Sebastien Pouliot  <[email protected]>

	* CryptoStream.cs: Fix [Input|Output]BlockSize for custom streams.
	Patches by Santa Marta (via Atsushi).
	[Fix bug #539288 and #539229]


svn path=/trunk/mcs/; revision=142435
2009-09-22 19:48:12 +00:00
Sebastien Pouliot 8f9c14d36a 2009-09-18 Sebastien Pouliot <[email protected]>
* RNGCryptoServiceProvider.cs: Remove unneeded SSC from NET_2_1


svn path=/trunk/mcs/; revision=142189
2009-09-18 15:06:33 +00:00
Sebastien Pouliot 68dbce7f7b 2009-07-28 Sebastien Pouliot <[email protected]>
* CryptoConfig_2_1.cs: Add SHA1 support in MapNameToOID in order to
	be able to verify the codecs signature integrity.


svn path=/trunk/mcs/; revision=138901
2009-07-28 23:39:31 +00:00
Sebastien Pouliot 708e9ef50c minor NET_2_1 tweaks to remove 12 unneeded [SecuritySafeCritical] inside Moonlight 2
svn path=/trunk/mcs/; revision=133184
2009-04-30 14:03:27 +00:00
Sebastien Pouliot a55f339a8f In Mono.Security.Cryptography:
2009-04-29  Sebastien Pouliot  <[email protected]>

	* 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  <[email protected]> 

	* 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
2009-04-29 14:23:19 +00:00
Sebastien Pouliot 3c4a82b399 In .:
2009-04-29  Sebastien Pouliot  <[email protected]>

	* corlib.dll.sources: Add CryptoConfig_2_1.cs (partial class) to
	the build

In System.Security.Cryptography:
2009-04-29  Sebastien Pouliot  <[email protected]>

	* CryptoConfig.cs: Change to partial class and don't include this
	part (#ifdef out) in the NET_2_1 build.
	* CryptoConfig_2_1.cs: Partial class that contains only what's 
	needed for Moonlight (NET_2_1). This disallow dynamically replacing
	cryptographic algorithms using machine.config


svn path=/trunk/mcs/; revision=132992
2009-04-29 12:12:36 +00:00
Sebastien Pouliot 39b0ef543d 2008-09-17 Sebastien Pouliot <[email protected]>
* CryptoConfig.cs: Add missing URI for HMAC algorithms.


svn path=/trunk/mcs/; revision=113340
2008-09-17 18:23:02 +00:00
Sebastien Pouliot f31691b185 2008-08-07 Sebastien Pouliot <[email protected]>
* SymmetricAlgorithm.cs: Hide some protected fields not present in
	Silverlight 2.0 (NET_2_1)


svn path=/trunk/mcs/; revision=109893
2008-08-07 18:13:50 +00:00
Néstor Salceda 371a1f12a9 2008-07-13 Nestor Salceda <[email protected]>
* RSAPKCS1KeyExchangeFormatter.cs: Throw an ArgumentNullException if the
	key is null in SetKey, and also in the constructor with the key
	as parameter. Fixes the bug #408738.


svn path=/trunk/mcs/; revision=107830
2008-07-13 21:34:20 +00:00
Andreas N 00f41affeb 2008-07-03 Andreas Nahr <[email protected]>
* SHA1CryptoServiceProvider.cs: Fix parameter names

svn path=/trunk/mcs/; revision=107133
2008-07-03 08:15:43 +00:00
Andreas N ca4b3b3ea2 2008-07-03 Andreas Nahr <[email protected]>
* SHA512Managed.cs:
	* SHA384Managed.cs:
	* SHA256Managed.cs:
	* SHA1Managed.cs:
	* SHA1CryptoServiceProvider.cs:
	* RSAPKCS1KeyExchangeDeformatter.cs:
	* RSACryptoServiceProvider.cs:
	* RSA.cs:
	* RIPEMD160Managed.cs:
	* RC2.cs:
	* PKCS1MaskGenerationMethod.cs:
	* MD5CryptoServiceProvider.cs:
	* MD5.cs:
	* MACTripleDES.cs:
	* HMACSHA512.cs:
	* HMACSHA384.cs:
	* HMACSHA256.cs:
	* HMACSHA1.cs:
	* HMACRIPEMD160.cs:
	* HMACMD5.cs:
	* HMAC.cs:
	* HashAlgorithm.cs:
	* FromBase64Transform.cs:
	* DSACryptoServiceProvider.cs:
	* DES.cs:
	* CspParameters.cs: Fix parameter names

svn path=/trunk/mcs/; revision=107126
2008-07-02 23:56:08 +00:00
Sebastien Pouliot fe10a7ed65 2008-05-30 Sebastien Pouliot <[email protected]>
* RSACryptoServiceProvider.cs: Remove MonoTODO that were fixed a
	while ago. Provide better MonoTODO messages for the next version 
	of MoMA.
	* RijndaelManagedTransform.cs: Provide better MonoTODO messages 
	for the next version of MoMA.


svn path=/trunk/mcs/; revision=104581
2008-05-31 02:02:58 +00:00
Sebastien Pouliot e6f76f719d SHA384Managed.cs: Fix compiler warning and use the new local variable introduced previously.
svn path=/trunk/mcs/; revision=102717
2008-05-07 12:02:06 +00:00
Alan McGovern 1387f2e8ad Inlined helper methods and made some fields local vars. Gives about 1.70x faster performance.
svn path=/trunk/mcs/; revision=102255
2008-04-30 22:51:28 +00:00
Alan McGovern 6c9c23a9f7 Inlined helper methods removed unnecessary casts and made a field a local var. Gives about 1.70x faster performance.
svn path=/trunk/mcs/; revision=102253
2008-04-30 22:16:19 +00:00
Alan McGovern 705b75a19b Performed loop unrolling and re-rolling to reduce IL size significantly and improve perf by over 30%.
svn path=/trunk/mcs/; revision=102167
2008-04-30 00:14:30 +00:00
Sebastien Pouliot 740bfbb692 SHA1CryptoServiceProvider.cs: Quick optimization to get better results with the JIT (a bit over 25% on a 4GB file).
svn path=/trunk/mcs/; revision=102008
2008-04-28 00:58:57 +00:00
Sebastien Pouliot 2e04d92d70 2008-04-17 Sebastien Pouliot <[email protected]>
* AsymmetricAlgorithm.cs: Add shared GetNamedParam helper method.
	* DSA.cs, RSA.cs: Rework FromXmlString to be more "careless" like
	MS implementation. Fix #355464


svn path=/trunk/mcs/; revision=101003
2008-04-17 14:56:26 +00:00
Sebastien Pouliot 285e144285 Rfc2898DeriveBytes.cs: Fix GetByte not to throw an exception if called several time to get more data.
svn path=/trunk/mcs/; revision=96342
2008-02-21 13:54:53 +00:00
Sebastien Pouliot 58fe0c6aba CryptoConfig.cs: Inverse name and oid when reading them from machine.config. Part of the fix for #346536
svn path=/trunk/mcs/; revision=94458
2008-01-31 13:53:35 +00:00
Sebastien Pouliot 039fd253a6 2007-08-17 Sebastien Pouliot <[email protected]>
* CryptoStream.cs: Write cannot depend on buffer.Length (fix #82428)


svn path=/trunk/mcs/; revision=84281
2007-08-17 14:26:40 +00:00
Sebastien Pouliot c821640cdf 2007-05-16 Sebastien Pouliot <[email protected]>
* CryptoStream.cs: Fix another problem that can occurs with WriteByte.


svn path=/trunk/mcs/; revision=77516
2007-05-16 22:19:45 +00:00
Sebastien Pouliot 62bb959e67 2007-05-11 Sebastien Pouliot <[email protected]>
* CryptoStream.cs: Ensure TransformFinalBlock isn't called multiple 
	times. Fix bug #81597.


svn path=/trunk/mcs/; revision=77262
2007-05-11 20:48:42 +00:00
Sebastien Pouliot 71b24f99df 2007-05-10 Sebastien Pouliot <[email protected]>
* SHA1CryptoServiceProvider.cs: Reduce by half the number of required
	memory allocations to produce a hash (in >90% of the cases) by reusing
	an existing memory buffer (instead of always allocating a new one).


svn path=/trunk/mcs/; revision=77161
2007-05-10 20:17:47 +00:00
Sebastien Pouliot c317b646d7 2007-05-08 Randolph Chung <[email protected]>
* DSACryptoServiceProvider.cs: Implement the ImportCspBlob and
	ExportCspBlob methods by calling into CryptoConvert.


svn path=/trunk/mcs/; revision=76980
2007-05-09 02:47:15 +00:00
Alp Toker 2ce100cb9e 2007-04-03 Alp Toker <[email protected]>
* CryptoConfig.cs: CreateFromName(string,object[]) is params in 2.0.


svn path=/trunk/mcs/; revision=75336
2007-04-03 10:09:37 +00:00
Sebastien Pouliot 5da746e517 2007-03-28 Sebastien Pouliot <[email protected]>
* RIPEMD160Managed.cs: Fix endian issue (take good code path).


svn path=/trunk/mcs/; revision=75092
2007-03-28 17:51:09 +00:00
Sebastien Pouliot d9fd1d5239 2007-03-22 Sebastien Pouliot <[email protected]>
* Rfc2898DeriveBytes.cs: Fixed endian bug in F (thanks to Roei Erez)
	and reduced the number of memory allocations.

svn path=/trunk/mcs/; revision=74843
2007-03-22 20:57:14 +00:00
Sebastien Pouliot c6035d7213 2007-03-22 Sebastien Pouliot <[email protected]>
* PasswordDeriveBytes.cs: Reset method was fixed in fx 2.0.

svn path=/trunk/mcs/; revision=74829
2007-03-22 19:43:04 +00:00
Sebastien Pouliot 89e0ca7f94 2007-03-22 Sebastien Pouliot <[email protected]>
* CryptoStream.cs: 2.0 introduce different exceptions/behaviors in 
	corner cases.

svn path=/trunk/mcs/; revision=74817
2007-03-22 16:48:06 +00:00
Sebastien Pouliot bd3e5f27df 2007-03-22 Sebastien Pouliot <[email protected]>
* CryptoConfig.cs: Names are case-insensitive only since fx 2.0.


svn path=/trunk/mcs/; revision=74809
2007-03-22 14:49:47 +00:00
Sebastien Pouliot eb606ae477 2007-03-05 Sebastien Pouliot <[email protected]>
* CryptoStream.cs: Rework Write to buffer the last block correctly.
	The new code also reduce memory allocations. Fix for #81008.


svn path=/trunk/mcs/; revision=73712
2007-03-05 14:26:04 +00:00
Sebastien Pouliot 647714a2f4 2007-02-14 Sebastien Pouliot <[email protected]>
* HMAC.cs: Handle BlockSizeValue correctly.
	* HMACSHA384.cs: Add support for forthcoming ProduceLegacyHmacValues
	property (in the next service pack).
	* HMACSHA512.cs: Add support for forthcoming ProduceLegacyHmacValues
	property (in the next service pack).


svn path=/trunk/mcs/; revision=72894
2007-02-15 02:03:38 +00:00
Atsushi Eno 7bce9d1c7d 2007-01-22 Atsushi Enomoto <[email protected]>
* CryptoConfig.cs: Fixed incorrect exchange in urlExcC14N and
	  urlExcC14NWithComments.


svn path=/trunk/mcs/; revision=71450
2007-01-22 17:39:57 +00:00
Sebastien Pouliot 06882c4e64 2006-11-24 Sebastien Pouliot <[email protected]>
* CryptoConfig.cs: Add support for (2.0) custom X.509 chains.


svn path=/trunk/mcs/; revision=68429
2006-11-24 14:45:18 +00:00
Sebastien Pouliot 78406f8413 2006-11-08 Sebastien Pouliot <[email protected]>
* CryptoConfig.cs: Add support for (2.0) X.509 extensions in 
	CreateFromName method. This allows the framework to be extensible with
	new certificate extensions (syntax is missing from machine.config).


svn path=/trunk/mcs/; revision=67524
2006-11-08 14:26:00 +00:00
Sebastien Pouliot 436fc7d87a 2006-10-12 Sebastien Pouliot <[email protected]>
* CryptoConfig.cs: Use SmallXmlParser with a custom handler to reduce
	memory requirements to process machine.config. Fix #79653 (beagle).


svn path=/trunk/mcs/; revision=66639
2006-10-13 00:58:50 +00:00
Sebastien Pouliot 7358d6140e 2006-10-11 Sebastien Pouliot <[email protected]>
* CryptoConfig.cs: Accept lower/mixed-case algorithm names in 
	CreateFromName and MapNameToOID methods (fix bug #79641). Removed OID
	mappings in 2.0 for DSA and 3DES (they were part of the betas but not
	in the final 2.0 release of the framework).


svn path=/trunk/mcs/; revision=66547
2006-10-11 12:44:43 +00:00
Kazuki Oikawa 1ae0c4d7ac 2006-09-20 Kazuki Oikawa <[email protected]>
* RijndaelManaged.cs: improves the performance.


svn path=/trunk/mcs/; revision=65696
2006-09-20 04:28:25 +00:00
Sebastien Pouliot 0779aca901 2006-09-08 Sebastien Pouliot <[email protected]>
* RSAOAEPKeyExchangeDeformatter.cs: Throw a CryptographicException, 
	instead of returning null, when a padding error occurs on decryption.
	* RSAPKCS1KeyExchangeDeformatter.cs: Throw a CryptographicException, 
	instead of returning null, when a padding error occurs on decryption.


svn path=/trunk/mcs/; revision=65098
2006-09-08 14:21:27 +00:00
Sebastien Pouliot 1e77aa5a9d 2006-07-01 Sebastien Pouliot <[email protected]>
* AsymmetricSignatureDeformatter.cs: Set the hash algorithm name from
	the hash instance. Fix for bug #78744 by Diego Mesa Tabares.


svn path=/trunk/mcs/; revision=62172
2006-07-01 14:52:03 +00:00
Sebastien Pouliot 674af570bf 2006-06-15 Sebastien Pouliot <[email protected]>
* HashAlgorithm.cs: Changed the order of BlockCopy + HashCore to
	HashCore + BlockCopy. Fx 2.0 now allows using a null output buffer
	(without exception) while previous 1.x versions crashed the runtime
	(mono won't crash the runtime, so we always do like 2.0).


svn path=/trunk/mcs/; revision=61765
2006-06-15 19:15:17 +00:00
Sebastien Pouliot 129324b2ca 2006-05-30 Sebastien Pouliot <[email protected]>
* AsymmetricKeyExchangeDeformatter.cs: Under 2.0 the ctor is 
	protected.
	* AsymmetricKeyExchangeFormatter.cs: Under 2.0 the ctor is protected.
	* AsymmetricSignatureDeformatter.cs: Under 2.0 the ctor is protected.
	* AsymmetricSignatureFormatter.cs: Under 2.0 the ctor is protected.
	* DES.cs: Under 2.0 the ctor is protected.
	* HashAlgorithm.cs: Under 2.0 the HashValue field is protected 
	internal.
	* RandomNumberGenerator.cs: Under 2.0 the ctor is protected.
	* RC2.cs: Under 2.0 the ctor is protected.
	* Rijndael.cs: Under 2.0 the ctor is protected.
	* RSA.cs: Under 2.0 the ctor is protected.
	* SHA256.cs: Under 2.0 the ctor is protected.
	* SHA384.cs: Under 2.0 the ctor is protected.
	* SHA512.cs: Under 2.0 the ctor is protected.
	* SymmetricAlgorithm.cs: Under 2.0 the ctor is protected.
	* TripleDES.cs: Under 2.0 the ctor is protected.


svn path=/trunk/mcs/; revision=61270
2006-05-30 17:57:47 +00:00
Zoltan Varga 61fdcc0f23 2006-02-03 Zoltan Varga <[email protected]>
* CryptoStream.cs: Add 'override' keyword to Dispose (bool) method in 2.0.

svn path=/trunk/mcs/; revision=56525
2006-02-03 14:12:56 +00:00
Sebastien Pouliot cfee5144b6 SymmetricAlgorithm.cs: Changing (not setting) BlockSize must re-generate a new IV (so the properties are kept valid). Note that changing or setting (same value) the KeySize always re-generate a key.
svn path=/trunk/mcs/; revision=54449
2005-12-15 13:46:37 +00:00