Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jetty-security/src/main/java/org/eclipse/jetty/security/authentication/DigestAuthenticator.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