]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: ssl: fix a warning when built with openssl < 1.0.2
authorWilliam Lallemand <wlallemand@haproxy.com>
Mon, 30 Sep 2019 10:58:13 +0000 (12:58 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Mon, 30 Sep 2019 11:40:53 +0000 (13:40 +0200)
src/ssl_sock.c:2928:12: warning: ‘ssl_sock_is_ckch_valid’ defined but not used [-Wunused-function]
 static int ssl_sock_is_ckch_valid(struct cert_key_and_chain *ckch)

This function is only used with openssl >= 1.0.2, this patch adds a
condition to build the function.

src/ssl_sock.c

index 74c6342b3eb7eadd52c78070d61039a59a41a76e..726ffb279de3cfe50c90680ecbcdd3c3ee7efed8 100644 (file)
@@ -2925,11 +2925,12 @@ static void ssl_sock_free_cert_key_and_chain_contents(struct cert_key_and_chain
 
 /* checks if a key and cert exists in the ckch
  */
+#if HA_OPENSSL_VERSION_NUMBER >= 0x1000200fL
 static int ssl_sock_is_ckch_valid(struct cert_key_and_chain *ckch)
 {
        return (ckch->cert != NULL && ckch->key != NULL);
 }
-
+#endif
 
 /* Loads the contents of a crt file (path) into a cert_key_and_chain
  * This allows us to carry the contents of the file without having to