summary refs log tree commit diff
path: root/crypto/src/openssl/Pkcs8Generator.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/openssl/Pkcs8Generator.cs')
-rw-r--r--crypto/src/openssl/Pkcs8Generator.cs5
1 files changed, 1 insertions, 4 deletions
diff --git a/crypto/src/openssl/Pkcs8Generator.cs b/crypto/src/openssl/Pkcs8Generator.cs
index 0674cce15..242c966d0 100644
--- a/crypto/src/openssl/Pkcs8Generator.cs
+++ b/crypto/src/openssl/Pkcs8Generator.cs
@@ -83,10 +83,7 @@ namespace Org.BouncyCastle.OpenSsl
 
 			// TODO Theoretically, the amount of salt needed depends on the algorithm
 			byte[] salt = new byte[20];
-			if (random == null)
-			{
-				random = new SecureRandom();
-			}
+			random = CryptoServicesRegistrar.GetSecureRandom(random);
 			random.NextBytes(salt);
 
 			try