diff options
| author | Sam Varshavchik | 2022-05-22 23:52:28 -0400 | 
|---|---|---|
| committer | Sam Varshavchik | 2022-05-22 23:52:31 -0400 | 
| commit | 83e37efc8ed785cd095eb585ff747e5702ec49b3 (patch) | |
| tree | 15aed6da6214e9a03d91be1754cd351175349945 /tcpd/libcouriertls.c | |
| parent | 1ce81fa6af52651628a0bffcd8b15fdb459901a5 (diff) | |
| download | courier-libs-83e37efc8ed785cd095eb585ff747e5702ec49b3.tar.bz2 | |
gcc 12, autotool updates, sqwebmail fixes.
Diffstat (limited to 'tcpd/libcouriertls.c')
| -rw-r--r-- | tcpd/libcouriertls.c | 22 | 
1 files changed, 21 insertions, 1 deletions
| diff --git a/tcpd/libcouriertls.c b/tcpd/libcouriertls.c index 7c42f19..9c2847a 100644 --- a/tcpd/libcouriertls.c +++ b/tcpd/libcouriertls.c @@ -409,19 +409,39 @@ static void load_dh_params(SSL_CTX *ctx, const char *filename,  	const struct tls_info *info=SSL_CTX_get_app_data(ctx);  	BIO	*bio; -	DH	*dh;  	if (*cert_file_flags)  		return;  	if ((bio=BIO_new_file(filename, "r")) != 0)  	{ +#if HAVE_PEM_READ_BIO_PARAMETERS_EX + +		OSSL_LIB_CTX *libctx=OSSL_LIB_CTX_get0_global_default(); + +		EVP_PKEY *pkey=PEM_read_bio_Parameters_ex(bio, NULL, libctx, +							  NULL); + +		if (pkey) +		{ +			if (EVP_PKEY_is_a(pkey, "DH")) +			{ +				SSL_CTX_set0_tmp_dh_pkey(ctx, pkey); +				*cert_file_flags = 1; +			} +			EVP_PKEY_free(pkey); +		} + +#else +		DH	*dh; +  		if ((dh=PEM_read_bio_DHparams(bio, NULL, NULL, NULL)) != 0)  		{  			SSL_CTX_set_tmp_dh(ctx, dh);  			*cert_file_flags = 1;  			DH_free(dh);  		} +#endif  		else  		{  			/* | 
