]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: ssl: Remove useless checks on bind_conf or bind_conf->is_ssl
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 15 Sep 2017 07:52:49 +0000 (09:52 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 15 Sep 2017 16:42:23 +0000 (18:42 +0200)
bind_conf always exists at these steps and it is always for SSL listeners.

src/ssl_sock.c

index 8a5d66fd29445ddc8a55573b12924dbd4381aed3..989d7e1cfff67861006bc62b82b36a78cd1793ee 100644 (file)
@@ -4226,9 +4226,6 @@ int ssl_sock_prepare_all_ctx(struct bind_conf *bind_conf)
        struct sni_ctx *sni;
        int err = 0;
 
-       if (!bind_conf || !bind_conf->is_ssl)
-               return 0;
-
        /* Automatic memory computations need to know we use SSL there */
        global.ssl_used_frontend = 1;
 
@@ -4333,9 +4330,6 @@ void ssl_sock_free_all_ctx(struct bind_conf *bind_conf)
        struct ebmb_node *node, *back;
        struct sni_ctx *sni;
 
-       if (!bind_conf || !bind_conf->is_ssl)
-               return;
-
        node = ebmb_first(&bind_conf->sni_ctx);
        while (node) {
                sni = ebmb_entry(node, struct sni_ctx, name);
@@ -4400,7 +4394,7 @@ ssl_sock_load_ca(struct bind_conf *bind_conf)
        EVP_PKEY *capkey = NULL;
        int       err    = 0;
 
-       if (!bind_conf || !bind_conf->generate_certs)
+       if (!bind_conf->generate_certs)
                return err;
 
 #if (defined SSL_CTRL_SET_TLSEXT_HOSTNAME && !defined SSL_NO_GENERATE_CERTIFICATES)
@@ -4453,9 +4447,6 @@ ssl_sock_load_ca(struct bind_conf *bind_conf)
 void
 ssl_sock_free_ca(struct bind_conf *bind_conf)
 {
-       if (!bind_conf)
-               return;
-
        if (bind_conf->ca_sign_pkey)
                EVP_PKEY_free(bind_conf->ca_sign_pkey);
        if (bind_conf->ca_sign_cert)