Changeset e809fb3 in mod_gnutls for src/gnutls_ocsp.c


Ignore:
Timestamp:
Jun 9, 2016, 7:52:23 PM (3 years ago)
Author:
Thomas Klute <thomas2.klute@…>
Branches:
debian/master, debian/stretch-backports, master, upstream
Children:
aa68232
Parents:
3e22b82
Message:

Use generic cache functions for OCSP response caching

With this, OCSP stapling works with all supported cache types.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_ocsp.c

    r3e22b82 re809fb3  
    325325        ap_get_module_config(s->module_config, &gnutls_module);
    326326
    327     if (sc->cache_type != mgs_cache_dbm && sc->cache_type != mgs_cache_gdbm)
    328     {
    329         /* experimental OCSP cache requires DBM cache */
     327    if (sc->cache == NULL)
     328    {
     329        /* OCSP caching requires a cache. */
    330330        return APR_ENOTIMPL;
    331331    }
     
    400400        expiry -= sc->ocsp_grace_time;
    401401
    402     int r = dbm_cache_store(s, fingerprint, resp, expiry);
     402    int r = sc->cache->store(s, fingerprint, resp, expiry);
    403403    /* destroy pool, and original copy of the OCSP response with it */
    404404    apr_pool_destroy(tmp);
     
    419419{
    420420    mgs_handle_t *ctxt = (mgs_handle_t *) ptr;
     421    if (ctxt->sc->cache == NULL)
     422    {
     423        /* OCSP caching requires a cache. */
     424        return GNUTLS_E_NO_CERTIFICATE_STATUS;
     425    }
    421426
    422427    gnutls_datum_t fingerprint =
     
    426431        return GNUTLS_E_NO_CERTIFICATE_STATUS;
    427432
    428     *ocsp_response = dbm_cache_fetch(ctxt, fingerprint);
     433    *ocsp_response = ctxt->sc->cache->fetch(ctxt, fingerprint);
    429434    if (ocsp_response->size == 0)
    430435    {
     
    454459
    455460    /* retry reading from cache */
    456     *ocsp_response = dbm_cache_fetch(ctxt, fingerprint);
     461    *ocsp_response = ctxt->sc->cache->fetch(ctxt, fingerprint);
    457462    if (ocsp_response->size == 0)
    458463    {
Note: See TracChangeset for help on using the changeset viewer.