From 5ba9e204beece4bc46f7f9e39693459bea7ab06a Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Thu, 11 Oct 2018 14:03:04 +0700 Subject: More PORTABLE fixes --- crypto/src/crypto/generators/OpenBsdBCrypt.cs | 4 ++++ crypto/src/crypto/prng/ThreadedSeedGenerator.cs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'crypto/src') diff --git a/crypto/src/crypto/generators/OpenBsdBCrypt.cs b/crypto/src/crypto/generators/OpenBsdBCrypt.cs index 49f79f95b..da6e2b952 100644 --- a/crypto/src/crypto/generators/OpenBsdBCrypt.cs +++ b/crypto/src/crypto/generators/OpenBsdBCrypt.cs @@ -174,7 +174,11 @@ namespace Org.BouncyCastle.Crypto.Generators } catch (Exception nfe) { +#if PORTABLE + throw new ArgumentException("Invalid cost factor: " + bcryptString.Substring(4, 2), "bcryptString"); +#else throw new ArgumentException("Invalid cost factor: " + bcryptString.Substring(4, 2), "bcryptString", nfe); +#endif } if (cost < 4 || cost > 31) throw new ArgumentException("Invalid cost factor: " + cost + ", 4 < cost < 31 expected."); diff --git a/crypto/src/crypto/prng/ThreadedSeedGenerator.cs b/crypto/src/crypto/prng/ThreadedSeedGenerator.cs index 7412e4919..f12b832ee 100644 --- a/crypto/src/crypto/prng/ThreadedSeedGenerator.cs +++ b/crypto/src/crypto/prng/ThreadedSeedGenerator.cs @@ -113,7 +113,7 @@ namespace Org.BouncyCastle.Crypto.Prng finally { #if PORTABLE - autoResetEvent.Close(); + autoResetEvent.Dispose(); #endif } -- cgit 1.5.1