[corlib] Remove RijndaelManaged test that makes no sense with referencesource impl
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Sun, 3 Jan 2016 16:11:46 +0000 (17:11 +0100)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Mon, 4 Jan 2016 03:05:08 +0000 (04:05 +0100)
commit528d985f29ca7d14a30210dcbb71f8dcc66a1987
tree743aa26ae17364434fed282f1c2c836716799aac
parentda63cf5b2de55db356d6278259de384593927268
[corlib] Remove RijndaelManaged test that makes no sense with referencesource impl

The CreateEncryptor_KeyNull and CreateDecryptor_KeyNull tests tried to verify the previous Mono
behavior of throwing a CryptographicException when a null key is passed to the methods [1].

However, with the move to referencesource this no longer happens since when a null key is passed
a random one is generated instead [2].

The existing tests passed out of pure luck because a different CryptographicException is thrown later on:

```
System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed.
  at System.Security.Cryptography.RijndaelManagedTransform.DecryptData (System.Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, System.Byte[]& outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean fLast) [0x007b5] in /Users/alexander/dev/mono/external/referencesource/mscorlib/system/security/cryptography/rijndaelmanagedtransform.cs:751
  at System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock (System.Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) [0x000bb] in /Users/alexander/dev/mono/external/referencesource/mscorlib/system/security/cryptography/rijndaelmanagedtransform.cs:336
  at MonoTests.System.Security.Cryptography.RijndaelManagedTest.CreateDecryptor_KeyNull () [0x00066] in /Users/alexander/dev/mono/mcs/class/corlib/Test/System.Security.Cryptography/RijndaelManagedTest.cs:233
```

Unfortunately, sometimes it happens with the random key that this exception *doesn't* get thrown as the padding is valid, which makes the test randomly fail on Jenkins.
Deleting those tests is the simplest fix.

[1] https://github.com/mono/mono/blob/mono-4.0.0-branch/mcs/class/corlib/System.Security.Cryptography/RijndaelManagedTransform.cs#L107
[2] https://github.com/mono/referencesource/blob/33edf60ec4d35aba11850872777c8b3a484ca484/mscorlib/system/security/cryptography/rijndaelmanaged.cs#L66
mcs/class/corlib/Test/System.Security.Cryptography/RijndaelManagedTest.cs