]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD/MINOR: ssl: de-constify "ciphers" to avoid a warning on openssl-0.9.8
authorWilly Tarreau <w@1wt.eu>
Sun, 26 Oct 2014 05:49:19 +0000 (06:49 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 26 Oct 2014 05:52:13 +0000 (06:52 +0100)
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.

src/ssl_sock.c

index 4e39c8b8154ea6218447074122114c9a74ee2595..fa98a6bb484c0772e81f0d289bb9a03380b34c4f 100644 (file)
@@ -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/",