summary refs log tree commit diff
path: root/crypto/test/src/ocsp/test/OCSPTestUtil.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/test/src/ocsp/test/OCSPTestUtil.cs')
-rw-r--r--crypto/test/src/ocsp/test/OCSPTestUtil.cs13
1 files changed, 6 insertions, 7 deletions
diff --git a/crypto/test/src/ocsp/test/OCSPTestUtil.cs b/crypto/test/src/ocsp/test/OCSPTestUtil.cs
index c36c3163f..381198ffd 100644
--- a/crypto/test/src/ocsp/test/OCSPTestUtil.cs
+++ b/crypto/test/src/ocsp/test/OCSPTestUtil.cs
@@ -12,8 +12,9 @@ namespace Org.BouncyCastle.Ocsp.Tests
 {
 	public class OcspTestUtil
 	{
-		public static SecureRandom rand;
-		public static IAsymmetricCipherKeyPairGenerator kpg, ecKpg;
+        public static readonly SecureRandom Random = new SecureRandom();
+
+        public static IAsymmetricCipherKeyPairGenerator kpg, ecKpg;
 		public static CipherKeyGenerator desede128kg;
 		public static CipherKeyGenerator desede192kg;
 		public static CipherKeyGenerator rc240kg;
@@ -25,18 +26,16 @@ namespace Org.BouncyCastle.Ocsp.Tests
 
 		static OcspTestUtil()
 		{
-			rand = new SecureRandom();
-
 //			kpg  = KeyPairGenerator.GetInstance("RSA");
 //			kpg.initialize(1024, rand);
 			kpg = GeneratorUtilities.GetKeyPairGenerator("RSA");
 			kpg.Init(new RsaKeyGenerationParameters(
-				BigInteger.ValueOf(0x10001), rand, 1024, 25));
+				BigInteger.ValueOf(0x10001), Random, 1024, 25));
 
 			serialNumber = BigInteger.One;
 
 			ecKpg = GeneratorUtilities.GetKeyPairGenerator("ECDSA");
-			ecKpg.Init(new KeyGenerationParameters(rand, 192));
+			ecKpg.Init(new KeyGenerationParameters(Random, 192));
 		}
 
 		public static AsymmetricCipherKeyPair MakeKeyPair()
@@ -106,7 +105,7 @@ namespace Org.BouncyCastle.Ocsp.Tests
 			_v3CertGen.AddExtension(X509Extensions.BasicConstraints, false,
 				new BasicConstraints(_ca));
 
-            X509Certificate _cert = _v3CertGen.Generate(new Asn1SignatureFactory(algorithm, _issPriv, null));
+            X509Certificate _cert = _v3CertGen.Generate(new Asn1SignatureFactory(algorithm, _issPriv, Random));
 
             _cert.CheckValidity(DateTime.UtcNow);
 			_cert.Verify(_issPub);