Skip to content

Commit 5ba9e20

Browse files
committed
More PORTABLE fixes
1 parent 333baf8 commit 5ba9e20

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

crypto/src/crypto/generators/OpenBsdBCrypt.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,11 @@ public static bool CheckPassword(string bcryptString, char[] password)
174174
}
175175
catch (Exception nfe)
176176
{
177+
#if PORTABLE
178+
throw new ArgumentException("Invalid cost factor: " + bcryptString.Substring(4, 2), "bcryptString");
179+
#else
177180
throw new ArgumentException("Invalid cost factor: " + bcryptString.Substring(4, 2), "bcryptString", nfe);
181+
#endif
178182
}
179183
if (cost < 4 || cost > 31)
180184
throw new ArgumentException("Invalid cost factor: " + cost + ", 4 < cost < 31 expected.");

crypto/src/crypto/prng/ThreadedSeedGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ private byte[] DoGenerateSeed(
113113
finally
114114
{
115115
#if PORTABLE
116-
autoResetEvent.Close();
116+
autoResetEvent.Dispose();
117117
#endif
118118
}
119119

0 commit comments

Comments
 (0)