]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Only set stable cb is staple is enabled 1613/head
authorPhilippe Wooding <philippe.wooding@networkradius.com>
Fri, 20 May 2016 09:42:32 +0000 (11:42 +0200)
committerPhilippe Wooding <philippe.wooding@networkradius.com>
Fri, 20 May 2016 09:42:32 +0000 (11:42 +0200)
src/main/tls/ctx.c

index 7e35ec25b0c4512fbb89466a2d4763944ce2ddc0..be6f0390e25817ee9252e7e1fc9d06cec824ad25 100644 (file)
@@ -420,15 +420,17 @@ post_ca:
        /*
         *      Configure OCSP stapling for the server cert
         */
-       SSL_CTX_set_tlsext_status_cb(ctx, tls_ocsp_staple_cb);
+       if (conf->staple->enable) {
+               SSL_CTX_set_tlsext_status_cb(ctx, tls_ocsp_staple_cb);
 
-       {
-               fr_tls_ocsp_conf_t const *staple_conf = &(conf->staple);        /* Need to assign offset first */
-               fr_tls_ocsp_conf_t *tmp;
+               {
+                       fr_tls_ocsp_conf_t const *staple_conf = &(conf->staple);        /* Need to assign offset first */
+                       fr_tls_ocsp_conf_t *tmp;
 
-               memcpy(&tmp, &staple_conf, sizeof(tmp));
+                       memcpy(&tmp, &staple_conf, sizeof(tmp));
 
-               SSL_CTX_set_tlsext_status_arg(ctx, tmp);
+                       SSL_CTX_set_tlsext_status_arg(ctx, tmp);
+               }
        }
 
        /*