From 54493747a86fb30a24843d684d6e3648c642797b Mon Sep 17 00:00:00 2001 From: RipleyTom Date: Tue, 8 Sep 2020 11:23:47 +0200 Subject: [PATCH] Updates wolfssl and curl to official repos --- .gitmodules | 4 +-- 3rdparty/CMakeLists.txt | 31 +++++++++++++++++++-- 3rdparty/curl | 2 +- 3rdparty/curl_extra/wolfssl/options.h | 40 +++++++++++++++++++++++++++ 3rdparty/libcurl.vcxproj | 15 ++++++++-- 3rdparty/libusb_static.vcxproj | 1 + 3rdparty/wolfssl | 2 +- 3rdparty/wolfssl.vcxproj | 4 +-- 8 files changed, 89 insertions(+), 10 deletions(-) create mode 100644 3rdparty/curl_extra/wolfssl/options.h diff --git a/.gitmodules b/.gitmodules index 54bb75f3ef..88853254df 100644 --- a/.gitmodules +++ b/.gitmodules @@ -65,11 +65,11 @@ ignore = dirty [submodule "3rdparty/curl"] path = 3rdparty/curl - url = https://github.com/RipleyTom/curl.git + url = https://github.com/curl/curl.git ignore = dirty [submodule "3rdparty/wolfssl"] path = 3rdparty/wolfssl - url = https://github.com/RipleyTom/wolfssl.git + url = https://github.com/wolfSSL/wolfssl.git ignore = dirty [submodule "3rdparty/flatbuffers"] path = 3rdparty/flatbuffers diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt index 504366a459..db74fea130 100644 --- a/3rdparty/CMakeLists.txt +++ b/3rdparty/CMakeLists.txt @@ -417,7 +417,29 @@ endif() include(llvm.cmake) # WOLFSSL -add_subdirectory(wolfssl EXCLUDE_FROM_ALL) +if(USE_SYSTEM_WOLFSSL) + message("-- RPCS3: using shared wolfssl") + find_package(WolfSSL REQUIRED) + add_library(wolfssl INTERFACE) + target_link_libraries(wolfssl INTERFACE WolfSSL_LIBRARIES) + target_include_directories(wolfssl INTERFACE WolfSSL_INCLUDE_DIRS) +else() + SET(BUILD_TESTS NO CACHE BOOL "Build test applications") + add_definitions(-DHAVE_FFDHE_2048 -DTFM_TIMING_RESISTANT -DECC_TIMING_RESISTANT + -DWC_RSA_BLINDING -DHAVE_AESGCM -DWOLFSSL_SHA512 -DWOLFSSL_SHA384 -DNO_DSA -DHAVE_ECC -DTFM_ECC256 -DECC_SHAMIR + -DNO_RC4 -DNO_HC128 -DNO_RABBIT -DWOLFSSL_SHA224 -DWOLFSSL_SHA3 -DWOLFSSL_SHAKE256 -DHAVE_POLY1305 + -DHAVE_ONE_TIME_AUTH -DHAVE_CHACHA -DHAVE_HASHDRBG -DHAVE_TLS_EXTENSIONS -DHAVE_SNI -DHAVE_SUPPORTED_CURVES + -DHAVE_EXTENDED_MASTER -DNO_RC4 -DHAVE_ENCRYPT_THEN_MAC -DNO_PSK -DNO_MD4 + -DWC_NO_ASYNC_THREADING -DOPENSSL_EXTRA -DWOLFSSL_DES_ECB) + add_subdirectory(wolfssl EXCLUDE_FROM_ALL) + target_include_directories(wolfssl INTERFACE "wolfssl/") + # This is needed for CURL + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/wolfssl/wolfssl/options.h.in ${CMAKE_CURRENT_BINARY_DIR}/wolfssl/wolfssl/options.h) + set(WolfSSL_LIBRARY "${CMAKE_CURRENT_BINARY_DIR}/wolfssl/libwolfssl.a") + set(WolfSSL_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/wolfssl/libwolfssl.a") + set(WolfSSL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/wolfssl/" "${CMAKE_CURRENT_BINARY_DIR}/wolfssl/") + set(WolfSSL_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/wolfssl/" "${CMAKE_CURRENT_BINARY_DIR}/wolfssl/") +endif() # CURL if(USE_SYSTEM_CURL) @@ -427,6 +449,11 @@ if(USE_SYSTEM_CURL) target_link_libraries(libcurl INTERFACE CURL::libcurl) else() message("-- RPCS3: building libcurl + wolfssl submodules") + option(BUILD_CURL_EXE "Set to ON to build curl executable." OFF) + option(CMAKE_USE_WOLFSSL "enable wolfSSL for SSL/TLS" ON) + option(HTTP_ONLY "disables all protocols except HTTP (This overrides all CURL_DISABLE_* options)" ON) + option(CURL_ZLIB "Set to ON to enable building curl with zlib support." OFF) + set(CURL_CA_PATH "none" CACHE STRING "Location of default CA path. Set 'none' to disable or 'auto' for auto-detection. Defaults to 'auto'.") add_subdirectory(curl EXCLUDE_FROM_ALL) endif() @@ -453,5 +480,5 @@ add_library(3rdparty::vulkan ALIAS ${VULKAN_TARGET}) add_library(3rdparty::openal ALIAS 3rdparty_openal) add_library(3rdparty::ffmpeg ALIAS 3rdparty_ffmpeg) add_library(3rdparty::glew ALIAS 3rdparty_glew) -add_library(3rdparty::wolfssl ALIAS wolfssl-3-static) +add_library(3rdparty::wolfssl ALIAS wolfssl) add_library(3rdparty::libcurl ALIAS libcurl) diff --git a/3rdparty/curl b/3rdparty/curl index aa1a12cb23..9d954e49bc 160000 --- a/3rdparty/curl +++ b/3rdparty/curl @@ -1 +1 @@ -Subproject commit aa1a12cb234bd31c6058d04c398a159d06b85889 +Subproject commit 9d954e49bce3706a9a2efb119ecd05767f0f2a9e diff --git a/3rdparty/curl_extra/wolfssl/options.h b/3rdparty/curl_extra/wolfssl/options.h new file mode 100644 index 0000000000..0a5f45c23d --- /dev/null +++ b/3rdparty/curl_extra/wolfssl/options.h @@ -0,0 +1,40 @@ +/* options.h.in + * + * Copyright (C) 2006-2020 wolfSSL Inc. + * + * This file is part of wolfSSL. + * + * wolfSSL is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * wolfSSL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA + */ + + +/* default blank options for autoconf */ + +#ifndef WOLFSSL_OPTIONS_H +#define WOLFSSL_OPTIONS_H + + +#ifdef __cplusplus +extern "C" { +#endif + + +#ifdef __cplusplus +} +#endif + + +#endif /* WOLFSSL_OPTIONS_H */ + diff --git a/3rdparty/libcurl.vcxproj b/3rdparty/libcurl.vcxproj index 6f07768d89..7f511056bf 100644 --- a/3rdparty/libcurl.vcxproj +++ b/3rdparty/libcurl.vcxproj @@ -51,8 +51,8 @@ MaxSpeed OnlyExplicitInline - curl\include;curl\lib;wolfssl;%(AdditionalIncludeDirectories) - HAVE_SNI;NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_WOLFSSL;USE_IPV6;%(PreprocessorDefinitions) + curl\include;curl\lib;curl_extra;wolfssl;wolfssl\wolfssl;%(AdditionalIncludeDirectories) + HAVE_SNI;NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_WOLFSSL;USE_IPV6;SIZEOF_LONG=4;SIZEOF_LONG_LONG=8;%(PreprocessorDefinitions) true true Level4 @@ -97,6 +97,7 @@ + @@ -135,6 +136,7 @@ + @@ -178,6 +180,7 @@ + @@ -195,12 +198,14 @@ + + @@ -274,6 +279,7 @@ + @@ -300,6 +306,7 @@ + @@ -319,6 +326,7 @@ + @@ -342,6 +350,7 @@ + @@ -350,11 +359,13 @@ + + diff --git a/3rdparty/libusb_static.vcxproj b/3rdparty/libusb_static.vcxproj index f6b4d66b1b..6f49b8f6bd 100644 --- a/3rdparty/libusb_static.vcxproj +++ b/3rdparty/libusb_static.vcxproj @@ -41,6 +41,7 @@ + /utf-8 %(AdditionalOptions) libusb\msvc;libusb\libusb;%(AdditionalIncludeDirectories) WINVER=0x0501;_WIN32_WINNT=0x0501;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) $(IntDir)$(TargetName).pdb diff --git a/3rdparty/wolfssl b/3rdparty/wolfssl index d0749c6549..39b5448601 160000 --- a/3rdparty/wolfssl +++ b/3rdparty/wolfssl @@ -1 +1 @@ -Subproject commit d0749c65498672462b88fc8be5ea066cf65067f1 +Subproject commit 39b5448601271b8d1deabde8a0d33dc64d2a94bd diff --git a/3rdparty/wolfssl.vcxproj b/3rdparty/wolfssl.vcxproj index 97ce61259b..ef610c5446 100644 --- a/3rdparty/wolfssl.vcxproj +++ b/3rdparty/wolfssl.vcxproj @@ -48,7 +48,7 @@ Disabled ./wolfssl;./wolfssl/IDE/WIN;%(AdditionalIncludeDirectories) - WOLFSSL_LIB;WOLFSSL_USER_SETTINGS;CYASSL_USER_SETTINGS;%(PreprocessorDefinitions) + WOLFSSL_LIB;WOLFSSL_DES_ECB;HAVE_FFDHE_2048;TFM_TIMING_RESISTANT;ECC_TIMING_RESISTANT;WC_RSA_BLINDING;HAVE_AESGCM;WOLFSSL_SHA512;WOLFSSL_SHA384;NO_DSA;HAVE_ECC;TFM_ECC256;ECC_SHAMIR;NO_RC4;NO_HC128;NO_RABBIT;WOLFSSL_SHA224;WOLFSSL_SHA3;WOLFSSL_SHAKE256;HAVE_POLY1305;HAVE_ONE_TIME_AUTH;HAVE_CHACHA;HAVE_HASHDRBG;HAVE_TLS_EXTENSIONS;HAVE_SNI;HAVE_SUPPORTED_CURVES;HAVE_EXTENDED_MASTER;NO_RC4;HAVE_ENCRYPT_THEN_MAC;NO_PSK;NO_MD4;WC_NO_ASYNC_THREADING;OPENSSL_EXTRA;WOLFSSL_USER_SETTINGS;CYASSL_USER_SETTINGS;%(PreprocessorDefinitions) EnableFastChecks @@ -62,7 +62,7 @@ MaxSpeed true ./wolfssl;./wolfssl/IDE/WIN;%(AdditionalIncludeDirectories) - WOLFSSL_LIB;WOLFSSL_USER_SETTINGS;CYASSL_USER_SETTINGS;%(PreprocessorDefinitions) + WOLFSSL_LIB;WOLFSSL_DES_ECB;HAVE_FFDHE_2048;TFM_TIMING_RESISTANT;ECC_TIMING_RESISTANT;WC_RSA_BLINDING;HAVE_AESGCM;WOLFSSL_SHA512;WOLFSSL_SHA384;NO_DSA;HAVE_ECC;TFM_ECC256;ECC_SHAMIR;NO_RC4;NO_HC128;NO_RABBIT;WOLFSSL_SHA224;WOLFSSL_SHA3;WOLFSSL_SHAKE256;HAVE_POLY1305;HAVE_ONE_TIME_AUTH;HAVE_CHACHA;HAVE_HASHDRBG;HAVE_TLS_EXTENSIONS;HAVE_SNI;HAVE_SUPPORTED_CURVES;HAVE_EXTENDED_MASTER;NO_RC4;HAVE_ENCRYPT_THEN_MAC;NO_PSK;NO_MD4;WC_NO_ASYNC_THREADING;OPENSSL_EXTRA;WOLFSSL_USER_SETTINGS;CYASSL_USER_SETTINGS;%(PreprocessorDefinitions) true