Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2011-11-07 02:09:31 -0500
committerGreg Wilkins2011-11-07 02:09:31 -0500
commit7a082280f1c55bb848cab8415dfcf8270c82fdc8 (patch)
tree107dff7346f7f9da183d1dc2aeef2c0ca72f43a7 /jetty-security/src/main/java
parent9907125cffd758237b50de85c540872067856983 (diff)
parentcb778530a47bb92f3a24b45093b66b9bbf861ca4 (diff)
downloadorg.eclipse.jetty.project-7a082280f1c55bb848cab8415dfcf8270c82fdc8.tar.gz
org.eclipse.jetty.project-7a082280f1c55bb848cab8415dfcf8270c82fdc8.tar.xz
org.eclipse.jetty.project-7a082280f1c55bb848cab8415dfcf8270c82fdc8.zip
Merge remote-tracking branch 'origin/master' into jetty-7.6
Conflicts: example-jetty-embedded/pom.xml jetty-aggregate/jetty-all-server/pom.xml jetty-aggregate/jetty-all/pom.xml jetty-aggregate/jetty-client/pom.xml jetty-aggregate/jetty-plus/pom.xml jetty-aggregate/jetty-server/pom.xml jetty-aggregate/jetty-servlet/pom.xml jetty-aggregate/jetty-webapp/pom.xml jetty-aggregate/pom.xml jetty-ajp/pom.xml jetty-annotations/pom.xml jetty-client/pom.xml jetty-client/src/main/java/org/eclipse/jetty/client/HttpConnection.java jetty-client/src/main/java/org/eclipse/jetty/client/SelectConnector.java jetty-continuation/pom.xml jetty-deploy/pom.xml jetty-distribution/pom.xml jetty-http-spi/pom.xml jetty-http/pom.xml jetty-http/src/main/java/org/eclipse/jetty/http/ssl/SslContextFactory.java jetty-io/pom.xml jetty-io/src/main/java/org/eclipse/jetty/io/nio/ChannelEndPoint.java jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectChannelEndPoint.java jetty-jaspi/pom.xml jetty-jmx/pom.xml jetty-jndi/pom.xml jetty-jsp-2.1/pom.xml jetty-monitor/pom.xml jetty-nested/pom.xml jetty-nosql/pom.xml jetty-osgi/jetty-osgi-boot-jsp/pom.xml jetty-osgi/jetty-osgi-boot-logback/pom.xml jetty-osgi/jetty-osgi-boot-warurl/pom.xml jetty-osgi/jetty-osgi-boot/pom.xml jetty-osgi/jetty-osgi-equinoxtools/pom.xml jetty-osgi/jetty-osgi-httpservice/pom.xml jetty-osgi/pom.xml jetty-osgi/test-jetty-osgi/pom.xml jetty-overlay-deployer/pom.xml jetty-plus/pom.xml jetty-policy/pom.xml jetty-rewrite/pom.xml jetty-security/pom.xml jetty-server/pom.xml jetty-servlet/pom.xml jetty-servlets/pom.xml jetty-start/pom.xml jetty-util/pom.xml jetty-util/src/test/java/org/eclipse/jetty/util/log/LogTest.java jetty-util/src/test/java/org/eclipse/jetty/util/log/NamedLogTest.java jetty-webapp/pom.xml jetty-websocket/pom.xml jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionD13.java jetty-xml/pom.xml pom.xml test-continuation-jetty6/pom.xml test-continuation/pom.xml test-jetty-nested/pom.xml test-jetty-servlet/pom.xml test-jetty-webapp/pom.xml tests/pom.xml tests/test-integration/pom.xml tests/test-loginservice/pom.xml tests/test-sessions/pom.xml tests/test-sessions/test-hash-sessions/pom.xml tests/test-sessions/test-jdbc-sessions/pom.xml tests/test-sessions/test-sessions-common/pom.xml tests/test-webapps/pom.xml tests/test-webapps/test-webapp-rfc2616/pom.xml
Diffstat (limited to 'jetty-security/src/main/java')
-rw-r--r--jetty-security/src/main/java/org/eclipse/jetty/security/authentication/DigestAuthenticator.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/DigestAuthenticator.java b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/DigestAuthenticator.java
index 08348a7a72..51833fad78 100644
--- a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/DigestAuthenticator.java
+++ b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/DigestAuthenticator.java
@@ -86,7 +86,18 @@ public class DigestAuthenticator extends LoginAuthenticator
String mna=configuration.getInitParameter("maxNonceAge");
if (mna!=null)
- _maxNonceAgeMs=Long.valueOf(mna);
+ {
+ synchronized (this)
+ {
+ _maxNonceAgeMs=Long.valueOf(mna);
+ }
+ }
+ }
+
+ /* ------------------------------------------------------------ */
+ public synchronized void setMaxNonceAge(long maxNonceAgeInMillis)
+ {
+ _maxNonceAgeMs = maxNonceAgeInMillis;
}
/* ------------------------------------------------------------ */
@@ -234,7 +245,11 @@ public class DigestAuthenticator extends LoginAuthenticator
private int checkNonce(Digest digest, Request request)
{
// firstly let's expire old nonces
- long expired = request.getTimeStamp()-_maxNonceAgeMs;
+ long expired;
+ synchronized (this)
+ {
+ expired = request.getTimeStamp()-_maxNonceAgeMs;
+ }
Nonce nonce=_nonceQueue.peek();
while (nonce!=null && nonce._ts<expired)

Back to the top