Changeset 994a5fb in mod_gnutls


Ignore:
Timestamp:
Dec 5, 2017, 2:57:35 AM (3 years ago)
Author:
Thomas Klute <thomas2.klute@…>
Branches:
debian/master, debian/stretch-backports, master, proxy-ticket, upstream
Children:
1de1026
Parents:
2a912c3
Message:

Do not reconfigure OCSP status callback on each connection

The callback is a property of the credentials, not the session, so
rewriting it during each handshake will create problems with parallel
connections on one virtual host. Set the callback once during
post_config instead, and get the mod_gnutls session context from the
GnuTLS session pointer instead of the callback pointer.

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_hooks.c

    r2a912c3 r994a5fb  
    164164    /* Set Anon credentials */
    165165    gnutls_credentials_set(session, GNUTLS_CRD_ANON, ctxt->sc->anon_creds);
    166 
    167     if (ctxt->sc->ocsp_staple)
    168     {
    169         gnutls_certificate_set_ocsp_status_request_function(ctxt->sc->certs,
    170                                                             mgs_get_ocsp_response,
    171                                                             ctxt);
    172     }
    173166
    174167#ifdef ENABLE_SRP
  • src/gnutls_ocsp.c

    r2a912c3 r994a5fb  
    737737
    738738
    739 int mgs_get_ocsp_response(gnutls_session_t session __attribute__((unused)),
    740                           void *ptr,
     739int mgs_get_ocsp_response(gnutls_session_t session,
     740                          void *ptr __attribute__((unused)),
    741741                          gnutls_datum_t *ocsp_response)
    742742{
    743     mgs_handle_t *ctxt = (mgs_handle_t *) ptr;
     743    mgs_handle_t *ctxt = gnutls_session_get_ptr(session);
    744744    if (!ctxt->sc->ocsp_staple || ctxt->sc->cache == NULL)
    745745    {
     
    976976                              apr_pool_cleanup_null);
    977977
     978    /* enable status request callback */
     979    gnutls_certificate_set_ocsp_status_request_function(sc->certs,
     980                                                        mgs_get_ocsp_response,
     981                                                        sc);
     982
    978983    return OK;
    979984}
Note: See TracChangeset for help on using the changeset viewer.