Commit Graph
32 Commits
Author SHA1 Message Date
Sebastien Pouliot 3e3fe21e7f Revert "Finish test changes started in 7ece665d16714db0979bde5df254231c5be24f10"
This reverts commit d171cdf5e2.
2014-10-02 13:45:11 -04:00
Jo Shields d171cdf5e2 Finish test changes started in 7ece665d16 2014-09-30 14:51:13 +01:00
Alexander Köplinger 48e112d652 [Cleanup] Removed TARGET_JVM
It was once part of a special Java target profile, but this is no longer used today.
2014-08-08 03:28:34 +02:00
Jonathan Pryor bd130f3a2c [mscorlib] Support OID names in RSACryptoServiceProvider.SignData()
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=13953

MSDN documents that RSACryptoServiceProvider.SignData()'s provider
paramter may contain an OID name:

http://msdn.microsoft.com/en-us/library/y2wf1b6k.aspx
> The halg parameter can accept a String, a HashAlgorithm, or a Type.
> The string value can be one of the following:
> * The object identifier (OID) friendly name of the hash algorithm to use,
>   either a name registered in the crypto config file or one in the
>   Crypto API OID table.
> * The OID value. The OID must be one recognized by the Crypto API.
> For example, you could use SignData(new byte[5], "1.3.14.3.2.26") or
> SignData(new byte[5], "sha1"), or SignData(new byte[5], "SHA1").

Add support for this OID names as the provider.
2013-08-13 12:09:56 -04:00
Miguel de Icaza ae0feab435 Removal of NET_1_1 defines and some NET_2_0; Both defines are true these days in Mono, no versions prior to 2.0 are supported 2012-06-01 18:04:24 -04:00
Sebastien Pouliot 003bbd80f3 Create a store when importing from a CspBlob so we can export it with the same KeyNumber (signature vs key exchange). Fix #5299 2012-05-30 14:32:07 -04:00
Marek Safar bf7d4d0e39 Convert some old unit tests 2012-04-05 15:46:25 +01:00
Sebastien Pouliot 4e60ea839a Fix old test cases so it's easier to reuse for the mobile profile / nunitlite 2012-03-22 20:34:34 -04:00
Sebastien Pouliot 25280a542d Allow RSACryptoServiceProvider.SignHash to work with SHA-2 family
* System.Security.Cryptography/CryptoConfig.cs: Add OID for RIPEMD160
* System.Security.Cryptography/RSACryptoServiceProvider.cs: Update
GetHashNameFromOID to include SHA2-family OIDs. Remove historical
comments about 1.x FX behavior.

* Test/System.Security.Cryptography/CryptoConfigTest.cs: Add test cases
wrt RIPEMD160 OID
* Test/System.Security.Cryptography/RSACryptoServiceProviderTest.cs: Add
test case for SignHash with all FX-provided hash implementations (all
working except RIPEMD160). Remove some NET_2_0/NET_1_1 defines.
* Test/System.Security.Cryptography/RSAPKCS1SignatureFormatterTest.cs:
Remove hacks that were needed for running the tests under FX 1.x. Remove
some NET_2_0/NET_1_1 defines.
2011-01-11 10:01:56 -05:00
Sebastien Pouliot 78fa5ed2f3 2007-03-22 Sebastien Pouliot <[email protected]>
* DSACryptoServiceProviderTest.cs: Normalize line endings.
	* RSACryptoServiceProviderTest.cs: Normalize line endings.

svn path=/trunk/mcs/; revision=74822
2007-03-22 17:34:00 +00:00
Roei Erez 42930a5f97 Adding some TARGET_JVM tags.
svn path=/trunk/mcs/; revision=74388
2007-03-15 15:38:38 +00:00
Sebastien Pouliot a3f776bbdd 2007-02-14 Sebastien Pouliot <[email protected]>
* CryptoConfigTest.cs: Adjust line-endings.
	* CryptoStreamTest.cs: Adjust line-endings.
	* DESTest.cs: Adjust line-endings.
	* DSACryptoServiceProviderTest.cs: Adjust line-endings.
	* DSATest.cs: Adjust line-endings.
	* RSACryptoServiceProviderTest.cs: Adjust line-endings.


svn path=/trunk/mcs/; revision=72893
2007-02-15 02:00:27 +00:00
Sebastien Pouliot 1916ea66c9 2006-09-08 Sebastien Pouliot <[email protected]>
* RSACryptoServiceProviderTest.cs: Added test cases for decoding bad
	PKCS1 and OAEP padding - both resulting in a CryptographicException.
	* RSAOAEPKeyExchangeDeformatterTest.cs: Add test case for bad padding.
	* RSAPKCS1KeyExchangeDeformatterTest.cs: Add test case for bad padding


