Skip to content

Commit

Permalink
lib-ssl-iostream: Fix boolean misuse in SSL_CTX_set_ecdh_auto usage
Browse files Browse the repository at this point in the history
Fixes compiler nit on clang
  • Loading branch information
cmouse authored and villesavolainen committed May 28, 2018
1 parent 5231b55 commit bad6d9e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib-ssl-iostream/iostream-openssl-context.c
Expand Up @@ -514,8 +514,9 @@ ssl_proxy_ctx_set_crypto_params(SSL_CTX *ssl_ctx,
SSL_CTX_set_options(ssl_ctx, SSL_OP_SINGLE_ECDH_USE);
#ifdef SSL_CTX_set_ecdh_auto
/* OpenSSL >= 1.0.2 automatically handles ECDH temporary key parameter
selection. */
if (SSL_CTX_set_ecdh_auto(ssl_ctx, 1) == 0) {
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)) {
/* shouldn't happen */
*error_r = t_strdup_printf("SSL_CTX_set_ecdh_auto() failed: %s",
openssl_iostream_error());
Expand Down

0 comments on commit bad6d9e

Please sign in to comment.