Changeset 89f863f in mod_gnutls for src/gnutls_config.c


Ignore:
Timestamp:
Oct 19, 2015, 9:07:40 PM (5 years ago)
Author:
Daniel Kahn Gillmor <dkg@…>
Branches:
debian/master, debian/stretch-backports, jessie-backports, upstream
Children:
02c8e54, 24c6c16
Parents:
4addf74 (diff), 71cac80 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Imported Upstream version 0.7.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_config.c

    r4addf74 r89f863f  
    642642}
    643643
    644 const char *mgs_set_tickets(cmd_parms * parms, void *dummy __attribute__((unused)),
    645         const char *arg) {
    646     mgs_srvconf_rec *sc =
    647         (mgs_srvconf_rec *) ap_get_module_config(parms->server->
    648                                                  module_config,
    649                                                 &gnutls_module);
    650 
    651     sc->tickets = 0;
    652     if (strcasecmp("on", arg) == 0) {
    653         sc->tickets = 1;
    654     }
     644const char *mgs_set_tickets(cmd_parms *parms,
     645                            void *dummy __attribute__((unused)),
     646                            const int arg)
     647{
     648    mgs_srvconf_rec *sc = (mgs_srvconf_rec *)
     649        ap_get_module_config(parms->server->module_config, &gnutls_module);
     650
     651    if (arg)
     652        sc->tickets = GNUTLS_ENABLED_TRUE;
     653    else
     654        sc->tickets = GNUTLS_ENABLED_FALSE;
    655655
    656656    return NULL;
     
    826826}
    827827
    828 const char *mgs_set_proxy_engine(cmd_parms * parms, void *dummy __attribute__((unused)),
    829         const char *arg) {
    830 
     828/*
     829 * Enable TLS proxy operation if arg is true, disable it otherwise.
     830 */
     831const char *mgs_set_proxy_engine(cmd_parms *parms,
     832                                 void *dummy __attribute__((unused)),
     833                                 const int arg)
     834{
    831835    mgs_srvconf_rec *sc = (mgs_srvconf_rec *)
    832         ap_get_module_config(parms->server->module_config, &gnutls_module);
    833 
    834     if (!strcasecmp(arg, "On")) {
    835         sc->proxy_enabled = GNUTLS_ENABLED_TRUE;
    836     } else if (!strcasecmp(arg, "Off")) {
    837         sc->proxy_enabled = GNUTLS_ENABLED_FALSE;
    838     } else {
    839         return "GnuTLSProxyEngine must be set to 'On' or 'Off'";
    840     }
    841 
    842     return NULL;
    843 }
    844 
    845 const char *mgs_set_enabled(cmd_parms * parms, void *dummy __attribute__((unused)),
    846         const char *arg) {
    847     mgs_srvconf_rec *sc =
    848         (mgs_srvconf_rec *) ap_get_module_config(parms->server->
    849                                                  module_config,
    850                                                  &gnutls_module);
    851     if (!strcasecmp(arg, "On")) {
    852         sc->enabled = GNUTLS_ENABLED_TRUE;
    853     } else if (!strcasecmp(arg, "Off")) {
    854         sc->enabled = GNUTLS_ENABLED_FALSE;
    855     } else {
    856         return "GnuTLSEnable must be set to 'On' or 'Off'";
    857     }
     836        ap_get_module_config(parms->server->module_config, &gnutls_module);
     837
     838    if (arg)
     839        sc->proxy_enabled = GNUTLS_ENABLED_TRUE;
     840    else
     841        sc->proxy_enabled = GNUTLS_ENABLED_FALSE;
     842
     843    return NULL;
     844}
     845
     846/*
     847 * Enable TLS for the server/vhost if arg is true, disable it
     848 * otherwise.
     849 */
     850const char *mgs_set_enabled(cmd_parms *parms,
     851                            void *dummy __attribute__((unused)),
     852                            const int arg)
     853{
     854    mgs_srvconf_rec *sc = (mgs_srvconf_rec *)
     855        ap_get_module_config(parms->server->module_config, &gnutls_module);
     856
     857    if (arg)
     858        sc->enabled = GNUTLS_ENABLED_TRUE;
     859    else
     860        sc->enabled = GNUTLS_ENABLED_FALSE;
    858861
    859862    return NULL;
     
    949952    sc->privkey_pgp = NULL;
    950953    sc->certs_x509_chain_num = 0;
    951     sc->p11_module = NULL;
     954    sc->p11_modules = NULL;
    952955    sc->pin = NULL;
    953956    sc->priorities_str = NULL;
     
    10101013    gnutls_srvconf_merge(x509_key_file, NULL);
    10111014    gnutls_srvconf_merge(x509_ca_file, NULL);
    1012     gnutls_srvconf_merge(p11_module, NULL);
     1015    gnutls_srvconf_merge(p11_modules, NULL);
    10131016    gnutls_srvconf_merge(pin, NULL);
    10141017    gnutls_srvconf_merge(pgp_cert_file, NULL);
     
    11071110
    11081111/*
    1109  * Record additional PKCS #11 module to load. Note that the value is
    1110  * only used in the base config, settings in virtual hosts are
    1111  * ignored.
     1112 * Record PKCS #11 module to load. Note that the value is only used in
     1113 * the base config, settings in virtual hosts are ignored.
    11121114 */
    11131115const char *mgs_set_p11_module(cmd_parms * parms,
     
    11171119    mgs_srvconf_rec *sc = (mgs_srvconf_rec *)
    11181120        ap_get_module_config(parms->server->module_config, &gnutls_module);
    1119     sc->p11_module = apr_pstrdup(parms->pool, arg);
    1120     return NULL;
    1121 }
     1121    /* initialize PKCS #11 module list if necessary */
     1122    if (sc->p11_modules == NULL)
     1123        sc->p11_modules = apr_array_make(parms->pool, 2, sizeof(char*));
     1124
     1125    *(char **) apr_array_push(sc->p11_modules) = apr_pstrdup(parms->pool, arg);
     1126
     1127    return NULL;
     1128}
Note: See TracChangeset for help on using the changeset viewer.