]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
digest: fix missing increment of 'nc' value for auth-int
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>
Sun, 3 Jul 2022 14:58:50 +0000 (17:58 +0300)
committerJay Satiro <raysatiro@yahoo.com>
Wed, 6 Jul 2022 08:14:37 +0000 (04:14 -0400)
- Increment nc regardless of qop type.

Prior to this change nc was only incremented for qop type auth even
though libcurl sends nc with any qop.

Closes https://github.com/curl/curl/pull/9090

lib/vauth/digest.c

index 16171b0210175e25e9073b86e2abb4fbea130cc0..0c18fdc7cea9de3a03669a3edf27223d18e604ab 100644 (file)
@@ -850,10 +850,8 @@ static CURLcode auth_create_digest_http_message(
                        digest->qop,
                        request_digest);
 
-    if(strcasecompare(digest->qop, "auth"))
-      digest->nc++; /* The nc (from RFC) has to be a 8 hex digit number 0
-                       padded which tells to the server how many times you are
-                       using the same nonce in the qop=auth mode */
+    /* Increment nonce-count to use another nc value for the next request */
+    digest->nc++;
   }
   else {
     response = aprintf("username=\"%s\", "