MINOR: ssl: do not look at DHparam with OPENSSL_NO_DH

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.
This commit is contained in:
Emmanuel Hocdet 2019-07-30 17:04:01 +02:00 committed by William Lallemand
parent 03e09f3818
commit 54227d8add

View File

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