Changeset b888e8b in mod_gnutls for src/gnutls_ocsp.c


Ignore:
Timestamp:
Nov 1, 2016, 7:20:42 AM (4 years ago)
Author:
Thomas Klute <thomas2.klute@…>
Branches:
debian/master, debian/stretch-backports, master, proxy-ticket, upstream
Children:
b26a792
Parents:
b34a67e
git-author:
Thomas Klute <thomas2.klute@…> (10/31/16 19:42:11)
git-committer:
Thomas Klute <thomas2.klute@…> (11/01/16 07:20:42)
Message:

New directive GnuTLSOCSPCheckNonce

Some CAs refuse to send nonces in their OCSP responses, probably
because that way they can cache responses. This makes nonce
verification fail, so give the user an option disable it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_ocsp.c

    rb34a67e rb888e8b  
    8383    else
    8484        sc->ocsp_staple = GNUTLS_ENABLED_FALSE;
     85
     86    return NULL;
     87}
     88
     89
     90
     91const char *mgs_set_ocsp_check_nonce(cmd_parms *parms,
     92                                     void *dummy __attribute__((unused)),
     93                                     const int arg)
     94{
     95    mgs_srvconf_rec *sc = (mgs_srvconf_rec *)
     96        ap_get_module_config(parms->server->module_config, &gnutls_module);
     97
     98    if (arg)
     99        sc->ocsp_check_nonce = GNUTLS_ENABLED_TRUE;
     100    else
     101        sc->ocsp_check_nonce = GNUTLS_ENABLED_FALSE;
    85102
    86103    return NULL;
     
    276293    }
    277294
    278     if (nonce != NULL)
     295    /* Even some large CAs do not support nonces, probably because
     296     * that way they can cache responses. :-/ */
     297    if (nonce != NULL && sc->ocsp_check_nonce)
    279298    {
    280299        gnutls_datum_t resp_nonce;
     
    617636    {
    618637        gnutls_datum_t req;
    619         /* mod_ssl offers an option to enable/disable nonces for
    620          * broken responders. If needed at some point, we could do the
    621          * same by passing NULL instead of &nonce. */
    622638        int ret = mgs_create_ocsp_request(s, &req, &nonce);
    623639        if (ret == GNUTLS_E_SUCCESS)
     
    905921    }
    906922
    907     /* set default values for unset timeouts */
     923    /* set default values for unset parameters */
     924    if (sc->ocsp_check_nonce == GNUTLS_ENABLED_UNSET)
     925        sc->ocsp_check_nonce = GNUTLS_ENABLED_TRUE;
    908926    if (sc->ocsp_grace_time == MGS_TIMEOUT_UNSET)
    909927        sc->ocsp_grace_time = apr_time_from_sec(MGS_OCSP_GRACE_TIME);
Note: See TracChangeset for help on using the changeset viewer.