FIPS_mode() and FIPS_mode_set() does not exist in OpenSSL versions before 1.0.1
authorBrent Collins <bcollins@forcepoint.com>
Mon, 10 Apr 2017 18:19:59 +0000 (13:19 -0500)
committerArmin Novak <armin.novak@thincast.com>
Fri, 17 Nov 2017 11:43:06 +0000 (12:43 +0100)
winpr/libwinpr/utils/ssl.c

index 455f30f..1d9a6da 100644 (file)
@@ -271,8 +271,10 @@ static BOOL CALLBACK _winpr_openssl_initialize(PINIT_ONCE once, PVOID param, PVO
                return FALSE;
 #endif
        g_winpr_openssl_initialized_by_winpr = TRUE;
+
        if (flags & WINPR_SSL_INIT_ENABLE_FIPS)
        {
+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
                WLog_DBG(TAG, "Ensuring openssl fips mode is ENabled");
                if (FIPS_mode() != 1)
                {
@@ -282,6 +284,9 @@ static BOOL CALLBACK _winpr_openssl_initialize(PINIT_ONCE once, PVOID param, PVO
                        else
                                WLog_INFO(TAG, "Openssl fips mode ENabled!");
                }
+#else
+               WLog_ERR(TAG, "Openssl fips mode ENable not available on openssl versions less than 1.0.1!");
+#endif
        }
        return TRUE;
 }