]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_auth_digest: When qop is none, client doesn't send nonce count,
authorDaniel Earl Poirier <poirier@apache.org>
Wed, 9 Sep 2009 13:04:34 +0000 (13:04 +0000)
committerDaniel Earl Poirier <poirier@apache.org>
Wed, 9 Sep 2009 13:04:34 +0000 (13:04 +0000)
but module was segfaulting trying to check the nonce count anyway.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@812934 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/aaa/mod_auth_digest.c

diff --git a/CHANGES b/CHANGES
index e82595e1c8803ee7086426aeb2a386d06112dbd5..15e7645751934fca442da42d05e6c78555242b0b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,8 @@
 
 Changes with Apache 2.3.3
 
+  *) mod_auth_digest: Fix null pointer when qop=none. [Dan Poirier]
+
   *) Add support for HTTP PUT to ab. [Jeff Barnes <jbarnesweb yahoo.com>]
 
   *) ServerTokens now accepts 'Off' which disables sending of
index 6b6ee10ef44a9b102de1adc35c27b9c3d45a49b1..34dfea6c7f9454f2cdc4a0a3e9695b381358b9af 100644 (file)
@@ -1436,6 +1436,20 @@ static int check_nc(const request_rec *r, const digest_header_rec *resp,
         return OK;
     }
 
+    if ((conf->qop_list != NULL)
+        &&(conf->qop_list[0] != NULL)
+        &&!strcasecmp(conf->qop_list[0], "none")) {
+        /* qop is none, client must not send a nonce count */
+        if (snc != NULL) {
+            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+                          "Digest: invalid nc %s received - no nonce count allowed when qop=none",
+                          snc);
+            return !OK;
+        }
+        /* qop is none, cannot check nonce count */
+        return OK;
+    }
+
     nc = strtol(snc, &endptr, 16);
     if (endptr < (snc+strlen(snc)) && !apr_isspace(*endptr)) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,