blob: 04fe644d475915cd8e7a682e15b8f05b07659240 [file] [log] [blame]
Andrew Geisslereff27472021-10-29 15:35:00 -05001From f703b1184229796d504a2e833f72ace4cc605d15 Mon Sep 17 00:00:00 2001
2From: Ondrej Holy <oholy@redhat.com>
3Date: Wed, 12 May 2021 12:48:15 +0200
4Subject: [PATCH 1/2] Fix FIPS mode support and build with OpenSSL 3.0
5
6FreeRDP fails to build with OpenSSL 3.0 because of usage of the `FIPS_mode`
7and `FIPS_mode_set` functions, which were removed there. Just a note that
8the FIPS mode is not supported by OpenSSL 1.1.* although the mentioned
9functions are still there (see https://wiki.openssl.org/index.php/FIPS_modules).
10Let's make FreeRDP build with OpenSSL 3.0 and fix the FIPS mode support.
11
12See: https://bugzilla.redhat.com/show_bug.cgi?id=1952937
13Upstream-Status: Backport
14Signed-off-by: Alexander Kanavin <alex@linutronix.de>
15---
16 winpr/libwinpr/utils/ssl.c | 8 ++++++++
17 1 file changed, 8 insertions(+)
18
19diff --git a/winpr/libwinpr/utils/ssl.c b/winpr/libwinpr/utils/ssl.c
20index 3a8590390..03b23af43 100644
21--- a/winpr/libwinpr/utils/ssl.c
22+++ b/winpr/libwinpr/utils/ssl.c
23@@ -244,9 +244,17 @@ static BOOL winpr_enable_fips(DWORD flags)
24 #else
25 WLog_DBG(TAG, "Ensuring openssl fips mode is ENabled");
26
27+#if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3)
28+ if (!EVP_default_properties_is_fips_enabled(NULL))
29+#else
30 if (FIPS_mode() != 1)
31+#endif
32 {
33+#if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3)
34+ if (EVP_set_default_properties(NULL, "fips=yes"))
35+#else
36 if (FIPS_mode_set(1))
37+#endif
38 WLog_INFO(TAG, "Openssl fips mode ENabled!");
39 else
40 {
41--
422.20.1
43