]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUILD: ssl: fix build error introduced in commit 7969a3 with OpenSSL < 1.0.0
authorChristopher Faulet <cfaulet@qualys.com>
Mon, 19 Oct 2015 11:59:24 +0000 (13:59 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 22 Oct 2015 11:32:34 +0000 (13:32 +0200)
commite7db21693ff02da0466ae691f78d3f110cc7876d
tree6399363b4372c6c3832bb0cfc6c3c0937e22f019
parente6a4a329b842ed7e7d804fa34f393b07cdfa0983
BUILD: ssl: fix build error introduced in commit 7969a3 with OpenSSL < 1.0.0

The function 'EVP_PKEY_get_default_digest_nid()' was introduced in OpenSSL
1.0.0. So for older version of OpenSSL, compiled with the SNI support, the
HAProxy compilation fails with the following error:

src/ssl_sock.c: In function 'ssl_sock_do_create_cert':
src/ssl_sock.c:1096:7: warning: implicit declaration of function 'EVP_PKEY_get_default_digest_nid'
   if (EVP_PKEY_get_default_digest_nid(capkey, &nid) <= 0)
[...]
src/ssl_sock.c:1096: undefined reference to `EVP_PKEY_get_default_digest_nid'
collect2: error: ld returned 1 exit status
Makefile:760: recipe for target 'haproxy' failed
make: *** [haproxy] Error 1

So we must add a #ifdef to check the OpenSSL version (>= 1.0.0) to use this
function. It is used to get default signature digest associated to the private
key used to sign generated X509 certificates. It is called when the private key
differs than EVP_PKEY_RSA, EVP_PKEY_DSA and EVP_PKEY_EC. It should be enough for
most of cases.
src/ssl_sock.c