svn path=/trunk/mcs/; revision=65100
2006-09-08 14:23:30 +00:00
Sebastien Pouliot 31c90e9e97 2006-09-05 Sebastien Pouliot <[email protected]>
* RSACryptoServiceProviderTest.cs: Test case for #79269 where we 
	ensure a CryptographicException (not a NRE) when decrypting without a
	private key.


svn path=/trunk/mcs/; revision=64940
2006-09-05 13:53:59 +00:00
Sebastien Pouliot fe8226f28c 2005-04-27 Sebastien Pouliot <[email protected]>
* DSACryptoServiceProviderTest.cs: Catch UnauthorizedAccessException
	directly in UseMachineKeyStore (not just wrapped inside a 
	CryptographicException). 
	* RSACryptoServiceProviderTest.cs: Catch UnauthorizedAccessException
	directly in UseMachineKeyStore (not just wrapped inside a 
	CryptographicException). 


svn path=/trunk/mcs/; revision=43675
2005-04-27 18:38:36 +00:00
Ben Maurer 10452fd9a9 more failing tests
svn path=/trunk/mcs/; revision=40839
2005-02-18 04:06:05 +00:00
Ben Maurer faad63f1ab NotWorking fixes for 2.0
svn path=/trunk/mcs/; revision=40785
2005-02-17 04:04:54 +00:00
Sebastien Pouliot 5a50745c65 2005-01-11 Sebastien Pouliot <[email protected]>
* DSACryptoServiceProviderTest.cs: Fixed VerifySignatureWithoutKey to
	ensure that Mono didn't create the key before starting verification.
	* RSACryptoServiceProviderTest.cs: Added tests for PublicOnly in the
	constructor tests and for VerifyHash with a null OID.
	* RSAPKCS1SignatureFormatterTest.cs: Fixed signatures values for 
	SHA256, SHA384 and SHA512 for NET_2_0 profile. The older signatures
	(working only in Mono) can't be used because 2.0 use new OID for those
	hash algorithms. Note that this still only works with Mono in 2.0!

svn path=/trunk/mcs/; revision=38721
2005-01-11 19:42:44 +00:00
Sebastien Pouliot ff688f36c7 2004-12-23 Sebastien Pouliot <[email protected]>
* CryptoStreamTest.cs: Fixed tests to execute properly on 2.0 Nov CTP.
	* DSACryptoServiceProviderTest.cs: Fixed tests to execute properly on 
	2.0 Nov CTP.
	* PaddingModeTest.cs: Fixed tests to execute properly on 2.0 Nov CTP.
	* RSACryptoServiceProviderTest.cs: Fixed tests to execute properly on 
	2.0 Nov CTP.


svn path=/trunk/mcs/; revision=38061
2004-12-23 14:28:11 +00:00
Sebastien Pouliot 013572c39d 2004-12-06 Sebastien Pouliot <[email protected]>
* RSACryptoServiceProviderTest.cs: Adjusted unit tests to show that 
	RSACryptoServiceProvider doesn't support private keys without CRT
	parameters available - except to import the keys.


svn path=/trunk/mcs/; revision=37231
2004-12-06 20:06:35 +00:00
Sebastien Pouliot 9430317680 2004-11-03 Sebastien Pouliot <[email protected]>
* DSACryptoServiceProviderTest.cs: Fixed UseMachineKeyStore not to
	fail if the key container directory wasn't yet created (root).
	* PasswordDeriveBytesTest.cs: Added tests for NET_2_0, more tests
	for all constructors, tests for properties and a test for bug 69036.
	* RSACryptoServiceProviderTest.cs: Fixed UseMachineKeyStore not to
	fail if the key container directory wasn't yet created (root).

svn path=/trunk/mcs/; revision=35593
2004-11-03 12:05:52 +00:00
Nick Drochak 4dfe8a4760 2004-08-31 Nick Drochak <[email protected]>
* DSACryptoServiceProviderTest.cs:
	* RSACryptoServiceProviderTest.cs: Feed csc smaller bite sizes.

