#ifdef HAVE_OPENSSL_KEYLOG
mc->keylog_file = NULL;
#endif
+#ifdef HAVE_FIPS
+ mc->fips = UNSET;
+#endif
apr_pool_userdata_set(mc, SSL_MOD_CONFIG_KEY,
apr_pool_cleanup_null,
#ifdef HAVE_TLSEXT
sc->strict_sni_vhost_check = SSL_ENABLED_UNSET;
#endif
-#ifdef HAVE_FIPS
- sc->fips = UNSET;
-#endif
#ifndef OPENSSL_NO_COMP
sc->compression = UNSET;
#endif
#ifdef HAVE_TLSEXT
cfgMerge(strict_sni_vhost_check, SSL_ENABLED_UNSET);
#endif
-#ifdef HAVE_FIPS
- cfgMergeBool(fips);
-#endif
#ifndef OPENSSL_NO_COMP
cfgMergeBool(compression);
#endif
const char *ssl_cmd_SSLFIPS(cmd_parms *cmd, void *dcfg, int flag)
{
#ifdef HAVE_FIPS
- SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
+ SSLModConfigRec *mc = myModConfig(cmd->server);
#endif
const char *err;
}
#ifdef HAVE_FIPS
- if ((sc->fips != UNSET) && (sc->fips != (BOOL)(flag ? TRUE : FALSE)))
+ if ((mc->fips != UNSET) && (mc->fips != (BOOL)(flag ? TRUE : FALSE)))
return "Conflicting SSLFIPS options, cannot be both On and Off";
- sc->fips = flag ? TRUE : FALSE;
+ mc->fips = flag ? TRUE : FALSE;
#else
if (flag)
return "SSLFIPS invalid, rebuild httpd and openssl compiled for FIPS";
DMP_LONG( "SSLSessionCacheTimeout", sc->session_cache_timeout);
DMP_ON_OFF("SSLInsecureRenegotiation", sc->insecure_reneg);
DMP_ON_OFF("SSLStrictSNIVHostCheck", sc->strict_sni_vhost_check);
-#ifdef HAVE_FIPS
- DMP_ON_OFF("SSLFIPS", sc->fips);
-#endif
DMP_ON_OFF("SSLSessionTickets", sc->session_tickets);
}
if (sc->server && sc->server->pphrase_dialog_type == SSL_PPTYPE_UNSET) {
sc->server->pphrase_dialog_type = SSL_PPTYPE_BUILTIN;
}
-
-#ifdef HAVE_FIPS
- if (sc->fips == UNSET) {
- sc->fips = FALSE;
- }
-#endif
}
#if APR_HAS_THREADS && MODSSL_USE_OPENSSL_PRE_1_1_API
ssl_rand_seed(base_server, ptemp, SSL_RSCTX_STARTUP, "Init: ");
#ifdef HAVE_FIPS
- /* ### The FIPS setting is global and must be the same in all
- * SSLSrvConfigRecs, should be in SSLModConfigRec really. */
- sc = mySrvConfig(base_server);
- if (sc->fips) {
- if (!FIPS_mode()) {
- if (FIPS_mode_set(1)) {
- ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, base_server, APLOGNO(01884)
- "Operating in SSL FIPS mode");
- apr_pool_cleanup_register(p, NULL, modssl_fips_cleanup,
- apr_pool_cleanup_null);
- }
- else {
- ap_log_error(APLOG_MARK, APLOG_EMERG, 0, base_server, APLOGNO(01885) "FIPS mode failed");
- ssl_log_ssl_error(SSLLOG_MARK, APLOG_EMERG, base_server);
- return ssl_die(base_server);
- }
+ if (!FIPS_mode() && mc->fips == TRUE) {
+ if (!FIPS_mode_set(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);
+ return ssl_die(base_server);
}
+
+ apr_pool_cleanup_register(p, NULL, modssl_fips_cleanup,
+ apr_pool_cleanup_null);
+ }
+
+ /* 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()) {
+ ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, base_server, APLOGNO(01884)
+ MODSSL_LIBRARY_NAME " has FIPS mode enabled");
}
else {
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, base_server, APLOGNO(01886)
- "SSL FIPS mode disabled");
+ MODSSL_LIBRARY_NAME " has FIPS mode disabled");
}
#endif