This is an automated email from the ASF dual-hosted git repository.

markt-asf pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/11.0.x by this push:
     new 63488b6bda qop is required in RFC 7616
63488b6bda is described below

commit 63488b6bda1dcc8d60022df8b8bc68d482488967
Author: Mark Thomas <[email protected]>
AuthorDate: Tue Jun 30 16:55:31 2026 +0100

    qop is required in RFC 7616
---
 .../apache/tomcat/websocket/DigestAuthenticator.java | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/java/org/apache/tomcat/websocket/DigestAuthenticator.java 
b/java/org/apache/tomcat/websocket/DigestAuthenticator.java
index 9bf5642c83..606b340c57 100644
--- a/java/org/apache/tomcat/websocket/DigestAuthenticator.java
+++ b/java/org/apache/tomcat/websocket/DigestAuthenticator.java
@@ -65,21 +65,17 @@ public class DigestAuthenticator extends Authenticator {
         String messageQop = parameterMap.get("qop");
         String algorithm = parameterMap.get("algorithm") == null ? "MD5" : 
parameterMap.get("algorithm");
         String opaque = parameterMap.get("opaque");
-
-        StringBuilder challenge = new StringBuilder();
-
-        if (messageQop != null && !messageQop.isEmpty()) {
-            if (cnonceGenerator == null) {
-                synchronized (cnonceGeneratorLock) {
-                    if (cnonceGenerator == null) {
-                        cnonceGenerator = new SecureRandom();
-                    }
+        if (cnonceGenerator == null) {
+            synchronized (cnonceGeneratorLock) {
+                if (cnonceGenerator == null) {
+                    cnonceGenerator = new SecureRandom();
                 }
             }
-
-            cNonce = cnonceGenerator.nextLong();
-            nonceCount++;
         }
+        cNonce = cnonceGenerator.nextLong();
+        nonceCount++;
+
+        StringBuilder challenge = new StringBuilder();
 
         challenge.append("Digest ");
         challenge.append("username=\"").append(userName).append("\",");


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to