summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2013-11-11 16:19:25 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2013-11-11 16:19:25 +0700
commit442ab775f681714fad5e4cb0a85bc035f249945f (patch)
tree667f7d1a11965042b8001d6c976a9019b1002790
parentDon't require there to be any digests, to allow in particular for a certs-onl... (diff)
downloadBouncyCastle.NET-ed25519-442ab775f681714fad5e4cb0a85bc035f249945f.tar.xz
Auto-initialize random if necessary
-rw-r--r--crypto/src/crypto/generators/ECKeyPairGenerator.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/crypto/src/crypto/generators/ECKeyPairGenerator.cs b/crypto/src/crypto/generators/ECKeyPairGenerator.cs
index 8f2b1c2b5..a936755e2 100644
--- a/crypto/src/crypto/generators/ECKeyPairGenerator.cs
+++ b/crypto/src/crypto/generators/ECKeyPairGenerator.cs
@@ -81,6 +81,11 @@ namespace Org.BouncyCastle.Crypto.Generators
             }
 
             this.random = parameters.Random;
+
+            if (this.random == null)
+            {
+                this.random = new SecureRandom();
+            }
         }
 
         /**