Allow to specify a random device.
authorjfclere <jfclere@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 6 Dec 2007 17:53:09 +0000 (17:53 +0000)
committerjfclere <jfclere@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 6 Dec 2007 17:53:09 +0000 (17:53 +0000)
SSLRandomSeed="/dev/random"
SSLRandomSeed="/dev/urandom"
SSLRandomSeed="builtin" (Default).
The native already exists.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@601795 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/core/AprLifecycleListener.java

index c99a5c5..d05c21f 100644 (file)
@@ -64,6 +64,7 @@ public class AprLifecycleListener
 
     // ---------------------------------------------- Properties
     protected static String SSLEngine = "on"; //default on
+    protected static String SSLRandomSeed = "builtin";
     protected static boolean sslInitialized = false;
     protected static boolean aprInitialized = false;
 
@@ -212,6 +213,12 @@ public class AprLifecycleListener
         Class clazz = Class.forName("org.apache.tomcat.jni.SSL");
         Method method = clazz.getMethod(methodName, paramTypes);
         method.invoke(null, paramValues);
+
+        methodName = "randLoad";
+        paramValues[0] = SSLRandomSeed;
+        method = clazz.getMethod(methodName, paramTypes);
+        method.invoke(null, paramValues);
         sslInitialized = true;
     }
 
@@ -223,4 +230,11 @@ public class AprLifecycleListener
         this.SSLEngine = SSLEngine;
     }
 
+    public String getSSLRandomSeed() {
+        return SSLRandomSeed;
+    }
+
+    public void setSSLRandomSeed(String SSLRandomSeed) {
+        this.SSLRandomSeed = SSLRandomSeed;
+    }
 }