diff --git a/src/core/linkedlist.c b/src/core/linkedlist.c index 2f36d3b..9616de4 100644 --- a/src/core/linkedlist.c +++ b/src/core/linkedlist.c @@ -36,6 +36,7 @@ #include #include #include +#include /*---[ Implement ]------------------------------------------------------------------------------------------------------------*/ diff --git a/src/network_modules/openssl/context.c b/src/network_modules/openssl/context.c index c4ea1d3..c4069d1 100644 --- a/src/network_modules/openssl/context.c +++ b/src/network_modules/openssl/context.c @@ -154,26 +154,54 @@ SSL_CTX * lib3270_openssl_get_context(H3270 *hSession) { SSL_load_error_strings(); SSL_library_init(); -#ifdef OPENSSL_FIPS +#if !defined(OPENSSL_FIPS) lib3270_write_log( hSession, "openssl", - "Initializing %s %s FIPS.\n", - SSLeay_version(SSLEAY_VERSION), - (FIPS_mode() ? "with" : "without" ) + "Initializing %s\n", + SSLeay_version(SSLEAY_VERSION) ); +#elif defined(_WIN32) + { + lib3270_auto_cleanup(HKEY) hKey; + DWORD disp = 0; + LSTATUS rc = RegCreateKeyEx( + HKEY_LOCAL_MACHINE, + "Software\\" LIB3270_STRINGIZE_VALUE_OF(PRODUCT_NAME) "\\tweaks", + 0, + NULL, + REG_OPTION_NON_VOLATILE, + KEY_QUERY_VALUE|KEY_READ, + NULL, + &hKey, + &disp); + + if(rc == ERROR_SUCCESS) { + FIPS_mode_set(lib3270_win32_get_dword(hKey, "fips_mode", 1)); + } + + lib3270_write_log( + hSession, + "openssl", + "Initializing %s %s FIPS.\n", + SSLeay_version(SSLEAY_VERSION), + (FIPS_mode() ? "with" : "without" ) + ); + + } #else lib3270_write_log( hSession, "openssl", - "Initializing %s without FIPS.\n", - SSLeay_version(SSLEAY_VERSION) + "Initializing %s %s FIPS.\n", + SSLeay_version(SSLEAY_VERSION), + (FIPS_mode() ? "with" : "without" ) ); -#endif // OPENSSL_FIPS +#endif context = SSL_CTX_new(SSLv23_method()); if(context == NULL) { diff --git a/src/testprogram/testprogram.c b/src/testprogram/testprogram.c index 87038e6..edfe298 100644 --- a/src/testprogram/testprogram.c +++ b/src/testprogram/testprogram.c @@ -41,6 +41,7 @@ #include #include #include +#include #ifdef _WIN32 #include -- libgit2 0.21.2