summaryrefslogtreecommitdiffstats
path: root/modules/aaa/mod_auth_digest.c
diff options
context:
space:
mode:
authorStefan Fritsch <sf@apache.org>2010-07-04 23:16:53 +0200
committerStefan Fritsch <sf@apache.org>2010-07-04 23:16:53 +0200
commiteedf13033285d80373548093b26b87330db872e3 (patch)
tree6ef2594bf7e2ea93565bee5701921ef17fb0efda /modules/aaa/mod_auth_digest.c
parentRemove superfluous EOL from mod_rewrite logging. (diff)
downloadapache2-eedf13033285d80373548093b26b87330db872e3.tar.xz
apache2-eedf13033285d80373548093b26b87330db872e3.zip
Introduce note_auth_failure hook to allow modules to add support
for additional auth types. This makes ap_note_auth_failure() work with mod_auth_digest again. PR: 48807 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@960399 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/aaa/mod_auth_digest.c')
-rw-r--r--modules/aaa/mod_auth_digest.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/modules/aaa/mod_auth_digest.c b/modules/aaa/mod_auth_digest.c
index e69f0795a5..8506f1b7ca 100644
--- a/modules/aaa/mod_auth_digest.c
+++ b/modules/aaa/mod_auth_digest.c
@@ -1369,6 +1369,39 @@ static void note_digest_auth_failure(request_rec *r,
}
+static int hook_note_digest_auth_failure(request_rec *r, const char *auth_type)
+{
+ request_rec *mainreq;
+ digest_header_rec *resp;
+ digest_config_rec *conf;
+
+ if (strcasecmp(auth_type, "Digest"))
+ return DECLINED;
+
+ /* get the client response and mark */
+
+ mainreq = r;
+ while (mainreq->main != NULL) {
+ mainreq = mainreq->main;
+ }
+ while (mainreq->prev != NULL) {
+ mainreq = mainreq->prev;
+ }
+ resp = (digest_header_rec *) ap_get_module_config(mainreq->request_config,
+ &auth_digest_module);
+ resp->needed_auth = 1;
+
+
+ /* get our conf */
+
+ conf = (digest_config_rec *) ap_get_module_config(r->per_dir_config,
+ &auth_digest_module);
+
+ note_digest_auth_failure(r, conf, resp, 0);
+
+ return OK;
+}
+
/*
* Authorization header verification code
@@ -2054,6 +2087,9 @@ static void register_hooks(apr_pool_t *p)
AP_AUTH_INTERNAL_PER_CONF);
ap_hook_fixups(add_auth_info, NULL, NULL, APR_HOOK_MIDDLE);
+ ap_hook_note_auth_failure(hook_note_digest_auth_failure, NULL, NULL,
+ APR_HOOK_MIDDLE);
+
}
AP_DECLARE_MODULE(auth_digest) =