svn path=/trunk/mcs/; revision=33091
2004-08-31 12:17:20 +00:00
Sebastien Pouliot 1d2f1d82f4 2004-07-07 Sebastien Pouliot <[email protected]>
* AllTests2.cs: Updated to NUnit 2.2 Assert.
	* CipherModeTest.cs: New. Tests supported CipherMode for all
	SymmetricAlgorithm included in the framework (enum contains two more
	modes that aren't implemented in any Fx version).
	* CryptoConfigTest.cs: Ajusted new OID (for old names) in Fx 2.0.
	* CryptoStreamTest.cs: Fixed different reported exception in Fx 2.0.
	Fixed a bad test.
	* CspProviderFlagsTest.cs: New. Test the values of the enum.
	* DSACryptoServiceProviderTest.cs: Added new tests for new public
	properties and methods added in Fx 2.0. Duplicated test to import a
	key pair into a disposed instance (works in Fx 2.0). Removed all
	[Ignore]s in NET_2_0 as the MS class/runtime has been fixed.
	* DSASignatureDeformatterTest.cs: Converted from NUnit 1 to 2.2. Fixed
	different reported exception in Fx 2.0.
	* DSASignatureFormatterTest.cs: Converted from NUnit 1 to 2.2. Fixed
	different reported exception in Fx 2.0.
	* HMACRIPEMD160Test.cs: Fixed tests using TransformFinalBlock.
	* HMACSHA1Test.cs: Fixed tests so they work on both NET_1_1 and
	NET_2_0 profiles (as HMACSHA1 changed it's base class).
	* HashAlgorithmTest.cs: Fixed different reported exception in Fx 2.0.
	Removed [Ignore] in NET_2_0 as the MS class/runtime has been fixed.
	* MACTripleDESTest.cs: Fixed tests so they work on both NET_1_1 and
	NET_2_0 profiles.
	* PKCS1MaskGenerationMethodTest.cs: Removed [Ignore] in NET_2_0 as the
	MS class has been fixed.
	* PaddingModeTest.cs: Added new tests for the two new padding mode
	introduced in Fx 2.0. Converted to NUnit 2.2.
	* PasswordDeriveBytesTest.cs: Removed [ExpectedException] for
	StrangeBehaviour test as it is fixed in Fx 2.0.
	* RC2Test.cs: Changed exception from CryptographicException to
	CryptographicUnexpectedOperationException for Fx 1.1/2.0.
	* RIPEMD160Test.cs: Fixed tests using TransformFinalBlock.
	* RSACryptoServiceProviderTest.cs: Added new tests for new public
	properties and methods added in Fx 2.0. Duplicated test to import a
	key pair into a disposed instance (works in Fx 2.0). Duplicated test
	to sign with a null OID (Fx 2.0 use SHA1 oid in this case).
	* RSAOAEPKeyExchangeDeformatterTest.cs: Changed exception for a key
	exchange with no key (to match Fx 2.0).
	* RSAOAEPKeyExchangeFormatterTest.cs: Changed exception for a key
	exchange with no key (to match Fx 2.0).
	* RSAPKCS1KeyExchangeFormatterTest.cs: Changed exception for a key
	exchange with no key (to match Fx 2.0). Removed [Ignore] in NET_2_0 as
	the MS class/runtime has been fixed.
	* RSAPKCS1SignatureDeformatterTest.cs: Null keys, in constructor or in
	SetKey method, now throw an ArgumentNullException in Fx 2.0.
	* RSAPKCS1SignatureFormatterTest.cs: Null keys, in constructor or in
	SetKey method, now throw an ArgumentNullException in Fx 2.0.
	* Rfc2898DeriveBytesTest.cs: Typecasted a null as a string.
	* SymmetricAlgorithm2Test.cs: In Fx 2.0 an empty IV now throws a
	CryptographicException.
	* ToBase64TransformTest.cs: Fixed different reported exception in Fx 2.0.
	Removed [Ignore] in NET_2_0 as the MS class/runtime has been fixed.

svn path=/trunk/mcs/; revision=30836
2004-07-07 14:20:04 +00:00
Sebastien Pouliot 2584b0aaf2 2004-05-20 Sebastien Pouliot <[email protected]>
* CryptoStreamTest.cs, DESCryptoServiceProviderTest.cs,
	DSACryptoServiceProviderTest.cs, DSATest.cs, FromBase64Transform.cs,
	HMACRIPEMD160Test.cs, MD5Test.cs, PKCS1MaskGenerationMethodTest.cs,
	RIPEMD160ManagedTest.cs, RNGCryptoServiceProviderTest.cs,
	RSACryptoServiceProviderTest.cs, RSAOAEPKeyExchangeDeformatterTest.cs,
	RSAOAEPKeyExchangeFormatterTest.cs, RSAPKCS1KeyExchangeDeformatterTest.cs,
	RSAPKCS1KeyExchangeFormatterTest.cs, RSAPKCS1SignatureDeformatterTest.cs,
	RSAPKCS1SignatureFormatterTest.cs, RSATest.cs: SetUp/TearDown are now
	public (required for new nunit).

svn path=/trunk/mcs/; revision=27790
2004-05-21 01:03:41 +00:00
Sebastien Pouliot 2b7558c4f7 2004-05-07 Sebastien Pouliot <[email protected]>
* RSACryptoServiceProviderTest.cs: Oops wrong exception for SignHashNullOID.

svn path=/trunk/mcs/; revision=26921
2004-05-07 14:23:46 +00:00
Sebastien Pouliot a6aa68e2f6 2004-05-07 Sebastien Pouliot <[email protected]>
* PasswordDerivceBytesTest.cs: Added new tests to complete
	coverage.
	* RSACryptoServiceProviderTest.cs: Added new tests to complete
	coverage.

svn path=/trunk/mcs/; revision=26919
2004-05-07 14:01:55 +00:00
Sebastien Pouliot acecbdf941 2004-02-09 Sebastien Pouliot <[email protected]>
* DSACryptoServiceProvider.cs: Added new unit tests for key pair
	persistence.
	* RSACryptoServiceProvider.cs: Added new unit tests for key pair
	persistence.

svn path=/trunk/mcs/; revision=22898
2004-02-09 14:20:15 +00:00
Sebastien Pouliot 2f70adac08 2003-07-31 Sebastien Pouliot <[email protected]>
* CryptoStreamTest.cs: New. Very basic test for CryptoStream + the
	test case from bugzilla #46143 from Joerg Rosenkranz.
	* RSACryptoServiceProviderTest.cs: Fixed some exceptions that are
	different from .NET 1.0 and 1.1.

svn path=/trunk/mcs/; revision=16954
2003-07-31 20:55:16 +00:00
Sebastien Pouliot 350e3b4574 2003-07-05 Sebastien Pouliot <[email protected]>
* DSACryptoServiceProviderTest.cs: Added news unit tests for Dispose/Clear
	and better test coverage (based on Zoltan's logs).
	* DSATest.cs: Converted to NUnit2 format. Added new tests for better unit
	test coverage (import incomplete public keys).
	* RSACryptoServiceProviderTest.cs: Added news unit tests for Dispose/Clear
	and better test coverage (based on Zoltan's logs).
	* RSATest.cs: Converted to NUnit2 format. Added new tests for better unit
	test coverage (import incomplete public keys).

svn path=/trunk/mcs/; revision=15974
2003-07-06 02:56:40 +00:00
Sebastien Pouliot 4006f91139 2003-06-11 Sebastien Pouliot <[email protected]>
* AllTests2.cs: Converted tests to NUnit2 format.
	* RSACryptoServiceProviderTest.cs: Converted tests to NUnit2 format.
	* RSAPKCS1KeyExchangeDeformatterTest.cs: Converted tests to NUnit2 format.
	* RSAPKCS1KeyExchangeFormatterTest.cs: Converted tests to NUnit2 format.
	* RSAPKCS1SignatureDeformatterTest.cs: Converted tests to NUnit2 format.
	* RSAPKCS1SignatureFormatterTest.cs: Converted tests to NUnit2 format.

svn path=/trunk/mcs/; revision=15334
2003-06-12 02:03:46 +00:00
Nick Drochak 99a25b98bd 2002-12-21 Nick Drochak <[email protected]>
* all: make tests build and run under nunit2

svn path=/trunk/mcs/; revision=9817
2002-12-21 14:15:43 +00:00
Sebastien Pouliot b5aca35af8 2002-11-17 Sebastien Pouliot <[email protected]>
* AllTests.cs: Added a common RSA keypair for tests and all RSA
	suites for new tests.
	* RSACryptoServiceProviderTest.cs: Include tests for keygen,
	import/export and signature (no encryption yet).
	* RSAOAEPKeyExchangeDeformatterTest.cs: Compare results with
	pre-generated vectors from Mono/Windows (cannot yet compare
	with CryptoAPI/Windows as OAEP isn't available on my system).
	* RSAOAEPKeyExchangeFormatterTest.cs: Test that the Formatter output
	is compatible with the Deformatter.
	* RSAPKCS1KeyExchangeDeformatterTest.cs: Compare results with
	pre-generated vectors from Mono/Windows and CryptoAPI/Windows.
	* RSAPKCS1KeyExchangeFormatterTest.cs: Test that the Formatter output
	is compatible with the Deformatter.
	* RSAPKCS1SignatureDeformatterTest.cs: Compare results with
	pre-generated vectors from Mono/Windows and CryptoAPI/Windows.
	* RSAPKCS1SignatureFormatterTest.cs: Test that the Formatter output
	is compatible with the Deformatter.

svn path=/trunk/mcs/; revision=9036
2002-11-17 21:54:09 +00:00