Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse McConnell2011-11-02 17:47:04 -0400
committerJesse McConnell2011-11-02 17:47:04 -0400
commit2b6fec713ca9bda3b49c7cf0a178663c2e47c88d (patch)
treec581de3ef2ef08f685e6cb0162b803e1c1dbc1a1 /jetty-security/src/main/java
parent6cd07bfc8686f251aa6dc3cc922f78533996f6f3 (diff)
parent81e58f1f7121abd5c584dc941845e44d8bd34b51 (diff)
downloadorg.eclipse.jetty.project-2b6fec713ca9bda3b49c7cf0a178663c2e47c88d.tar.gz
org.eclipse.jetty.project-2b6fec713ca9bda3b49c7cf0a178663c2e47c88d.tar.xz
org.eclipse.jetty.project-2b6fec713ca9bda3b49c7cf0a178663c2e47c88d.zip
Merge branch 'master' into jetty-8
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 ca5d2cd7cf..932435f985 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
@@ -87,7 +87,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;
}
/* ------------------------------------------------------------ */
@@ -235,7 +246,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