Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame^] | 1 | From f703b1184229796d504a2e833f72ace4cc605d15 Mon Sep 17 00:00:00 2001 |
| 2 | From: Ondrej Holy <oholy@redhat.com> |
| 3 | Date: Wed, 12 May 2021 12:48:15 +0200 |
| 4 | Subject: [PATCH 1/2] Fix FIPS mode support and build with OpenSSL 3.0 |
| 5 | |
| 6 | FreeRDP fails to build with OpenSSL 3.0 because of usage of the `FIPS_mode` |
| 7 | and `FIPS_mode_set` functions, which were removed there. Just a note that |
| 8 | the FIPS mode is not supported by OpenSSL 1.1.* although the mentioned |
| 9 | functions are still there (see https://wiki.openssl.org/index.php/FIPS_modules). |
| 10 | Let's make FreeRDP build with OpenSSL 3.0 and fix the FIPS mode support. |
| 11 | |
| 12 | See: https://bugzilla.redhat.com/show_bug.cgi?id=1952937 |
| 13 | Upstream-Status: Backport |
| 14 | Signed-off-by: Alexander Kanavin <alex@linutronix.de> |
| 15 | --- |
| 16 | winpr/libwinpr/utils/ssl.c | 8 ++++++++ |
| 17 | 1 file changed, 8 insertions(+) |
| 18 | |
| 19 | diff --git a/winpr/libwinpr/utils/ssl.c b/winpr/libwinpr/utils/ssl.c |
| 20 | index 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 | -- |
| 42 | 2.20.1 |
| 43 | |