Changeset b8700b0 in mod_gnutls


Ignore:
Timestamp:
Jun 16, 2016, 2:32:02 PM (18 months ago)
Author:
Thomas Klute <thomas2.klute@…>
Branches:
master, debian, upstream
Children:
70d014b
Parents:
02eabe7
Message:

Deinit proxy credentials on config pool cleanup

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_config.c

    r7e7d328 rb8700b0  
    11131113    sc->proxy_x509_crl_file = NULL;
    11141114    sc->proxy_priorities_str = NULL;
     1115    sc->proxy_x509_creds = NULL;
     1116    sc->anon_client_creds = NULL;
    11151117    sc->proxy_priorities = NULL;
     1118    sc->proxy_x509_tl = NULL;
    11161119
    11171120    sc->ocsp_response_file = NULL;
  • src/gnutls_hooks.c

    r02eabe7 rb8700b0  
    18231823
    18241824
    1825 static apr_status_t load_proxy_x509_credentials(apr_pool_t *pconf __attribute__((unused)),
     1825static apr_status_t cleanup_proxy_x509_credentials(void *arg)
     1826{
     1827    mgs_srvconf_rec *sc = (mgs_srvconf_rec *) arg;
     1828
     1829    if (sc->proxy_x509_creds)
     1830    {
     1831        /* This implicitly releases the associated trust list
     1832         * sc->proxy_x509_tl, too. */
     1833        gnutls_certificate_free_credentials(sc->proxy_x509_creds);
     1834        sc->proxy_x509_creds = NULL;
     1835        sc->proxy_x509_tl = NULL;
     1836    }
     1837
     1838    if (sc->anon_client_creds)
     1839    {
     1840        gnutls_anon_free_client_credentials(sc->anon_client_creds);
     1841        sc->anon_client_creds = NULL;
     1842    }
     1843
     1844    if (sc->proxy_priorities)
     1845    {
     1846        gnutls_priority_deinit(sc->proxy_priorities);
     1847        sc->proxy_priorities = NULL;
     1848    }
     1849
     1850    return APR_SUCCESS;
     1851}
     1852
     1853
     1854
     1855static apr_status_t load_proxy_x509_credentials(apr_pool_t *pconf,
    18261856                                                apr_pool_t *ptemp,
    18271857                                                server_rec *s)
     
    18331863        return APR_EGENERAL;
    18341864
    1835     apr_status_t ret = APR_SUCCESS;
     1865    apr_status_t ret = APR_EINIT;
    18361866    int err = GNUTLS_E_SUCCESS;
     1867
     1868    /* Cleanup function for the GnuTLS structures allocated below */
     1869    apr_pool_cleanup_register(pconf, sc, cleanup_proxy_x509_credentials,
     1870                              apr_pool_cleanup_null);
    18371871
    18381872    /* Function pool, gets destroyed before exit. */
Note: See TracChangeset for help on using the changeset viewer.