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

(-)modules/ssl/ssl_engine_config.c (-2 / +39 lines)
Lines 311-316 static void modssl_ctx_cfg_merge_proxy(apr_pool_t Link Here
311
    cfgMergeString(pkp->ca_cert_file);
311
    cfgMergeString(pkp->ca_cert_file);
312
}
312
}
313
313
314
#ifdef HAVE_ECC
315
#define CERTKEYS_IDX_MAX 2
316
#else
317
#define CERTKEYS_IDX_MAX 1
318
#endif
319
320
static void modssl_ctx_cfg_merge_certkeys_array(apr_pool_t *p,
321
                                                apr_array_header_t *base,
322
                                                apr_array_header_t *add,
323
                                                apr_array_header_t *mrg)
324
{
325
    int i;
326
327
    /*
328
     * pick up to CERTKEYS_IDX_MAX+1 entries from "add" (in which case they
329
     * they "knock out" their corresponding entries in "base")
330
     */
331
    for (i = 0; i < add->nelts && i <= CERTKEYS_IDX_MAX; i++) {
332
        APR_ARRAY_PUSH(mrg, const char *) = APR_ARRAY_IDX(add, i, const char *);
333
    }
334
335
    /* add remaining ones from "base" */
336
    while (i < base->nelts) {
337
        APR_ARRAY_PUSH(mrg, const char *) = APR_ARRAY_IDX(base, i, const char *);
338
        i++;
339
    }
340
341
    /* and finally, append the rest of "add" (if there are any) */
342
    for (i = CERTKEYS_IDX_MAX+1; i < add->nelts; i++) {
343
        APR_ARRAY_PUSH(mrg, const char *) = APR_ARRAY_IDX(add, i, const char *);
344
    }
345
}
346
314
static void modssl_ctx_cfg_merge_server(apr_pool_t *p,
347
static void modssl_ctx_cfg_merge_server(apr_pool_t *p,
315
                                        modssl_ctx_t *base,
348
                                        modssl_ctx_t *base,
316
                                        modssl_ctx_t *add,
349
                                        modssl_ctx_t *add,
Lines 318-325 static void modssl_ctx_cfg_merge_server(apr_pool_t Link Here
318
{
351
{
319
    modssl_ctx_cfg_merge(p, base, add, mrg);
352
    modssl_ctx_cfg_merge(p, base, add, mrg);
320
353
321
    cfgMergeArray(pks->cert_files);
354
    modssl_ctx_cfg_merge_certkeys_array(p, base->pks->cert_files,
322
    cfgMergeArray(pks->key_files);
355
                                        add->pks->cert_files,
356
                                        mrg->pks->cert_files);
357
    modssl_ctx_cfg_merge_certkeys_array(p, base->pks->key_files,
358
                                        add->pks->key_files,
359
                                        mrg->pks->key_files);
323
360
324
    cfgMergeString(pks->ca_name_path);
361
    cfgMergeString(pks->ca_name_path);
325
    cfgMergeString(pks->ca_name_file);
362
    cfgMergeString(pks->ca_name_file);

Return to bug 56306