Author: remy.maucherat(a)jboss.com
Date: 2011-04-19 19:27:37 -0400 (Tue, 19 Apr 2011)
New Revision: 1707
Modified:
trunk/java/org/apache/catalina/connector/Request.java
trunk/webapps/docs/changelog.xml
Log:
- Use a cheaper seed method by default.
Modified: trunk/java/org/apache/catalina/connector/Request.java
===================================================================
--- trunk/java/org/apache/catalina/connector/Request.java 2011-04-19 12:34:05 UTC (rev
1706)
+++ trunk/java/org/apache/catalina/connector/Request.java 2011-04-19 23:27:37 UTC (rev
1707)
@@ -160,6 +160,10 @@
Boolean.valueOf(System.getProperty("org.apache.catalina.connector.Request.LOCAL_RANDOM",
(org.apache.tomcat.util.Constants.LOW_MEMORY) ? "false" :
"true")).booleanValue();
+ protected static final boolean SEED_WITH_GLOBAL_RANDOM =
+
Boolean.valueOf(System.getProperty("org.apache.catalina.connector.Request.SEED_WITH_GLOBAL_RANDOM",
"true")).booleanValue();
+
+
// ----------------------------------------------------------- Constructors
@@ -635,7 +639,13 @@
public void setConnector(Connector connector) {
this.connector = connector;
if (LOCAL_RANDOM) {
- random = new
SecureRandom(connector.getService().getRandom().generateSeed(16));
+ if (SEED_WITH_GLOBAL_RANDOM) {
+ byte[] seed = new byte[16];
+ connector.getService().getRandom().nextBytes(seed);
+ random = new SecureRandom(seed);
+ } else {
+ random = new
SecureRandom(connector.getService().getRandom().generateSeed(16));
+ }
} else {
random = connector.getService().getRandom();
}
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2011-04-19 12:34:05 UTC (rev 1706)
+++ trunk/webapps/docs/changelog.xml 2011-04-19 23:27:37 UTC (rev 1707)
@@ -22,6 +22,9 @@
<fix>
Add a new session id changed event to SessionListener, the Servlet API events are
not appropriate. (remm)
</fix>
+ <fix>
+ Default to a cheaper seed method for request randoms. (remm)
+ </fix>
</changelog>
</subsection>
</section>
Show replies by date