Commit Graph
186 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
Sebastien Pouliot d525ff73e1 Revert "Refresh HashAlgorithmTest to match changed NullStream behaviour in 8b9c60075f7b97fe88c3c588968977ff9bcf8c28"
This reverts commit 7ece665d16.
2014-10-02 13:44:58 -04:00
Jo Shields d171cdf5e2 Finish test changes started in 7ece665d16 2014-09-30 14:51:13 +01:00
Jo Shields 7ece665d16 Refresh HashAlgorithmTest to match changed NullStream behaviour in 8b9c60075f 2014-09-30 13:22:00 +01:00
Miguel de Icaza 0699e4da36 Fix warnings in mscorlib's Test suite + bring a couple more tests + fix thread rename test 2014-09-23 10:56:04 -04: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
Sebastien Pouliot 36ce2f7982 Fix typo in test name (confusing) 2013-02-27 20:11:10 -05:00
Sebastien Pouliot 7b7efbd2ce Fix expected value (for System.Security.Cryptography.AesManaged.FeedbackSize) to make test pass 2013-02-19 21:12:41 -05:00
Marek Safar f0f4f4ae51 More mobile tests update 2013-02-14 13:06:49 +01:00
Marek Safar afa79435aa Update for mobile profile 2013-02-07 16:34:21 +01:00
Sebastien Pouliot 888e197619 Add several tests to cover CFB mode. Some are currently disabled (CFB >8 or PaddingMode != None/Zeros) for RijndaelManaged 2013-01-06 20:08:04 -05:00
Sebastien Pouliot 59f97064d8 Revert "Fix CFB mode for Rijndael when data is not a multiple of block size"
This reverts commit e094d3dc0c.
2013-01-06 20:08:02 -05:00
Sebastien Pouliot ff506d45fb Remove NotWorking from some tests (that works now) 2013-01-06 20:08:02 -05:00
Sebastien Pouliot 5181eb820d SymmetricAlgorithm.FeedbackSize must be a multiple of 8 (bits) 2013-01-06 20:08:01 -05:00
Sebastien Pouliot e094d3dc0c Fix CFB mode for Rijndael when data is not a multiple of block size 2012-09-26 20:39:07 -04:00
Sebastien Pouliot fd0e8ab2fc Add two-keys triple-des test case (works with Mono but not with CommonCrypto, see #6968) 2012-09-07 09:18:31 -04:00
Sebastien Pouliot 2c2f569d90 Add test cases from #6510 2012-08-13 14:16:57 -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
Sebastien Pouliot a61485e0ca newer nunit does not require a [TestFixture] attribute and made those fixture fail. Making them abstract fix this 2012-05-14 09:16:28 -04:00
Marek Safar bf7d4d0e39 Convert some old unit tests 2012-04-05 15:46:25 +01:00
Sebastien Pouliot c5cdb7991b Ignore two more tests with [Category(NotWorking)] for NET_2_1/nunitlite 2012-03-23 10:15:35 -04:00
Sebastien Pouliot 11b8dd58cb Fix ArgumentOutOfRangeException in PKCS1MaskGenerationMethod + unit tests. Fix bug #3777 2012-03-23 09:10:27 -04: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
Marek Safar db7131d010 Change few Assertions to Asserts 2012-02-29 18:09:52 +00:00
Marek Safar 0c7782ddc4 Convert some old nunit tests 2012-02-27 16:59:01 +00:00
Miguel de Icaza 2852ed0b59 Update copyrights 2011-09-13 18:26:13 -04:00
Sebastien Pouliot 0466ae48a3 Adjust corlib unit tests to reduce failures when executed on the NET_2_1 profile 2011-09-09 13:43:15 -04:00
Steven Robbins 9ecad51ce4 Minor formatting change 2011-07-29 12:48:11 +01:00
Steven Robbins d76918b529 Added test case for out of bounds exception on multiple calls. 2011-07-29 12:29:15 +01:00
Atsushi Eno 607e396ef8 more: Remove obsolete nunit syntax from tests except for Assertion usage. 2011-04-06 20:14:40 +09: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
Gonzalo Paniagua Javier 7912621a54 Buffer sizes
workingBlock should be the InputBlockSize and currentBlock the
	OutputBlockSize. Allocate currentBlock lazily.

	Test contributed by Bassam Tabbara.
	Fixes bug #644740.
2010-10-08 15:31:43 -04:00
Gonzalo Paniagua Javier 8d29212331 [CryptoStream] Invalid enum in ctor
Throw on invalid enum value in the ctor.
2010-10-08 15:31:43 -04:00
Gonzalo Paniagua Javier 1ffb522d65 Dispose calls FlushFinalBlock
Dispose calls FlushFinalBlock (even for Read mode) and this in turn
	calls either FlushFinalBlock or Flush on the underlying stream.
2010-10-08 15:31:43 -04:00
Gonzalo Paniagua Javier 8fbfdf3790 Fix CryptoStream.Dispose
-Dispose will call TransformFinalBlock() for Read streams. Fixes bug #644648.
	-Dispose () will call Dispose (bool). Fixes bug #644654.
	-Stream.Close calls GC.SuppressFinalize(). Fixes bug #644660.
2010-10-07 14:59:52 -04: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 d3b0f1e249 2009-09-22 Sebastien Pouliot <[email protected]>
* CryptoStreamTest.cs: Convert to newer nunit syntax


svn path=/trunk/mcs/; revision=142413
2009-09-22 15:53:19 +00:00
Sebastien Pouliot 2890567651 2008-09-17 Sebastien Pouliot <[email protected]>
* CryptoConfigTest.cs: Add test cases for HMAC URI.


svn path=/trunk/mcs/; revision=113342
2008-09-17 18:23:59 +00:00
Néstor Salceda 6bf0d5d000 2008-07-13 Nestor Salceda <[email protected]>
* RSAPKCS1KeyExchangeFormatterTest.cs: Add test case where you are
	passing null parameters to SetKey method and constructor with
	the key as parameter.  Fixes the bug #408738.


svn path=/trunk/mcs/; revision=107829
2008-07-13 21:33:39 +00:00
Sebastien Pouliot 217e98e49a 2008-04-21 Sebastien Pouliot <[email protected]>
* HMACSHA1Test.cs: Add test case where data reside inside a byte
	array. Patch by Kazuki Oikawa.


svn path=/trunk/mcs/; revision=101295
2008-04-21 13:39:10 +00:00
Sebastien Pouliot 553ea4bc01 2008-04-17 Sebastien Pouliot <[email protected]>
* DSATest.cs: Add valid test cases with invalid xml. Update to
	NUnit 2 syntax.
	* HashAlgorithmTest.cs: Fix compiler warnings.
	* RSATest.cs: Add valid test cases with invalid xml. Update to
	NUnit 2 syntax.
	* SHA256Test.cs, SHA384Test.cs, SHA512Test.cs: Flush


svn path=/trunk/mcs/; revision=101004
2008-04-17 14:59:25 +00:00
Sebastien Pouliot b350794fc0 2008-03-04 Sebastien Pouliot <[email protected]>
* PaddingModeTest.cs: Add test case for #366623 ANSI padding bug.


svn path=/trunk/mcs/; revision=97310
2008-03-04 14:51:15 +00:00
Sebastien Pouliot 83d9a5a235 2008-02-21 Sebastien Pouliot <[email protected]>
* Rfc2898DeriveBytesTest.cs: Add test cases for consecutive calls to
	GetBytes and compare the result to a single, larger, call. Converted 
	all exitsing tests to NUnit 2.2.


svn path=/trunk/mcs/; revision=96343
2008-02-21 13:55:49 +00:00
Sebastien Pouliot 72641da16d 2008-01-02 Sebastien Pouliot <[email protected]>
* RC2CryptoServiceProviderTest.cs: Fix Create[De|En]cryptor_KeyNull 
	test case not to fail about 1 out of 256 times under the 2.0 profile.
	* TripleDESCryptoServiceProviderTest.cs: Fix Create[De|En]cryptor_KeyNull
	test case not to fail about 1 out of 256 times under the 2.0 profile.


svn path=/trunk/mcs/; revision=92119
2008-01-02 17:34:34 +00:00
Sebastien Pouliot 485df1d306 2007-11-20 Sebastien Pouliot <[email protected]>
* DESCryptoServiceProviderTest.cs: Fix CreateDecryptor_KeyNull test 
	case not to fail about 1 out of 256 times under the 2.0 profile.


svn path=/trunk/mcs/; revision=90058
2007-11-21 01:56:10 +00:00
Sebastien Pouliot 77f4e03876 2007-10-23 Sebastien Pouliot <[email protected]>
* DESCryptoServiceProviderTest.cs: Fix CreateEncryptor_KeyNull test 
	case not to fail about 1 out of 256 times under the 2.0 profile.


svn path=/trunk/mcs/; revision=88016
2007-10-23 18:45:34 +00:00
Sebastien Pouliot dcfcd9ccc6 2007-05-16 Sebastien Pouliot <[email protected]>
* CryptoStreamTest.cs: Add test cases for WriteByte.


svn path=/trunk/mcs/; revision=77517
2007-05-16 22:20:05 +00:00
Sebastien Pouliot 425435496e 2007-05-08 Randolph Chung <[email protected]>
* DSACryptoServiceProviderTest.cs: Remove "NotWorking" annotation
	for the blob tests that should now pass.


svn path=/trunk/mcs/; revision=76981
2007-05-09 02:47:31 +00:00