--- /dev/null
+ *) mod_ssl: SSLFIPS compatible with OpenSSL 3.0. PR 66063.
+ [Petr Sumbera <petr.sumbera oracle.com>, Yann Ylavic]
\ No newline at end of file
#ifdef HAVE_FIPS
static apr_status_t modssl_fips_cleanup(void *data)
{
- FIPS_mode_set(0);
+ modssl_fips_enable(0);
return APR_SUCCESS;
}
#endif
}
#ifdef HAVE_FIPS
- if (!FIPS_mode() && mc->fips == TRUE) {
- if (!FIPS_mode_set(1)) {
+ if (!modssl_fips_is_enabled() && mc->fips == TRUE) {
+ if (!modssl_fips_enable(1)) {
ap_log_error(APLOG_MARK, APLOG_EMERG, 0, base_server, APLOGNO(01885)
"Could not enable FIPS mode");
ssl_log_ssl_error(SSLLOG_MARK, APLOG_EMERG, base_server);
/* Log actual FIPS mode which the SSL library is operating under,
* which may have been set outside of the mod_ssl
* configuration. */
- if (FIPS_mode()) {
+ if (modssl_fips_is_enabled()) {
ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, base_server, APLOGNO(01884)
MODSSL_LIBRARY_NAME " has FIPS mode enabled");
}
#define HAVE_OPENSSL_KEYLOG
#endif
+#ifdef HAVE_FIPS
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+#define modssl_fips_is_enabled() EVP_default_properties_is_fips_enabled(NULL)
+#define modssl_fips_enable(to) EVP_default_properties_enable_fips(NULL, (to))
+#else
+#define modssl_fips_is_enabled() FIPS_mode()
+#define modssl_fips_enable(to) FIPS_mode_set((to))
+#endif
+#endif /* HAVE_FIPS */
+
/* mod_ssl headers */
#include "ssl_util_ssl.h"