Changeset c39ae1a in mod_gnutls for src/gnutls_cache.c


Ignore:
Timestamp:
Oct 30, 2016, 5:43:03 PM (4 years ago)
Author:
Thomas Klute <thomas2.klute@…>
Branches:
asyncio, debian/master, debian/stretch-backports, master, proxy-ticket, upstream
Children:
3475e62
Parents:
0cd8f3d
Message:

Initialize OCSP timeouts with an "unset" value

The configuration merge function used the default timeout to check if
an OCSP related timeout has been set in a virtual host
configuration. This would work most of the time, but break in the
corner case of the global configuration setting a non-default timeout
and a virtual host configuration restoring the default. In this
situation the merge would handle the value from the virtual host
configuration as unset and copy the global timeout.

The problem is solved by initializing the timeouts using the new macro
MGS_TIMEOUT_UNSET. Timeouts as used in the mod_gnutls configuration
cannot be negative, so there is ample room for explicitly unset
values. MGS_TIMEOUT_UNSET is also used for the session cache timeout
instead of hard coded -1.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_cache.c

    r0cd8f3d rc39ae1a  
    4545#include "gnutls_cache.h"
    4646#include "mod_gnutls.h"
     47#include "gnutls_config.h"
    4748
    4849#if HAVE_APR_MEMCACHE
     
    695696        sc->cache_type = mgs_cache_none;
    696697    /* if GnuTLSCacheTimeout was never explicitly set: */
    697     if (sc->cache_timeout == -1)
     698    if (sc->cache_timeout == MGS_TIMEOUT_UNSET)
    698699        sc->cache_timeout = apr_time_from_sec(MGS_DEFAULT_CACHE_TIMEOUT);
    699700
Note: See TracChangeset for help on using the changeset viewer.