Changeset c39ae1a in mod_gnutls for src/gnutls_ocsp.c


Ignore:
Timestamp:
Oct 30, 2016, 5:43:03 PM (4 years ago)
Author:
Thomas Klute <thomas2.klute@…>
Branches:
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_ocsp.c

    r0cd8f3d rc39ae1a  
    1818#include "mod_gnutls.h"
    1919#include "gnutls_cache.h"
     20#include "gnutls_config.h"
    2021#include "gnutls_util.h"
    2122
     
    904905    }
    905906
     907    /* set default values for unset timeouts */
     908    if (sc->ocsp_grace_time == MGS_TIMEOUT_UNSET)
     909        sc->ocsp_grace_time = apr_time_from_sec(MGS_OCSP_GRACE_TIME);
     910    if (sc->ocsp_failure_timeout == MGS_TIMEOUT_UNSET)
     911        sc->ocsp_failure_timeout = apr_time_from_sec(MGS_OCSP_FAILURE_TIMEOUT);
     912    if (sc->ocsp_socket_timeout == MGS_TIMEOUT_UNSET)
     913        sc->ocsp_socket_timeout = apr_time_from_sec(MGS_OCSP_SOCKET_TIMEOUT);
     914
    906915    sc->ocsp = apr_palloc(pconf, sizeof(struct mgs_ocsp_data));
    907916
Note: See TracChangeset for help on using the changeset viewer.