BUILD: ssl: eliminate warning with OpenSSL 1.1.0 regarding RAND_pseudo_bytes()
authorWilly Tarreau <w@1wt.eu>
Thu, 19 Jan 2017 16:10:54 +0000 (17:10 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 19 Jan 2017 16:28:08 +0000 (17:28 +0100)
commit77d88da7e1be29ff1ba5cd4634e2997060d30b2b
tree1aca95d87eda27b98897b64d36614ae85aa6371c
parenta4fb8ed1f2969a79f2965b49a6f0e45536f01795
BUILD: ssl: eliminate warning with OpenSSL 1.1.0 regarding RAND_pseudo_bytes()

This function was deprecated in 1.1.0 causing this warning :

  src/ssl_sock.c:551:3: warning: 'RAND_pseudo_bytes' is deprecated (declared at /opt/openssl-1.1.0/include/openssl/rand.h:47) [-Wdeprecated-declarations]

The man suggests to use RAND_bytes() instead. While the return codes
differ, it turns out that the function was already misused and was
relying on RAND_bytes() return code instead.

The patch was tested on 0.9.8, 1.0.0, 1.0.1, 1.0.2 and 1.1.0.

This fix must be backported to 1.7 and the return code check should
be backported to earlier versions if relevant.
include/proto/openssl-compat.h