mod_auth_digest: Be more specific when the realm mismatches because the
authorGraham Leggett <minfrin@apache.org>
Sat, 14 Sep 2013 13:48:46 +0000 (13:48 +0000)
committerGraham Leggett <minfrin@apache.org>
Sat, 14 Sep 2013 13:48:46 +0000 (13:48 +0000)
realm has not been specified.

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

CHANGES
docs/log-message-tags/next-number
modules/aaa/mod_auth_digest.c

diff --git a/CHANGES b/CHANGES
index 026428b23596a8107ba4558dec7b77d4d4164921..3d674a82c897ca265a01952fcbd41c7fda33c4dd 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_auth_digest: Be more specific when the realm mismatches because the
+     realm has not been specified. [Graham Leggett]
+
   *) mod_cache: Avoid a crash with strcmp() when the hostname is not provided.
      [Graham Leggett]
 
index 96633c95e7194125f883646d84b76f7e0ccd44aa..2c7a84e8e4dcadc1a16c6e9984f5bb2f85c03b4e 100644 (file)
@@ -1 +1 @@
-2533
+2534
index da80b7d2650ba49fad8c4d1ddd4f13b5da38e6f5..7561d8f0632e18d2696a04d186f68e52cb159089 100644 (file)
@@ -1691,7 +1691,15 @@ static int authenticate_digest_user(request_rec *r)
         return HTTP_UNAUTHORIZED;
     }
 
-    if (strcmp(resp->realm, conf->realm)) {
+    if (!conf->realm) {
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02533)
+                      "realm mismatch - got `%s' but no realm specified",
+                      resp->realm);
+        note_digest_auth_failure(r, conf, resp, 0);
+        return HTTP_UNAUTHORIZED;
+    }
+
+    if (!resp->realm || strcmp(resp->realm, conf->realm)) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01788)
                       "realm mismatch - got `%s' but expected `%s'",
                       resp->realm, conf->realm);