You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by yl...@apache.org on 2020/04/24 17:14:22 UTC
svn commit: r1876938 - /httpd/httpd/trunk/modules/ssl/ssl_engine_init.c
Author: ylavic
Date: Fri Apr 24 17:14:21 2020
New Revision: 1876938
URL: http://svn.apache.org/viewvc?rev=1876938&view=rev
Log:
mod_ssl: follow up to r1876934: wrap DH_bits()
DH_get0_p() seems to be undefined for some openssl versions, so it can't
be used to implement DH_bits() generically.
Add new a modssl_DH_bits() wrapper to call DH_bits() for openssl < 3,
and BN_num_bits(DH_get0_p(dh)) otherwise.
Modified:
httpd/httpd/trunk/modules/ssl/ssl_engine_init.c
Modified: httpd/httpd/trunk/modules/ssl/ssl_engine_init.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_engine_init.c?rev=1876938&r1=1876937&r2=1876938&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_engine_init.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_engine_init.c Fri Apr 24 17:14:21 2020
@@ -1322,6 +1322,15 @@ static int ssl_no_passwd_prompt_cb(char
return 0;
}
+static APR_INLINE int modssl_DH_bits(DH *dh)
+{
+#if OPENSSL_VERSION_NUMBER < 0x30000000L
+ return DH_bits(dh);
+#else
+ return BN_num_bits(DH_get0_p(dh));
+#endif
+}
+
static apr_status_t ssl_init_server_certs(server_rec *s,
apr_pool_t *p,
apr_pool_t *ptemp,
@@ -1521,7 +1530,7 @@ static apr_status_t ssl_init_server_cert
SSL_CTX_set_tmp_dh(mctx->ssl_ctx, dh);
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(02540)
"Custom DH parameters (%d bits) for %s loaded from %s",
- BN_num_bits(DH_get0_p(dh)), vhost_id, certfile);
+ modssl_DH_bits(dh), vhost_id, certfile);
DH_free(dh);
}