From: Willy Tarreau Date: Sun, 26 Oct 2014 05:49:19 +0000 (+0100) Subject: BUILD/MINOR: ssl: de-constify "ciphers" to avoid a warning on openssl-0.9.8 X-Git-Tag: v1.6-dev1~287 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a616ba6f5fbee93134f121ac1da47397b071f365;p=thirdparty%2Fhaproxy.git BUILD/MINOR: ssl: de-constify "ciphers" to avoid a warning on openssl-0.9.8 When building on openssl-0.9.8, since commit 23d5d37 ("MINOR: ssl: use SSL_get_ciphers() instead of directly accessing the cipher list.") we get the following warning : src/ssl_sock.c: In function 'ssl_sock_prepare_ctx': src/ssl_sock.c:1592: warning: passing argument 1 of 'SSL_CIPHER_description' discards qualifiers from pointer target type This is because the openssl API has changed between 0.9.8 and 1.0.1 : 0.9.8: char *SSL_CIPHER_description(SSL_CIPHER *,char *buf,int size); 1.0.1: char *SSL_CIPHER_description(const SSL_CIPHER *,char *buf,int size); So let's remove the "const" type qualifier to satisfy both versions. Note that the fix above was backported to 1.5, so this one should as well. --- diff --git a/src/ssl_sock.c b/src/ssl_sock.c index 4e39c8b815..fa98a6bb48 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -1479,7 +1479,7 @@ int ssl_sock_prepare_ctx(struct bind_conf *bind_conf, SSL_CTX *ctx, struct proxy SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER | SSL_MODE_RELEASE_BUFFERS; STACK_OF(SSL_CIPHER) * ciphers = NULL; - SSL_CIPHER const * cipher = NULL; + SSL_CIPHER * cipher = NULL; char cipher_description[128]; /* The description of ciphers using an Ephemeral Diffie Hellman key exchange contains " Kx=DH " or " Kx=DH(". Beware of " Kx=DH/",