[Remove entries to the current 2.0 section below, when backported]
+ *) minor mod_auth_basic and mod_auth_digest sync. mod_auth_basic
+ now populates r->user with the (possibly unauthenticated) user,
+ and mod_auth_digest returns 500 when a provider returns
+ AUTH_GENERAL_ERROR.
+ [Geoffrey Young]
+
*) fix "Expected </Foo>> but saw </Foo>" errors in nested,
argumentless containers.
["Philippe M. Chiasson" <gozer cpan.org>]
* Authorization header verification code
*/
-static const char *get_hash(request_rec *r, const char *user,
- digest_config_rec *conf)
+static authn_status get_hash(request_rec *r, const char *user,
+ digest_config_rec *conf)
{
authn_status auth_result;
char *password;
current_provider = current_provider->next;
} while (current_provider);
- if (auth_result != AUTH_USER_FOUND) {
- return NULL;
- }
- else {
- return password;
+ if (auth_result == AUTH_USER_FOUND) {
+ conf->ha1 = password;
}
+
+ return auth_result;
}
static int check_nc(const request_rec *r, const digest_header_rec *resp,
request_rec *mainreq;
const char *t;
int res;
+ authn_status return_code;
/* do we require Digest auth for this URI? */
return HTTP_UNAUTHORIZED;
}
- if (!(conf->ha1 = get_hash(r, r->user, conf))) {
+ return_code = get_hash(r, r->user, conf);
+
+ if (return_code == AUTH_USER_NOT_FOUND) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
"Digest: user `%s' in realm `%s' not found: %s",
r->user, conf->realm, r->uri);
note_digest_auth_failure(r, conf, resp, 0);
return HTTP_UNAUTHORIZED;
}
-
+ else if (return_code == AUTH_USER_FOUND) {
+ /* we have a password, so continue */
+ }
+ else {
+ /* AUTH_GENERAL_ERROR (or worse)
+ * We'll assume that the module has already said what its error
+ * was in the logs.
+ */
+ return HTTP_INTERNAL_SERVER_ERROR;
+ }
if (resp->message_qop == NULL) {
/* old (rfc-2069) style digest */