As part of #7589
- CoreFX import only for Windows platform (no support for non-Windows platforms, see https://github.com/dotnet/corefx/issues/22510)
- left Mono managed implementation for non-Windows platforms
- removed DataProtectionScope parameter value check (no such a check in CoreFX and NET Framework, see https://github.com/dotnet/corefx/pull/30726) and couple of related unit tests
- added CoreFX xunit tests
The code in ManagedProtection.GetKey() instantiated a new RSACryptoServiceProvider singleton without proper
locking to avoid multiple threads running the initialization concurrently.
Since RSACryptoServiceProvider (or rather KeyPairPersistence underneath) uses an XML file with a name derived
from the parameters to store the data there could be a case where one thread writes while another tries to read
and gets garbage. This results in a CryptographicException later on.
Added locking to prevent this.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=38933
* CryptographicAttributeObjectCas.cs: New. CAS unit tests.
* CryptographicAttributeObjectEnumeratorCas.cs: New. CAS unit tests.
* CryptographicAttributeObjectEnumeratorTest.cs: New. Unit tests.
* CryptographicAttributeObjectCollectionCas.cs: New. CAS unit tests.
* CryptographicAttributeObjectCollectionTest.cs: New. Unit tests.
* ProtectedDataCas.cs: New. CAS unit tests.
* ProtectedDataTest.cs: Reworked/complete unit tests.
* ProtectedMemoryCas.cs: New. CAS unit tests.
* ProtectedMemoryTest.cs: Reworked/complete unit tests.
svn path=/trunk/mcs/; revision=51996
* ProtectedDataTest.cs: Updated to NUnit 2.2 API to use Ignore it the
platform doesn't support ProtectedData.
* ProtectedMemoryTest.cs: Updated to NUnit 2.2 API to use Ignore it
the platform doesn't support ProtectedData.
svn path=/trunk/mcs/; revision=43653
* System.Security.dll.sources: Added System.Security.Cryptography/
ProtectedData.cs, ProtectedMemory.cs, DataProtectionScope.cs and
MemoryProtectionScope.cs as they been moved from mscorlib to here.
* System.Security_test.dll.sources : Added Test/System.Security.
Cryptography/ProtectedDataTest.cs and ProtectedMemoryTest.cs for the
same reason.
svn path=/trunk/mcs/; revision=38060