]> source.dussan.org Git - rspamd.git/commitdiff
fix compatibility with OpenSSL 3.0.0 3941/head
authorTomohiro "Tomo-p" KATO <tomop@teamgedoh.net>
Sat, 16 Oct 2021 07:29:43 +0000 (16:29 +0900)
committerTomohiro "Tomo-p" KATO <tomop@teamgedoh.net>
Sat, 16 Oct 2021 07:31:49 +0000 (16:31 +0900)
src/libserver/cfg_utils.c

index 7a9f9cd53dc1e88611a08894a371e9ae390e2338..5c2bd63d7d9f5ebe3d250bfa523af7db1c813d50 100644 (file)
@@ -2756,7 +2756,11 @@ rspamd_config_libs (struct rspamd_external_libs_ctx *ctx,
 
                        /* Toggle FIPS mode */
                        if (mode == 0) {
+#if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3)
+                               if (EVP_set_default_properties (NULL, "fips=yes") != 1) {
+#else
                                if (FIPS_mode_set (1) != 1) {
+#endif
                                        err = ERR_get_error ();
                                }
                        }
@@ -2765,7 +2769,11 @@ rspamd_config_libs (struct rspamd_external_libs_ctx *ctx,
                        }
 
                        if (err != (unsigned long)-1) {
+#if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3)
+                               msg_err_config ("EVP_set_default_properties failed: %s",
+#else
                                msg_err_config ("FIPS_mode_set failed: %s",
+#endif
                                                ERR_error_string (err, NULL));
                                ret = FALSE;
                        }