* 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
* DSACryptoServiceProvider.cs: Implement the ImportCspBlob and
ExportCspBlob methods by calling into CryptoConvert.
svn path=/trunk/mcs/; revision=76980
* Rfc2898DeriveBytes.cs: Fixed endian bug in F (thanks to Roei Erez)
and reduced the number of memory allocations.
svn path=/trunk/mcs/; revision=74843
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* DSAManaged.cs: Don't output J in the XML if it's not exported (i.e.
if it wasn't imported too but instead calculated from the other
parameters ;-).
svn path=/trunk/mcs/; revision=53356
* DESCryptoServiceProvider.cs: Don't change the instance key/iv when
creating an encryptor or decryptor specifying them. Generate a new key
if null is specified (not really useful but compatible with MS
behaviour). Check for weak/semi-weak key when creating transforms.
* RC2CryptoServiceProvider.cs: Don't change the instance key/iv when
creating an encryptor or decryptor specifying them. Check legal key
sizes when creating transforms.
* RijndaelManaged.cs: Don't change the instance key/iv when creating
an encryptor or decryptor specifying them. Check legal key sizes when
creating transforms.
* TripleDESCryptoServiceProvider.cs: Don't change the instance key/iv
when creating an encryptor or decryptor specifying them. Generate a
new key if null is specified (not really useful but compatible with MS
behaviour). Check for weak key when creating transforms.
svn path=/trunk/mcs/; revision=52043
* HMACSHA1.cs: Added the new 2.0 ctor that let the programmer choose
between the managed and unmanaged SHA1 algorithm used in the HMAC
(that doesn't change much thing in the default config for Mono).
* PasswordDeriveBytes.cs: Added [Obsolete] on GetBytes (2.0) as new
applications should be using Rfc2898DeriveBytes to get PKCS#5 v2
support.
svn path=/trunk/mcs/; revision=51010
* FromBase64Transform.cs: Check that the TransformFinal can be called
with only whitespace (with FromBase64TransformMode.IgnoreWhiteSpaces)
so that we must return new byte [0].
svn path=/trunk/mcs/; revision=48473
* FromBase64Transform.cs: Removed memory allocations during the
transform. It's now just the accumulator (ctor) and the
TransformFinalBlock that allocates memory. The transform is now
between 3 to 4 times faster than before.
svn path=/trunk/mcs/; revision=45947
* CryptoConfig.cs: Initialization wasn't threadsafe as the "checked"
value was assigned at the start of the initialization.
svn path=/trunk/mcs/; revision=44560
* CryptoConfig.cs: Removed RSA OID and added null check in EncodeOID
in NET_2_0 to match beta2.
* DES.cs: Added null check for IsWeakKey and IsSemiWeakKey in NET_2_0
to match beta2.
* SymmetricAlgorithm.cs: Throw CryptographicException when feedback is
zero in NET_2_0 to match beta2
* TripleDES.cs: Added null check for IsWeakKey in NET_2_0 to match
beta2.
svn path=/trunk/mcs/; revision=43554
* CryptoConfig.cs: Added Assert for FileIOPermission to LoadConfig so
the configuration can be read under partial trust.
svn path=/trunk/mcs/; revision=42585
* CryptoConfig.cs: Added LinkDemand for unrestricted to CreateFromName
when used to create instance with object[] parameters.
* CryptoAPITransform.cs: Added Demand for UnmanagedCode to KeyHandle
property.
svn path=/trunk/mcs/; revision=42205
* MD5CryptoServiceProvider.cs: Fixed#73404 to return right results
if the data length is bigger than 2^32 bits.
* SHA1CryptoServiceProvider.cs: Fixed#73404 to return right results
if the data length is bigger than 2^32 bits.
* SHA256Managed.cs: Fixed#73404 to return right results if the data
length is bigger than 2^32 bits.
svn path=/trunk/mcs/; revision=41524
* RNGCryptoServiceProvider.cs: Added a new call in the static ctor
to check if we're using a global handle. In that case we lock before
calling the RNG.
svn path=/trunk/mcs/; revision=41403
* DSA.cs: Weekly fix to case where DSAParameters.Counter is 0 :-(
A new unit test was added for this specific case so it's hopefully
the last fix for this. Fixed exception reporting to match NET_2_0.
svn path=/trunk/mcs/; revision=40406
* DSACryptoServiceProvider.cs: Import|ExportCspBlob throws
NotImplementedException (CryptoConvert class doesn't support DSA yet).
* RSACryptoServiceProvider.cs: SignHash/VerifyHash defaults to SHA-1
in 2.0. VerifyHash throw appropriate exception when no OID is
specified (1.0/1.1). Import|ExportCspBlob implemented using the
CryptoConvert class.
* RSAOAEPKeyExchangeDeformatter.cs: Throw exception if no key is
specified.
* RSAOAEPKeyExchangeFormatter.cs: Throw exception if no key is
specified.
* RSAPKCS1KeyExchangeFormatter.cs: Throw exception if no key is
specified.
* SymmetricAlgorithm.cs: More strict IV length checks on 2.0.
svn path=/trunk/mcs/; revision=38723
* CryptoConfig.cs: Added support to create RIPEMD160 and the new HMAC
algorithms (HMACMD5, HMACRIPEMD160, HMACSHA256, HMACSHA384 and
HMACSHA512). This fix the unit tests failures in Mono.Security.dll in
the NET_2_0 profile.
svn path=/trunk/mcs/; revision=38685
* CryptoConfig.cs: Change the OID for SHA-2 algorithms to match 2.0
and added new OID for asymmetric and symmetric algorithms.
* CspKeyContainerInfo.cs: Added CryptoKeySecurity property. This will
always return null until we support access control for key containers.
* CspParameters.cs: Added new constructors and propertys for access
control and password (2.0).
* DSASignatureDeformatter.cs: Throw ArgumentNullException in NET_2_0
if a null key is specified.
* DSASignatureFormatter.cs: Throw ArgumentNullException in NET_2_0 if
a null key is specified.
* HashAlgorithm.cs: Fix the reported exceptions for output buffers.
* HMAC.cs: Change the .Clear (which calls Dispose) to a .Initialize.
* MACTripleDES.cs: Removed unrequired private field _padding.
* PasswordDeriveBytes.cs: Added 4 new constructors where the password
is a byte[] (as it seems MS won't be using SecureString for this).
* RIPEMD160Managed.cs: Removed overriden Dispose method to match 2.0.
Clear buffers when initializing (e.g. re-using the hash instance).
* Rfc2898DeriveBytes.cs: Added a new constructor where the password
is a byte[] (as it seems MS won't be using SecureString for this).
* RSAPKCS1SignatureDeformatter.cs: Throw ArgumentNullException in
NET_2_0 if a null key is specified.
* RSAPKCS1SignatureFormatter.cs: Throw ArgumentNullException in
NET_2_0 if a null key is specified.
* ToBase64Transform.cs: Fix the reported exceptions for output buffers.
svn path=/trunk/mcs/; revision=38667