View | Details | Raw Unified | Return to bug 47152
Collapse All | Expand All

(-)httpd-2.4.1/modules/aaa/mod_auth_digest.c (-2 / +34 lines)
Lines 470-475 static void *create_digest_dir_config(ap Link Here
470
    return conf;
470
    return conf;
471
}
471
}
472
472
473
static void *merge_digest_dir_config(apr_pool_t *a, void *basev, void *newv)
474
{
475
    digest_config_rec *base = (digest_config_rec *)basev;
476
    digest_config_rec *new = (digest_config_rec *)newv;
477
    digest_config_rec *conf =
478
        (digest_config_rec *)apr_pcalloc(a, sizeof(digest_config_rec));
479
	
480
	/* Always take the new value */
481
	conf->qop_list = new->qop_list;
482
	conf->nonce_lifetime = new->nonce_lifetime;
483
	conf->dir_name = new->dir_name;
484
	conf->algorithm = new->algorithm;
485
	conf->providers = new->providers;
486
	conf->nonce_format = new->nonce_format;
487
	conf->check_nc = new->check_nc;
488
	conf->uri_list = new->uri_list;
489
	conf->ha1 = new->ha1;
490
	
491
	/* Except for the realm name,  match mod_authn_core's merge rules here */
492
	/* Also pass forward the precalculated nonce_ctx */		
493
    if (new->realm) {
494
        conf->realm = new->realm;
495
		conf->nonce_ctx = new->nonce_ctx;
496
    } else {
497
        conf->realm = base->realm;
498
		conf->nonce_ctx = base->nonce_ctx;
499
    }
500
501
    return (void*)conf;
502
}
503
504
473
static const char *set_realm(cmd_parms *cmd, void *config, const char *realm)
505
static const char *set_realm(cmd_parms *cmd, void *config, const char *realm)
474
{
506
{
475
    digest_config_rec *conf = (digest_config_rec *) config;
507
    digest_config_rec *conf = (digest_config_rec *) config;
Lines 1843-1849 static int authenticate_digest_user(requ Link Here
1843
        return HTTP_UNAUTHORIZED;
1875
        return HTTP_UNAUTHORIZED;
1844
    }
1876
    }
1845
1877
1846
    if (strcmp(resp->realm, conf->realm)) {
1878
    if (resp->realm == NULL || conf->realm == NULL || strcmp(resp->realm, conf->realm)) {
1847
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01788)
1879
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01788)
1848
                      "realm mismatch - got `%s' but expected `%s'",
1880
                      "realm mismatch - got `%s' but expected `%s'",
1849
                      resp->realm, conf->realm);
1881
                      resp->realm, conf->realm);
Lines 2084-2090 AP_DECLARE_MODULE(auth_digest) = Link Here
2084
{
2116
{
2085
    STANDARD20_MODULE_STUFF,
2117
    STANDARD20_MODULE_STUFF,
2086
    create_digest_dir_config,   /* dir config creater */
2118
    create_digest_dir_config,   /* dir config creater */
2087
    NULL,                       /* dir merger --- default is to override */
2119
    merge_digest_dir_config,    /* dir merger --- default is to override */
2088
    NULL,                       /* server config */
2120
    NULL,                       /* server config */
2089
    NULL,                       /* merge server config */
2121
    NULL,                       /* merge server config */
2090
    digest_cmds,                /* command table */
2122
    digest_cmds,                /* command table */

Return to bug 47152