From 18fbc4a90148d13a16f98682989d1a19d9d3ad9d Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Tue, 17 Apr 2018 12:20:26 +0300 Subject: [PATCH] lib-ssl-iostream: Fix boolean misuse in SSL_CTX_set_ecdh_auto usage f8aaa6e63a56085f61f128838ad7a3aa080d9d5b introduced warnings on gcc --- src/lib-ssl-iostream/iostream-openssl-context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib-ssl-iostream/iostream-openssl-context.c b/src/lib-ssl-iostream/iostream-openssl-context.c index 6dbbe96760..e3c902e18d 100644 --- a/src/lib-ssl-iostream/iostream-openssl-context.c +++ b/src/lib-ssl-iostream/iostream-openssl-context.c @@ -526,7 +526,7 @@ ssl_proxy_ctx_set_crypto_params(SSL_CTX *ssl_ctx, /* OpenSSL >= 1.0.2 automatically handles ECDH temporary key parameter selection. The return value of this function changes is changed to bool in OpenSSL 1.1 and is int in OpenSSL 1.0.2+ */ - if (!(bool)SSL_CTX_set_ecdh_auto(ssl_ctx, 1)) { + if ((long)(SSL_CTX_set_ecdh_auto(ssl_ctx, 1)) == 0) { /* shouldn't happen */ *error_r = t_strdup_printf("SSL_CTX_set_ecdh_auto() failed: %s", openssl_iostream_error()); -- 2.47.3