summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mscorlib/src/System/Collections/Hashtable.cs4
-rw-r--r--src/mscorlib/src/System/IO/Path.cs2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/mscorlib/src/System/Collections/Hashtable.cs b/src/mscorlib/src/System/Collections/Hashtable.cs
index fa39fc85b0..95676d0379 100644
--- a/src/mscorlib/src/System/Collections/Hashtable.cs
+++ b/src/mscorlib/src/System/Collections/Hashtable.cs
@@ -1805,6 +1805,7 @@ namespace System.Collections {
private const int bufferSize = 1024;
#if !FEATURE_CORECLR
+ private static RandomNumberGenerator rng;
#endif
private static byte[] data;
private static int currentIndex = bufferSize;
@@ -1822,8 +1823,7 @@ namespace System.Collections {
data = new byte[bufferSize];
Contract.Assert(bufferSize % 8 == 0, "We increment our current index by 8, so our buffer size must be a multiple of 8");
#if !FEATURE_CORECLR
- Microsoft.Win32.Win32Native.CryptAcquireContext(out hCryptProv, null, null,
- Microsoft.Win32.Win32Native.PROV_RSA_FULL, Microsoft.Win32.Win32Native.CRYPT_VERIFYCONTEXT);
+ rng = RandomNumberGenerator.Create();
#endif
}
diff --git a/src/mscorlib/src/System/IO/Path.cs b/src/mscorlib/src/System/IO/Path.cs
index f8f19ed690..6f247c2c33 100644
--- a/src/mscorlib/src/System/IO/Path.cs
+++ b/src/mscorlib/src/System/IO/Path.cs
@@ -908,7 +908,7 @@ namespace System.IO {
// Returns a cryptographically strong random 8.3 string that can be
// used as either a folder name or a file name.
-#if FEATURE_PAL
+#if FEATURE_CORECLR
[System.Security.SecuritySafeCritical]
#endif
public static String GetRandomFileName()