From: William Lallemand Date: Tue, 28 Jan 2020 23:04:24 +0000 (+0100) Subject: BUG/MINOR: ssl/cli: fix unused variable with openssl < 1.0.2 X-Git-Tag: v2.2-dev2~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a25a19fdee548241165b59af94c68d1b5b083bee;p=thirdparty%2Fhaproxy.git BUG/MINOR: ssl/cli: fix unused variable with openssl < 1.0.2 src/ssl_sock.c: In function ‘cli_io_handler_show_cert’: src/ssl_sock.c:10214:6: warning: unused variable ‘n’ [-Wunused-variable] int n; ^ Fix this problem in the io handler of the "show ssl cert" function. --- diff --git a/src/ssl_sock.c b/src/ssl_sock.c index 99133f0f93..6f92edfd6b 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -10211,7 +10211,6 @@ static int cli_io_handler_show_cert(struct appctx *appctx) struct ebmb_node *node; struct stream_interface *si = appctx->owner; struct ckch_store *ckchs; - int n; if (trash == NULL) return 1; @@ -10224,6 +10223,8 @@ static int cli_io_handler_show_cert(struct appctx *appctx) chunk_appendf(trash, "*%s\n", ckchs->path); #if HA_OPENSSL_VERSION_NUMBER >= 0x1000200fL } else { + int n; + chunk_appendf(trash, "*%s:", ckchs->path); for (n = 0; n < SSL_SOCK_NUM_KEYTYPES; n++) { if (ckchs->ckch[n].cert) @@ -10247,6 +10248,8 @@ static int cli_io_handler_show_cert(struct appctx *appctx) chunk_appendf(trash, "%s\n", ckchs->path); #if HA_OPENSSL_VERSION_NUMBER >= 0x1000200fL } else { + int n; + chunk_appendf(trash, "%s:", ckchs->path); for (n = 0; n < SSL_SOCK_NUM_KEYTYPES; n++) { if (ckchs->ckch[n].cert)