]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: ssl: do not look at DHparam with OPENSSL_NO_DH
authorEmmanuel Hocdet <manu@gandi.net>
Tue, 30 Jul 2019 15:04:01 +0000 (17:04 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Tue, 30 Jul 2019 15:54:34 +0000 (17:54 +0200)
OPENSSL_NO_DH can be defined to avoid obsolete and heavy DH processing.
With OPENSSL_NO_DH, parse the entire PEM file to look at DHparam is wast
of time.

src/ssl_sock.c

index 08ab3c304c6935af8d1fe34c51fc2b365308c673..1cc4607f6657768b6ed2f8a52e3e12a7a165e156 100644 (file)
@@ -2967,6 +2967,7 @@ static int ssl_sock_load_crt_file_into_ckch(const char *path, struct cert_key_an
                goto end;
        }
 
+#ifndef OPENSSL_NO_DH
        /* Seek back to beginning of file */
        if (BIO_reset(in) == -1) {
                memprintf(err, "%san error occurred while reading the file '%s'.\n",
@@ -2976,6 +2977,7 @@ static int ssl_sock_load_crt_file_into_ckch(const char *path, struct cert_key_an
 
        ckch->dh = PEM_read_bio_DHparams(in, NULL, NULL, NULL);
        /* no need to check for NULL there, dh is not mandatory */
+#endif
 
        /* Seek back to beginning of file */
        if (BIO_reset(in) == -1) {