MCPcopy Create free account
hub / github.com/apache/httpd / ssl_config_perdir_merge

Function ssl_config_perdir_merge

modules/ssl/ssl_engine_config.c:481–535  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

479}
480
481void *ssl_config_perdir_merge(apr_pool_t *p, void *basev, void *addv)
482{
483 SSLDirConfigRec *base = (SSLDirConfigRec *)basev;
484 SSLDirConfigRec *add = (SSLDirConfigRec *)addv;
485 SSLDirConfigRec *mrg = (SSLDirConfigRec *)apr_palloc(p, sizeof(*mrg));
486
487 cfgMerge(bSSLRequired, FALSE);
488 cfgMergeArray(aRequirement);
489
490 if (add->nOptions & SSL_OPT_RELSET) {
491 mrg->nOptionsAdd =
492 (base->nOptionsAdd & ~(add->nOptionsDel)) | add->nOptionsAdd;
493 mrg->nOptionsDel =
494 (base->nOptionsDel & ~(add->nOptionsAdd)) | add->nOptionsDel;
495 mrg->nOptions =
496 (base->nOptions & ~(mrg->nOptionsDel)) | mrg->nOptionsAdd;
497 }
498 else {
499 mrg->nOptions = add->nOptions;
500 mrg->nOptionsAdd = add->nOptionsAdd;
501 mrg->nOptionsDel = add->nOptionsDel;
502 }
503
504 cfgMergeString(szCipherSuite);
505 cfgMerge(nVerifyClient, SSL_CVERIFY_UNSET);
506 cfgMergeInt(nVerifyDepth);
507
508 cfgMergeString(szUserName);
509
510 cfgMergeInt(nRenegBufferSize);
511
512 mrg->proxy_post_config = add->proxy_post_config;
513 if (!mrg->proxy_post_config) {
514 cfgMergeBool(proxy_enabled);
515 modssl_ctx_init_proxy(mrg, p);
516 modssl_ctx_cfg_merge_proxy(p, base->proxy, add->proxy, mrg->proxy);
517
518 /* Since ssl_proxy_section_post_config() hook won't be called if there
519 * is no SSLProxy* in this dir config, the ssl_ctx may still be NULL
520 * here at runtime. Merging it is either a no-op (NULL => NULL) because
521 * we are still before post config, or we really want to reuse the one
522 * from the upper/server context (outside of <Proxy> sections).
523 */
524 cfgMerge(proxy->ssl_ctx, NULL);
525 }
526 else {
527 /* The post_config hook has already merged and initialized the
528 * proxy context, use it.
529 */
530 mrg->proxy_enabled = add->proxy_enabled;
531 mrg->proxy = add->proxy;
532 }
533
534 return mrg;
535}
536
537/* Simply merge conf with base into conf, no third party. */
538void ssl_config_proxy_merge(apr_pool_t *p,

Callers

nothing calls this directly

Calls 2

modssl_ctx_init_proxyFunction · 0.85

Tested by

no test coverage detected