mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-15 02:18:39 +08:00
Merge pull request #7054 from sfc-gh-tclinkenbeard/remove-non-tls-support
Remove `DISABLE_TLS` CMake option
This commit is contained in:
commit
0069ce51a5
@ -126,7 +126,6 @@ You should create a second build-directory which you will use for building and d
|
||||
mkdir .build && cd .build
|
||||
cmake -G Ninja \
|
||||
-DUSE_CCACHE=on \
|
||||
-DDISABLE_TLS=off \
|
||||
-DUSE_DTRACE=off \
|
||||
..
|
||||
ninja -j 10
|
||||
|
@ -20,41 +20,36 @@ endif()
|
||||
|
||||
include(CheckSymbolExists)
|
||||
|
||||
set(DISABLE_TLS OFF CACHE BOOL "Don't try to find OpenSSL and always build without TLS support")
|
||||
set(USE_WOLFSSL OFF CACHE BOOL "Build against WolfSSL instead of OpenSSL")
|
||||
set(USE_OPENSSL ON CACHE BOOL "Build against OpenSSL")
|
||||
if(DISABLE_TLS)
|
||||
set(WITH_TLS OFF)
|
||||
else()
|
||||
if(USE_WOLFSSL)
|
||||
set(WOLFSSL_USE_STATIC_LIBS TRUE)
|
||||
find_package(WolfSSL)
|
||||
if(WOLFSSL_FOUND)
|
||||
set(CMAKE_REQUIRED_INCLUDES ${WOLFSSL_INCLUDE_DIR})
|
||||
set(WITH_TLS ON)
|
||||
add_compile_options(-DHAVE_OPENSSL)
|
||||
add_compile_options(-DHAVE_WOLFSSL)
|
||||
else()
|
||||
message(STATUS "WolfSSL was not found - Will compile without TLS Support")
|
||||
message(STATUS "You can set WOLFSSL_ROOT_DIR to help cmake find it")
|
||||
set(WITH_TLS OFF)
|
||||
endif()
|
||||
elseif(USE_OPENSSL)
|
||||
set(OPENSSL_USE_STATIC_LIBS TRUE)
|
||||
if(WIN32)
|
||||
set(OPENSSL_MSVC_STATIC_RT ON)
|
||||
endif()
|
||||
find_package(OpenSSL)
|
||||
if(OPENSSL_FOUND)
|
||||
set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
|
||||
set(WITH_TLS ON)
|
||||
add_compile_options(-DHAVE_OPENSSL)
|
||||
else()
|
||||
message(STATUS "OpenSSL was not found - Will compile without TLS Support")
|
||||
message(STATUS "You can set OPENSSL_ROOT_DIR to help cmake find it")
|
||||
set(WITH_TLS OFF)
|
||||
endif()
|
||||
if(USE_WOLFSSL)
|
||||
set(WOLFSSL_USE_STATIC_LIBS TRUE)
|
||||
find_package(WolfSSL)
|
||||
if(WOLFSSL_FOUND)
|
||||
set(CMAKE_REQUIRED_INCLUDES ${WOLFSSL_INCLUDE_DIR})
|
||||
add_compile_options(-DHAVE_OPENSSL)
|
||||
add_compile_options(-DHAVE_WOLFSSL)
|
||||
else()
|
||||
message(STATUS "WolfSSL was not found - Will compile without TLS Support")
|
||||
message(STATUS "You can set WOLFSSL_ROOT_DIR to help cmake find it")
|
||||
message(FATAL_ERROR "Unable to find WolfSSL")
|
||||
endif()
|
||||
elseif(USE_OPENSSL)
|
||||
set(OPENSSL_USE_STATIC_LIBS TRUE)
|
||||
if(WIN32)
|
||||
set(OPENSSL_MSVC_STATIC_RT ON)
|
||||
endif()
|
||||
find_package(OpenSSL)
|
||||
if(OPENSSL_FOUND)
|
||||
set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
|
||||
add_compile_options(-DHAVE_OPENSSL)
|
||||
else()
|
||||
message(STATUS "OpenSSL was not found - Will compile without TLS Support")
|
||||
message(STATUS "You can set OPENSSL_ROOT_DIR to help cmake find it")
|
||||
message(FATAL_ERROR "Unable to find OpenSSL")
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "Must set USE_WOLFSSL or USE_OPENSSL")
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
@ -255,7 +250,6 @@ function(print_components)
|
||||
message(STATUS "Build Java Bindings: ${WITH_JAVA_BINDING}")
|
||||
message(STATUS "Build Go bindings: ${WITH_GO_BINDING}")
|
||||
message(STATUS "Build Ruby bindings: ${WITH_RUBY_BINDING}")
|
||||
message(STATUS "Build with TLS support: ${WITH_TLS}")
|
||||
message(STATUS "Build Documentation (make html): ${WITH_DOCUMENTATION}")
|
||||
message(STATUS "Build Python sdist (make package): ${WITH_PYTHON_BINDING}")
|
||||
message(STATUS "Configure CTest (depends on Python): ${WITH_PYTHON}")
|
||||
@ -265,7 +259,7 @@ function(print_components)
|
||||
endfunction()
|
||||
|
||||
if(FORCE_ALL_COMPONENTS)
|
||||
if(NOT WITH_C_BINDING OR NOT WITH_JAVA_BINDING OR NOT WITH_TLS OR NOT WITH_GO_BINDING OR NOT WITH_RUBY_BINDING OR NOT WITH_PYTHON_BINDING OR NOT WITH_DOCUMENTATION)
|
||||
if(NOT WITH_C_BINDING OR NOT WITH_JAVA_BINDING OR NOT WITH_GO_BINDING OR NOT WITH_RUBY_BINDING OR NOT WITH_PYTHON_BINDING OR NOT WITH_DOCUMENTATION)
|
||||
print_components()
|
||||
message(FATAL_ERROR "FORCE_ALL_COMPONENTS is set but not all dependencies could be found")
|
||||
endif()
|
||||
|
@ -65,9 +65,7 @@ CSimpleOpt::SOption gConverterOptions[] = { { OPT_CONTAINER, "-r", SO_REQ_SEP },
|
||||
{ OPT_INPUT_FILE, "-i", SO_REQ_SEP },
|
||||
{ OPT_INPUT_FILE, "--input", SO_REQ_SEP },
|
||||
{ OPT_BLOB_CREDENTIALS, "--blob-credentials", SO_REQ_SEP },
|
||||
#ifndef TLS_DISABLED
|
||||
TLS_OPTION_FLAGS
|
||||
#endif
|
||||
TLS_OPTION_FLAGS,
|
||||
{ OPT_BUILD_FLAGS, "--build-flags", SO_NONE },
|
||||
{ OPT_LIST_ONLY, "--list-only", SO_NONE },
|
||||
{ OPT_KEY_PREFIX, "-k", SO_REQ_SEP },
|
||||
|
@ -75,10 +75,7 @@ void printDecodeUsage() {
|
||||
" --crash Crash on serious error.\n"
|
||||
" --blob-credentials FILE\n"
|
||||
" File containing blob credentials in JSON format.\n"
|
||||
" The same credential format/file fdbbackup uses.\n"
|
||||
#ifndef TLS_DISABLED
|
||||
TLS_HELP
|
||||
#endif
|
||||
" The same credential format/file fdbbackup uses.\n" TLS_HELP
|
||||
" --build-flags Print build information and exit.\n"
|
||||
" --list-only Print file list and exit.\n"
|
||||
" -k KEY_PREFIX Use the prefix for filtering mutations\n"
|
||||
@ -302,7 +299,6 @@ int parseDecodeCommandLine(DecodeParams* param, CSimpleOpt* args) {
|
||||
param->save_file_locally = true;
|
||||
break;
|
||||
|
||||
#ifndef TLS_DISABLED
|
||||
case TLSConfig::OPT_TLS_PLUGIN:
|
||||
args->OptionArg();
|
||||
break;
|
||||
@ -326,7 +322,6 @@ int parseDecodeCommandLine(DecodeParams* param, CSimpleOpt* args) {
|
||||
case TLSConfig::OPT_TLS_VERIFY_PEERS:
|
||||
param->tlsConfig.tlsVerifyPeers = args->OptionArg();
|
||||
break;
|
||||
#endif
|
||||
|
||||
case OPT_BUILD_FLAGS:
|
||||
printBuildInformation();
|
||||
|
@ -220,10 +220,8 @@ CSimpleOpt::SOption g_rgAgentOptions[] = {
|
||||
{ OPT_HELP, "--help", SO_NONE },
|
||||
{ OPT_DEVHELP, "--dev-help", SO_NONE },
|
||||
{ OPT_BLOB_CREDENTIALS, "--blob-credentials", SO_REQ_SEP },
|
||||
#ifndef TLS_DISABLED
|
||||
TLS_OPTION_FLAGS
|
||||
#endif
|
||||
SO_END_OF_OPTIONS
|
||||
TLS_OPTION_FLAGS,
|
||||
SO_END_OF_OPTIONS
|
||||
};
|
||||
|
||||
CSimpleOpt::SOption g_rgBackupStartOptions[] = {
|
||||
@ -269,10 +267,8 @@ CSimpleOpt::SOption g_rgBackupStartOptions[] = {
|
||||
{ OPT_BLOB_CREDENTIALS, "--blob-credentials", SO_REQ_SEP },
|
||||
{ OPT_INCREMENTALONLY, "--incremental", SO_NONE },
|
||||
{ OPT_ENCRYPTION_KEY_FILE, "--encryption-key-file", SO_REQ_SEP },
|
||||
#ifndef TLS_DISABLED
|
||||
TLS_OPTION_FLAGS
|
||||
#endif
|
||||
SO_END_OF_OPTIONS
|
||||
TLS_OPTION_FLAGS,
|
||||
SO_END_OF_OPTIONS
|
||||
};
|
||||
|
||||
CSimpleOpt::SOption g_rgBackupModifyOptions[] = {
|
||||
@ -335,10 +331,8 @@ CSimpleOpt::SOption g_rgBackupStatusOptions[] = {
|
||||
{ OPT_DEVHELP, "--dev-help", SO_NONE },
|
||||
{ OPT_JSON, "--json", SO_NONE },
|
||||
{ OPT_KNOB, "--knob-", SO_REQ_SEP },
|
||||
#ifndef TLS_DISABLED
|
||||
TLS_OPTION_FLAGS
|
||||
#endif
|
||||
SO_END_OF_OPTIONS
|
||||
TLS_OPTION_FLAGS,
|
||||
SO_END_OF_OPTIONS
|
||||
};
|
||||
|
||||
CSimpleOpt::SOption g_rgBackupAbortOptions[] = {
|
||||
@ -364,10 +358,8 @@ CSimpleOpt::SOption g_rgBackupAbortOptions[] = {
|
||||
{ OPT_HELP, "--help", SO_NONE },
|
||||
{ OPT_DEVHELP, "--dev-help", SO_NONE },
|
||||
{ OPT_KNOB, "--knob-", SO_REQ_SEP },
|
||||
#ifndef TLS_DISABLED
|
||||
TLS_OPTION_FLAGS
|
||||
#endif
|
||||
SO_END_OF_OPTIONS
|
||||
TLS_OPTION_FLAGS,
|
||||
SO_END_OF_OPTIONS
|
||||
};
|
||||
|
||||
CSimpleOpt::SOption g_rgBackupCleanupOptions[] = {
|
||||
@ -393,10 +385,8 @@ CSimpleOpt::SOption g_rgBackupCleanupOptions[] = {
|
||||
{ OPT_KNOB, "--knob-", SO_REQ_SEP },
|
||||
{ OPT_DELETE_DATA, "--delete-data", SO_NONE },
|
||||
{ OPT_MIN_CLEANUP_SECONDS, "--min-cleanup-seconds", SO_REQ_SEP },
|
||||
#ifndef TLS_DISABLED
|
||||
TLS_OPTION_FLAGS
|
||||
#endif
|
||||
SO_END_OF_OPTIONS
|
||||
TLS_OPTION_FLAGS,
|
||||
SO_END_OF_OPTIONS
|
||||
};
|
||||
|
||||
CSimpleOpt::SOption g_rgBackupDiscontinueOptions[] = {
|
||||
@ -424,10 +414,8 @@ CSimpleOpt::SOption g_rgBackupDiscontinueOptions[] = {
|
||||
{ OPT_HELP, "--help", SO_NONE },
|
||||
{ OPT_DEVHELP, "--dev-help", SO_NONE },
|
||||
{ OPT_KNOB, "--knob-", SO_REQ_SEP },
|
||||
#ifndef TLS_DISABLED
|
||||
TLS_OPTION_FLAGS
|
||||
#endif
|
||||
SO_END_OF_OPTIONS
|
||||
TLS_OPTION_FLAGS,
|
||||
SO_END_OF_OPTIONS
|
||||
};
|
||||
|
||||
CSimpleOpt::SOption g_rgBackupWaitOptions[] = {
|
||||
@ -455,10 +443,8 @@ CSimpleOpt::SOption g_rgBackupWaitOptions[] = {
|
||||
{ OPT_HELP, "--help", SO_NONE },
|
||||
{ OPT_DEVHELP, "--dev-help", SO_NONE },
|
||||
{ OPT_KNOB, "--knob-", SO_REQ_SEP },
|
||||
#ifndef TLS_DISABLED
|
||||
TLS_OPTION_FLAGS
|
||||
#endif
|
||||
SO_END_OF_OPTIONS
|
||||
TLS_OPTION_FLAGS,
|
||||
SO_END_OF_OPTIONS
|
||||
};
|
||||
|
||||
CSimpleOpt::SOption g_rgBackupPauseOptions[] = {
|
||||
@ -482,10 +468,8 @@ CSimpleOpt::SOption g_rgBackupPauseOptions[] = {
|
||||
{ OPT_HELP, "--help", SO_NONE },
|
||||
{ OPT_DEVHELP, "--dev-help", SO_NONE },
|
||||
{ OPT_KNOB, "--knob-", SO_REQ_SEP },
|
||||
#ifndef TLS_DISABLED
|
||||
TLS_OPTION_FLAGS
|
||||
#endif
|
||||
SO_END_OF_OPTIONS
|
||||
TLS_OPTION_FLAGS,
|
||||
SO_END_OF_OPTIONS
|
||||
};
|
||||
|
||||
CSimpleOpt::SOption g_rgBackupExpireOptions[] = {
|
||||
@ -521,10 +505,8 @@ CSimpleOpt::SOption g_rgBackupExpireOptions[] = {
|
||||
{ OPT_EXPIRE_BEFORE_DATETIME, "--expire-before-timestamp", SO_REQ_SEP },
|
||||
{ OPT_EXPIRE_MIN_RESTORABLE_DAYS, "--min-restorable-days", SO_REQ_SEP },
|
||||
{ OPT_EXPIRE_DELETE_BEFORE_DAYS, "--delete-before-days", SO_REQ_SEP },
|
||||
#ifndef TLS_DISABLED
|
||||
TLS_OPTION_FLAGS
|
||||
#endif
|
||||
SO_END_OF_OPTIONS
|
||||
TLS_OPTION_FLAGS,
|
||||
SO_END_OF_OPTIONS
|
||||
};
|
||||
|
||||
CSimpleOpt::SOption g_rgBackupDeleteOptions[] = {
|
||||
@ -550,10 +532,8 @@ CSimpleOpt::SOption g_rgBackupDeleteOptions[] = {
|
||||
{ OPT_DEVHELP, "--dev-help", SO_NONE },
|
||||
{ OPT_BLOB_CREDENTIALS, "--blob-credentials", SO_REQ_SEP },
|
||||
{ OPT_KNOB, "--knob-", SO_REQ_SEP },
|
||||
#ifndef TLS_DISABLED
|
||||
TLS_OPTION_FLAGS
|
||||
#endif
|
||||
SO_END_OF_OPTIONS
|
||||
TLS_OPTION_FLAGS,
|
||||
SO_END_OF_OPTIONS
|
||||
};
|
||||
|
||||
CSimpleOpt::SOption g_rgBackupDescribeOptions[] = {
|
||||
@ -584,10 +564,8 @@ CSimpleOpt::SOption g_rgBackupDescribeOptions[] = {
|
||||
{ OPT_DESCRIBE_DEEP, "--deep", SO_NONE },
|
||||
{ OPT_DESCRIBE_TIMESTAMPS, "--version-timestamps", SO_NONE },
|
||||
{ OPT_JSON, "--json", SO_NONE },
|
||||
#ifndef TLS_DISABLED
|
||||
TLS_OPTION_FLAGS
|
||||
#endif
|
||||
SO_END_OF_OPTIONS
|
||||
TLS_OPTION_FLAGS,
|
||||
SO_END_OF_OPTIONS
|
||||
};
|
||||
|
||||
CSimpleOpt::SOption g_rgBackupDumpOptions[] = {
|
||||
@ -616,10 +594,8 @@ CSimpleOpt::SOption g_rgBackupDumpOptions[] = {
|
||||
{ OPT_KNOB, "--knob-", SO_REQ_SEP },
|
||||
{ OPT_DUMP_BEGIN, "--begin", SO_REQ_SEP },
|
||||
{ OPT_DUMP_END, "--end", SO_REQ_SEP },
|
||||
#ifndef TLS_DISABLED
|
||||
TLS_OPTION_FLAGS
|
||||
#endif
|
||||
SO_END_OF_OPTIONS
|
||||
TLS_OPTION_FLAGS,
|
||||
SO_END_OF_OPTIONS
|
||||
};
|
||||
|
||||
CSimpleOpt::SOption g_rgBackupTagsOptions[] = {
|
||||
@ -634,10 +610,8 @@ CSimpleOpt::SOption g_rgBackupTagsOptions[] = {
|
||||
{ OPT_TRACE_LOG_GROUP, "--loggroup", SO_REQ_SEP },
|
||||
{ OPT_QUIET, "-q", SO_NONE },
|
||||
{ OPT_QUIET, "--quiet", SO_NONE },
|
||||
#ifndef TLS_DISABLED
|
||||
TLS_OPTION_FLAGS
|
||||
#endif
|
||||
SO_END_OF_OPTIONS
|
||||
TLS_OPTION_FLAGS,
|
||||
SO_END_OF_OPTIONS
|
||||
};
|
||||
|
||||
CSimpleOpt::SOption g_rgBackupListOptions[] = {
|
||||
@ -662,10 +636,8 @@ CSimpleOpt::SOption g_rgBackupListOptions[] = {
|
||||
{ OPT_DEVHELP, "--dev-help", SO_NONE },
|
||||
{ OPT_BLOB_CREDENTIALS, "--blob-credentials", SO_REQ_SEP },
|
||||
{ OPT_KNOB, "--knob-", SO_REQ_SEP },
|
||||
#ifndef TLS_DISABLED
|
||||
TLS_OPTION_FLAGS
|
||||
#endif
|
||||
SO_END_OF_OPTIONS
|
||||
TLS_OPTION_FLAGS,
|
||||
SO_END_OF_OPTIONS
|
||||
};
|
||||
|
||||
CSimpleOpt::SOption g_rgBackupQueryOptions[] = {
|
||||
@ -698,10 +670,8 @@ CSimpleOpt::SOption g_rgBackupQueryOptions[] = {
|
||||
{ OPT_DEVHELP, "--dev-help", SO_NONE },
|
||||
{ OPT_BLOB_CREDENTIALS, "--blob-credentials", SO_REQ_SEP },
|
||||
{ OPT_KNOB, "--knob-", SO_REQ_SEP },
|
||||
#ifndef TLS_DISABLED
|
||||
TLS_OPTION_FLAGS
|
||||
#endif
|
||||
SO_END_OF_OPTIONS
|
||||
TLS_OPTION_FLAGS,
|
||||
SO_END_OF_OPTIONS
|
||||
};
|
||||
|
||||
// g_rgRestoreOptions is used by fdbrestore and fastrestore_tool
|
||||
@ -747,10 +717,8 @@ CSimpleOpt::SOption g_rgRestoreOptions[] = {
|
||||
{ OPT_RESTORE_BEGIN_VERSION, "--begin-version", SO_REQ_SEP },
|
||||
{ OPT_RESTORE_INCONSISTENT_SNAPSHOT_ONLY, "--inconsistent-snapshot-only", SO_NONE },
|
||||
{ OPT_ENCRYPTION_KEY_FILE, "--encryption-key-file", SO_REQ_SEP },
|
||||
#ifndef TLS_DISABLED
|
||||
TLS_OPTION_FLAGS
|
||||
#endif
|
||||
SO_END_OF_OPTIONS
|
||||
TLS_OPTION_FLAGS,
|
||||
SO_END_OF_OPTIONS
|
||||
};
|
||||
|
||||
CSimpleOpt::SOption g_rgDBAgentOptions[] = {
|
||||
@ -780,10 +748,8 @@ CSimpleOpt::SOption g_rgDBAgentOptions[] = {
|
||||
{ OPT_HELP, "-h", SO_NONE },
|
||||
{ OPT_HELP, "--help", SO_NONE },
|
||||
{ OPT_DEVHELP, "--dev-help", SO_NONE },
|
||||
#ifndef TLS_DISABLED
|
||||
TLS_OPTION_FLAGS
|
||||
#endif
|
||||
SO_END_OF_OPTIONS
|
||||
TLS_OPTION_FLAGS,
|
||||
SO_END_OF_OPTIONS
|
||||
};
|
||||
|
||||
CSimpleOpt::SOption g_rgDBStartOptions[] = {
|
||||
@ -813,10 +779,8 @@ CSimpleOpt::SOption g_rgDBStartOptions[] = {
|
||||
{ OPT_HELP, "--help", SO_NONE },
|
||||
{ OPT_DEVHELP, "--dev-help", SO_NONE },
|
||||
{ OPT_KNOB, "--knob-", SO_REQ_SEP },
|
||||
#ifndef TLS_DISABLED
|
||||
TLS_OPTION_FLAGS
|
||||
#endif
|
||||
SO_END_OF_OPTIONS
|
||||
TLS_OPTION_FLAGS,
|
||||
SO_END_OF_OPTIONS
|
||||
};
|
||||
|
||||
CSimpleOpt::SOption g_rgDBStatusOptions[] = {
|
||||
@ -846,10 +810,8 @@ CSimpleOpt::SOption g_rgDBStatusOptions[] = {
|
||||
{ OPT_HELP, "--help", SO_NONE },
|
||||
{ OPT_DEVHELP, "--dev-help", SO_NONE },
|
||||
{ OPT_KNOB, "--knob-", SO_REQ_SEP },
|
||||
#ifndef TLS_DISABLED
|
||||
TLS_OPTION_FLAGS
|
||||
#endif
|
||||
SO_END_OF_OPTIONS
|
||||
TLS_OPTION_FLAGS,
|
||||
SO_END_OF_OPTIONS
|
||||
};
|
||||
|
||||
CSimpleOpt::SOption g_rgDBSwitchOptions[] = {
|
||||
@ -878,10 +840,8 @@ CSimpleOpt::SOption g_rgDBSwitchOptions[] = {
|
||||
{ OPT_HELP, "--help", SO_NONE },
|
||||
{ OPT_DEVHELP, "--dev-help", SO_NONE },
|
||||
{ OPT_KNOB, "--knob-", SO_REQ_SEP },
|
||||
#ifndef TLS_DISABLED
|
||||
TLS_OPTION_FLAGS
|
||||
#endif
|
||||
SO_END_OF_OPTIONS
|
||||
TLS_OPTION_FLAGS,
|
||||
SO_END_OF_OPTIONS
|
||||
};
|
||||
|
||||
CSimpleOpt::SOption g_rgDBAbortOptions[] = {
|
||||
@ -911,10 +871,8 @@ CSimpleOpt::SOption g_rgDBAbortOptions[] = {
|
||||
{ OPT_HELP, "--help", SO_NONE },
|
||||
{ OPT_DEVHELP, "--dev-help", SO_NONE },
|
||||
{ OPT_KNOB, "--knob-", SO_REQ_SEP },
|
||||
#ifndef TLS_DISABLED
|
||||
TLS_OPTION_FLAGS
|
||||
#endif
|
||||
SO_END_OF_OPTIONS
|
||||
TLS_OPTION_FLAGS,
|
||||
SO_END_OF_OPTIONS
|
||||
};
|
||||
|
||||
CSimpleOpt::SOption g_rgDBPauseOptions[] = {
|
||||
@ -940,10 +898,8 @@ CSimpleOpt::SOption g_rgDBPauseOptions[] = {
|
||||
{ OPT_HELP, "--help", SO_NONE },
|
||||
{ OPT_DEVHELP, "--dev-help", SO_NONE },
|
||||
{ OPT_KNOB, "--knob-", SO_REQ_SEP },
|
||||
#ifndef TLS_DISABLED
|
||||
TLS_OPTION_FLAGS
|
||||
#endif
|
||||
SO_END_OF_OPTIONS
|
||||
TLS_OPTION_FLAGS,
|
||||
SO_END_OF_OPTIONS
|
||||
};
|
||||
|
||||
const KeyRef exeAgent = LiteralStringRef("backup_agent");
|
||||
@ -1017,9 +973,7 @@ static void printAgentUsage(bool devhelp) {
|
||||
printf(" -m SIZE, --memory SIZE\n"
|
||||
" Memory limit. The default value is 8GiB. When specified\n"
|
||||
" without a unit, MiB is assumed.\n");
|
||||
#ifndef TLS_DISABLED
|
||||
printf(TLS_HELP);
|
||||
#endif
|
||||
printf(" --build-flags Print build information and exit.\n");
|
||||
printf(" -v, --version Print version information and exit.\n");
|
||||
printf(" -h, --help Display this help and exit.\n");
|
||||
@ -1147,9 +1101,7 @@ static void printBackupUsage(bool devhelp) {
|
||||
"and ignore the range files.\n");
|
||||
printf(" --encryption-key-file"
|
||||
" The AES-128-GCM key in the provided file is used for encrypting backup files.\n");
|
||||
#ifndef TLS_DISABLED
|
||||
printf(TLS_HELP);
|
||||
#endif
|
||||
printf(" -w, --wait Wait for the backup to complete (allowed with `start' and `discontinue').\n");
|
||||
printf(" -z, --no-stop-when-done\n"
|
||||
" Do not stop backup when restorable.\n");
|
||||
@ -1222,9 +1174,7 @@ static void printRestoreUsage(bool devhelp) {
|
||||
"instead of the entire set.\n");
|
||||
printf(" --encryption-key-file"
|
||||
" The AES-128-GCM key in the provided file is used for decrypting backup files.\n");
|
||||
#ifndef TLS_DISABLED
|
||||
printf(TLS_HELP);
|
||||
#endif
|
||||
printf(" -v DBVERSION The version at which the database will be restored.\n");
|
||||
printf(" --timestamp Instead of a numeric version, use this to specify a timestamp in %s\n",
|
||||
BackupAgentBase::timeFormat().c_str());
|
||||
@ -1281,9 +1231,7 @@ static void printDBAgentUsage(bool devhelp) {
|
||||
printf(" -m, --memory SIZE\n"
|
||||
" Memory limit. The default value is 8GiB. When specified\n"
|
||||
" without a unit, MiB is assumed.\n");
|
||||
#ifndef TLS_DISABLED
|
||||
printf(TLS_HELP);
|
||||
#endif
|
||||
printf(" --build-flags Print build information and exit.\n");
|
||||
printf(" -v, --version Print version information and exit.\n");
|
||||
printf(" -h, --help Display this help and exit.\n");
|
||||
@ -1322,9 +1270,7 @@ static void printDBBackupUsage(bool devhelp) {
|
||||
" If not specified, the entire database will be backed up.\n");
|
||||
printf(" --cleanup Abort will attempt to stop mutation logging on the source cluster.\n");
|
||||
printf(" --dstonly Abort will not make any changes on the source cluster.\n");
|
||||
#ifndef TLS_DISABLED
|
||||
printf(TLS_HELP);
|
||||
#endif
|
||||
printf(" --log Enables trace file logging for the CLI session.\n"
|
||||
" --logdir PATH Specifes the output directory for trace files. If\n"
|
||||
" unspecified, defaults to the current directory. Has\n"
|
||||
@ -3793,7 +3739,6 @@ int main(int argc, char* argv[]) {
|
||||
case OPT_BLOB_CREDENTIALS:
|
||||
tlsConfig.blobCredentials.push_back(args->OptionArg());
|
||||
break;
|
||||
#ifndef TLS_DISABLED
|
||||
case TLSConfig::OPT_TLS_PLUGIN:
|
||||
args->OptionArg();
|
||||
break;
|
||||
@ -3812,7 +3757,6 @@ int main(int argc, char* argv[]) {
|
||||
case TLSConfig::OPT_TLS_VERIFY_PEERS:
|
||||
tlsConfig.tlsVerifyPeers = args->OptionArg();
|
||||
break;
|
||||
#endif
|
||||
case OPT_DUMP_BEGIN:
|
||||
dumpBegin = parseVersion(args->OptionArg());
|
||||
break;
|
||||
|
@ -125,12 +125,8 @@ CSimpleOpt::SOption g_rgOptions[] = { { OPT_CONNFILE, "-C", SO_REQ_SEP },
|
||||
{ OPT_DEBUG_TLS, "--debug-tls", SO_NONE },
|
||||
{ OPT_API_VERSION, "--api-version", SO_REQ_SEP },
|
||||
{ OPT_MEMORY, "--memory", SO_REQ_SEP },
|
||||
|
||||
#ifndef TLS_DISABLED
|
||||
TLS_OPTION_FLAGS
|
||||
#endif
|
||||
|
||||
SO_END_OF_OPTIONS };
|
||||
TLS_OPTION_FLAGS,
|
||||
SO_END_OF_OPTIONS };
|
||||
|
||||
void printAtCol(const char* text, int col, FILE* stream = stdout) {
|
||||
const char* iter = text;
|
||||
@ -448,10 +444,7 @@ static void printProgramUsage(const char* name) {
|
||||
" --no-status Disables the initial status check done when starting\n"
|
||||
" the CLI.\n"
|
||||
" --api-version APIVERSION\n"
|
||||
" Specifies the version of the API for the CLI to use.\n"
|
||||
#ifndef TLS_DISABLED
|
||||
TLS_HELP
|
||||
#endif
|
||||
" Specifies the version of the API for the CLI to use.\n" TLS_HELP
|
||||
" --knob-KNOBNAME KNOBVALUE\n"
|
||||
" Changes a knob option. KNOBNAME should be lowercase.\n"
|
||||
" --debug-tls Prints the TLS configuration and certificate chain, then exits.\n"
|
||||
@ -953,7 +946,6 @@ struct CLIOptions {
|
||||
case OPT_NO_HINTS:
|
||||
cliHints = false;
|
||||
|
||||
#ifndef TLS_DISABLED
|
||||
// TLS Options
|
||||
case TLSConfig::OPT_TLS_PLUGIN:
|
||||
args.OptionArg();
|
||||
@ -973,7 +965,7 @@ struct CLIOptions {
|
||||
case TLSConfig::OPT_TLS_VERIFY_PEERS:
|
||||
tlsVerifyPeers = args.OptionArg();
|
||||
break;
|
||||
#endif
|
||||
|
||||
case OPT_HELP:
|
||||
printProgramUsage(program_name.c_str());
|
||||
return 0;
|
||||
@ -2087,7 +2079,6 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
|
||||
if (opt.debugTLS) {
|
||||
#ifndef TLS_DISABLED
|
||||
// Backdoor into NativeAPI's tlsConfig, which is where the above network option settings ended up.
|
||||
extern TLSConfig tlsConfig;
|
||||
printf("TLS Configuration:\n");
|
||||
@ -2104,9 +2095,6 @@ int main(int argc, char** argv) {
|
||||
printf("Use --log and look at the trace logs for more detailed information on the failure.\n");
|
||||
return 1;
|
||||
}
|
||||
#else
|
||||
printf("This fdbcli was built with TLS disabled.\n");
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -213,9 +213,7 @@ public:
|
||||
// Hack to get around the fact that macros don't work inside actor functions
|
||||
static Reference<IAsyncFile> encryptFile(Reference<IAsyncFile> const& f, AsyncFileEncrypted::Mode mode) {
|
||||
Reference<IAsyncFile> result = f;
|
||||
#if ENCRYPTION_ENABLED
|
||||
result = makeReference<AsyncFileEncrypted>(result, mode);
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1128,7 +1128,6 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
#if ENCRYPTION_ENABLED
|
||||
ACTOR static Future<Void> createTestEncryptionKeyFile(std::string filename) {
|
||||
state Reference<IAsyncFile> keyFile = wait(IAsyncFileSystem::filesystem()->open(
|
||||
filename,
|
||||
@ -1164,7 +1163,6 @@ public:
|
||||
ASSERT_EQ(bytesRead, cipherKey->size());
|
||||
return Void();
|
||||
}
|
||||
#endif // ENCRYPTION_ENABLED
|
||||
|
||||
}; // class BackupContainerFileSystemImpl
|
||||
|
||||
@ -1481,19 +1479,11 @@ Future<Void> BackupContainerFileSystem::encryptionSetupComplete() const {
|
||||
|
||||
void BackupContainerFileSystem::setEncryptionKey(Optional<std::string> const& encryptionKeyFileName) {
|
||||
if (encryptionKeyFileName.present()) {
|
||||
#if ENCRYPTION_ENABLED
|
||||
encryptionSetupFuture = BackupContainerFileSystemImpl::readEncryptionKey(encryptionKeyFileName.get());
|
||||
#else
|
||||
encryptionSetupFuture = Void();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
Future<Void> BackupContainerFileSystem::createTestEncryptionKeyFile(std::string const& filename) {
|
||||
#if ENCRYPTION_ENABLED
|
||||
return BackupContainerFileSystemImpl::createTestEncryptionKeyFile(filename);
|
||||
#else
|
||||
return Void();
|
||||
#endif
|
||||
}
|
||||
|
||||
// Get a BackupContainerFileSystem based on a container URL string
|
||||
|
@ -20,9 +20,7 @@
|
||||
|
||||
#include "fdbclient/AsyncFileS3BlobStore.actor.h"
|
||||
#include "fdbclient/BackupContainerS3BlobStore.h"
|
||||
#if (!defined(TLS_DISABLED) && !defined(_WIN32))
|
||||
#include "fdbrpc/AsyncFileEncrypted.h"
|
||||
#endif
|
||||
#include "fdbrpc/AsyncFileReadAhead.actor.h"
|
||||
#include "flow/actorcompiler.h" // This must be the last #include.
|
||||
|
||||
@ -174,11 +172,9 @@ std::string BackupContainerS3BlobStore::getURLFormat() {
|
||||
Future<Reference<IAsyncFile>> BackupContainerS3BlobStore::readFile(const std::string& path) {
|
||||
Reference<IAsyncFile> f = makeReference<AsyncFileS3BlobStoreRead>(m_bstore, m_bucket, dataPath(path));
|
||||
|
||||
#if ENCRYPTION_ENABLED
|
||||
if (usesEncryption()) {
|
||||
f = makeReference<AsyncFileEncrypted>(f, AsyncFileEncrypted::Mode::READ_ONLY);
|
||||
}
|
||||
#endif
|
||||
f = makeReference<AsyncFileReadAheadCache>(f,
|
||||
m_bstore->knobs.read_block_size,
|
||||
m_bstore->knobs.read_ahead_blocks,
|
||||
@ -194,11 +190,9 @@ Future<std::vector<std::string>> BackupContainerS3BlobStore::listURLs(Reference<
|
||||
|
||||
Future<Reference<IBackupFile>> BackupContainerS3BlobStore::writeFile(const std::string& path) {
|
||||
Reference<IAsyncFile> f = makeReference<AsyncFileS3BlobStoreWrite>(m_bstore, m_bucket, dataPath(path));
|
||||
#if ENCRYPTION_ENABLED
|
||||
if (usesEncryption()) {
|
||||
f = makeReference<AsyncFileEncrypted>(f, AsyncFileEncrypted::Mode::APPEND_ONLY);
|
||||
}
|
||||
#endif
|
||||
return Future<Reference<IBackupFile>>(makeReference<BackupContainerS3BlobStoreImpl::BackupFile>(path, f));
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
||||
* compile-time configuration.
|
||||
*/
|
||||
|
||||
#if !defined(HAVE_OPENSSL) || defined(TLS_DISABLED)
|
||||
#if !defined(HAVE_OPENSSL)
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
* See md5.c for more information.
|
||||
*/
|
||||
|
||||
#if defined(HAVE_OPENSSL) && !defined(TLS_DISABLED)
|
||||
#if defined(HAVE_OPENSSL)
|
||||
#if defined(HAVE_WOLFSSL)
|
||||
#include <wolfssl/options.h>
|
||||
#endif
|
||||
|
@ -26,8 +26,6 @@
|
||||
#include "flow/IRandom.h"
|
||||
#include "flow/StreamCipher.h"
|
||||
|
||||
#if ENCRYPTION_ENABLED
|
||||
|
||||
#include <array>
|
||||
|
||||
/*
|
||||
@ -81,5 +79,3 @@ public:
|
||||
void releaseZeroCopy(void* data, int length, int64_t offset) override;
|
||||
int64_t debugFD() const override;
|
||||
};
|
||||
|
||||
#endif // ENCRYPTION_ENABLED
|
||||
|
@ -7,6 +7,7 @@ set(FDBRPC_SRCS
|
||||
AsyncFileReadAhead.actor.h
|
||||
AsyncFileWinASIO.actor.h
|
||||
AsyncFileCached.actor.cpp
|
||||
AsyncFileEncrypted.actor.cpp
|
||||
AsyncFileNonDurable.actor.cpp
|
||||
AsyncFileWriteChecker.cpp
|
||||
FailureMonitor.actor.cpp
|
||||
@ -45,12 +46,6 @@ set(FDBRPC_SRCS
|
||||
TraceFileIO.cpp
|
||||
TSSComparison.h)
|
||||
|
||||
if(WITH_TLS)
|
||||
set(FDBRPC_SRCS
|
||||
${FDBRPC_SRCS}
|
||||
AsyncFileEncrypted.actor.cpp)
|
||||
endif()
|
||||
|
||||
set(COMPILE_EIO OFF)
|
||||
|
||||
if(NOT WIN32)
|
||||
|
@ -79,14 +79,12 @@ Future<Reference<class IAsyncFile>> Net2FileSystem::open(const std::string& file
|
||||
f = map(f, [=](Reference<IAsyncFile> r) { return Reference<IAsyncFile>(new AsyncFileWriteChecker(r)); });
|
||||
if (FLOW_KNOBS->ENABLE_CHAOS_FEATURES)
|
||||
f = map(f, [=](Reference<IAsyncFile> r) { return Reference<IAsyncFile>(new AsyncFileChaos(r)); });
|
||||
#if ENCRYPTION_ENABLED
|
||||
if (flags & IAsyncFile::OPEN_ENCRYPTED)
|
||||
f = map(f, [flags](Reference<IAsyncFile> r) {
|
||||
auto mode = flags & IAsyncFile::OPEN_READWRITE ? AsyncFileEncrypted::Mode::APPEND_ONLY
|
||||
: AsyncFileEncrypted::Mode::READ_ONLY;
|
||||
return Reference<IAsyncFile>(new AsyncFileEncrypted(r, mode));
|
||||
});
|
||||
#endif // ENCRYPTION_ENABLED
|
||||
return f;
|
||||
}
|
||||
|
||||
|
@ -2594,14 +2594,12 @@ Future<Reference<class IAsyncFile>> Sim2FileSystem::open(const std::string& file
|
||||
f = map(f, [=](Reference<IAsyncFile> r) { return Reference<IAsyncFile>(new AsyncFileWriteChecker(r)); });
|
||||
if (FLOW_KNOBS->ENABLE_CHAOS_FEATURES)
|
||||
f = map(f, [=](Reference<IAsyncFile> r) { return Reference<IAsyncFile>(new AsyncFileChaos(r)); });
|
||||
#if ENCRYPTION_ENABLED
|
||||
if (flags & IAsyncFile::OPEN_ENCRYPTED)
|
||||
f = map(f, [flags](Reference<IAsyncFile> r) {
|
||||
auto mode = flags & IAsyncFile::OPEN_READWRITE ? AsyncFileEncrypted::Mode::APPEND_ONLY
|
||||
: AsyncFileEncrypted::Mode::READ_ONLY;
|
||||
return Reference<IAsyncFile>(new AsyncFileEncrypted(r, mode));
|
||||
});
|
||||
#endif // ENCRYPTION_ENABLED
|
||||
return f;
|
||||
} else
|
||||
return AsyncFileCached::open(filename, flags, mode);
|
||||
|
@ -204,11 +204,7 @@ CSimpleOpt::SOption g_rgOptions[] = {
|
||||
{ OPT_FLOW_PROCESS_NAME, "--process-name", SO_REQ_SEP },
|
||||
{ OPT_FLOW_PROCESS_ENDPOINT, "--process-endpoint", SO_REQ_SEP },
|
||||
{ OPT_IP_TRUSTED_MASK, "--trusted-subnet-", SO_REQ_SEP },
|
||||
|
||||
#ifndef TLS_DISABLED
|
||||
TLS_OPTION_FLAGS
|
||||
#endif
|
||||
|
||||
TLS_OPTION_FLAGS,
|
||||
SO_END_OF_OPTIONS
|
||||
};
|
||||
|
||||
@ -662,9 +658,7 @@ static void printUsage(const char* name, bool devhelp) {
|
||||
" collector -- None or FluentD (FluentD requires collector_endpoint to be set)\n"
|
||||
" collector_endpoint -- IP:PORT of the fluentd server\n"
|
||||
" collector_protocol -- UDP or TCP (default is UDP)");
|
||||
#ifndef TLS_DISABLED
|
||||
printf("%s", TLS_HELP);
|
||||
#endif
|
||||
printOptionUsage("-v, --version", "Print version information and exit.");
|
||||
printOptionUsage("-h, -?, --help", "Display this help and exit.");
|
||||
if (devhelp) {
|
||||
@ -1621,7 +1615,6 @@ private:
|
||||
printSimTime = true;
|
||||
break;
|
||||
|
||||
#ifndef TLS_DISABLED
|
||||
case TLSConfig::OPT_TLS_PLUGIN:
|
||||
args.OptionArg();
|
||||
break;
|
||||
@ -1640,7 +1633,6 @@ private:
|
||||
case TLSConfig::OPT_TLS_VERIFY_PEERS:
|
||||
tlsConfig.addVerifyPeers(args.OptionArg());
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,8 +34,6 @@
|
||||
|
||||
#include "flow/actorcompiler.h" // This must be the last #include.
|
||||
|
||||
#if ENCRYPTION_ENABLED
|
||||
|
||||
#define MEGA_BYTES (1024 * 1024)
|
||||
#define NANO_SECOND (1000 * 1000 * 1000)
|
||||
|
||||
@ -379,5 +377,3 @@ struct EncryptionOpsWorkload : TestWorkload {
|
||||
};
|
||||
|
||||
WorkloadFactory<EncryptionOpsWorkload> EncryptionOpsWorkloadFactory("EncryptionOps");
|
||||
|
||||
#endif // ENCRYPTION_ENABLED
|
||||
|
@ -28,10 +28,8 @@ void forceLinkFlowTests();
|
||||
void forceLinkVersionedMapTests();
|
||||
void forceLinkMemcpyTests();
|
||||
void forceLinkMemcpyPerfTests();
|
||||
#if (!defined(TLS_DISABLED) && !defined(_WIN32))
|
||||
void forceLinkStreamCipherTests();
|
||||
void forceLinkBlobCipherTests();
|
||||
#endif
|
||||
void forceLinkParallelStreamTests();
|
||||
void forceLinkSimExternalConnectionTests();
|
||||
void forceLinkMutationLogReaderTests();
|
||||
@ -79,10 +77,8 @@ struct UnitTestWorkload : TestWorkload {
|
||||
forceLinkVersionedMapTests();
|
||||
forceLinkMemcpyTests();
|
||||
forceLinkMemcpyPerfTests();
|
||||
#if (!defined(TLS_DISABLED) && !defined(_WIN32))
|
||||
forceLinkStreamCipherTests();
|
||||
void forceLinkBlobCipherTests();
|
||||
#endif
|
||||
forceLinkParallelStreamTests();
|
||||
forceLinkSimExternalConnectionTests();
|
||||
forceLinkMutationLogReaderTests();
|
||||
|
@ -35,8 +35,6 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#if ENCRYPTION_ENABLED
|
||||
|
||||
namespace {
|
||||
bool isEncryptHeaderAuthTokenModeValid(const EncryptAuthTokenMode mode) {
|
||||
return mode >= ENCRYPT_HEADER_AUTH_TOKEN_MODE_NONE && mode < ENCRYPT_HEADER_AUTH_TOKEN_LAST;
|
||||
@ -1186,5 +1184,3 @@ TEST_CASE("flow/BlobCipher") {
|
||||
TraceEvent("BlobCipherTest_Done").log();
|
||||
return Void();
|
||||
}
|
||||
|
||||
#endif // ENCRYPTION_ENABLED
|
||||
|
@ -25,14 +25,6 @@
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#if (!defined(TLS_DISABLED))
|
||||
#define ENCRYPTION_ENABLED 1
|
||||
#else
|
||||
#define ENCRYPTION_ENABLED 0
|
||||
#endif
|
||||
|
||||
#if ENCRYPTION_ENABLED
|
||||
|
||||
#include "flow/Arena.h"
|
||||
#include "flow/EncryptUtils.h"
|
||||
#include "flow/FastRef.h"
|
||||
@ -468,5 +460,3 @@ StringRef computeAuthToken(const uint8_t* payload,
|
||||
const uint8_t* key,
|
||||
const int keyLen,
|
||||
Arena& arena);
|
||||
|
||||
#endif // ENCRYPTION_ENABLED
|
||||
|
@ -58,6 +58,7 @@ set(FLOW_SRCS
|
||||
SignalSafeUnwind.cpp
|
||||
SignalSafeUnwind.h
|
||||
SimpleOpt.h
|
||||
StreamCipher.cpp
|
||||
StreamCipher.h
|
||||
SystemMonitor.cpp
|
||||
SystemMonitor.h
|
||||
@ -108,12 +109,6 @@ set(FLOW_SRCS
|
||||
xxhash.c
|
||||
xxhash.h)
|
||||
|
||||
if(WITH_TLS)
|
||||
set(FLOW_SRCS
|
||||
${FLOW_SRCS}
|
||||
StreamCipher.cpp)
|
||||
endif()
|
||||
|
||||
add_library(stacktrace stacktrace.amalgamation.cpp stacktrace.h)
|
||||
if (USE_ASAN)
|
||||
target_compile_definitions(stacktrace PRIVATE ADDRESS_SANITIZER)
|
||||
@ -170,16 +165,11 @@ if(USE_VALGRIND)
|
||||
target_link_libraries(flow PUBLIC Valgrind)
|
||||
target_link_libraries(flow_sampling PUBLIC Valgrind)
|
||||
endif()
|
||||
if(NOT WITH_TLS)
|
||||
target_compile_definitions(flow PUBLIC TLS_DISABLED)
|
||||
target_compile_definitions(flow_sampling PUBLIC TLS_DISABLED)
|
||||
else()
|
||||
target_link_libraries(flow PUBLIC OpenSSL::SSL)
|
||||
target_link_libraries(flow_sampling PUBLIC OpenSSL::SSL)
|
||||
if(USE_WOLFSSL)
|
||||
target_include_directories(flow SYSTEM BEFORE PUBLIC ${WOLFSSL_INCLUDE_DIR}/wolfssl)
|
||||
target_include_directories(flow_sampling SYSTEM BEFORE PUBLIC ${WOLFSSL_INCLUDE_DIR}/wolfssl)
|
||||
endif()
|
||||
target_link_libraries(flow PUBLIC OpenSSL::SSL)
|
||||
target_link_libraries(flow_sampling PUBLIC OpenSSL::SSL)
|
||||
if(USE_WOLFSSL)
|
||||
target_include_directories(flow SYSTEM BEFORE PUBLIC ${WOLFSSL_INCLUDE_DIR}/wolfssl)
|
||||
target_include_directories(flow_sampling SYSTEM BEFORE PUBLIC ${WOLFSSL_INCLUDE_DIR}/wolfssl)
|
||||
endif()
|
||||
target_link_libraries(flow PUBLIC Threads::Threads ${CMAKE_DL_LIBS})
|
||||
target_link_libraries(flow_sampling PUBLIC Threads::Threads ${CMAKE_DL_LIBS})
|
||||
|
@ -30,12 +30,10 @@
|
||||
#define BOOST_DATE_TIME_NO_LIB
|
||||
#define BOOST_REGEX_NO_LIB
|
||||
#include <boost/asio.hpp>
|
||||
#ifndef TLS_DISABLED
|
||||
#if defined(HAVE_WOLFSSL)
|
||||
#include <wolfssl/options.h>
|
||||
#endif
|
||||
#include "boost/asio/ssl.hpp"
|
||||
#endif
|
||||
#include <boost/date_time/posix_time/posix_time_types.hpp>
|
||||
#include <boost/range.hpp>
|
||||
#include <boost/algorithm/string/join.hpp>
|
||||
@ -239,12 +237,10 @@ public:
|
||||
// private:
|
||||
|
||||
ASIOReactor reactor;
|
||||
#ifndef TLS_DISABLED
|
||||
AsyncVar<Reference<ReferencedObject<boost::asio::ssl::context>>> sslContextVar;
|
||||
Reference<IThreadPool> sslHandshakerPool;
|
||||
int sslHandshakerThreadsStarted;
|
||||
int sslPoolHandshakesInProgress;
|
||||
#endif
|
||||
TLSConfig tlsConfig;
|
||||
Future<Void> backgroundCertRefresh;
|
||||
ETLSInitState tlsInitializedState;
|
||||
@ -379,14 +375,12 @@ public:
|
||||
{
|
||||
TraceEvent evt(SevWarn, errContext, errID);
|
||||
evt.suppressFor(1.0).detail("ErrorCode", error.value()).detail("Message", error.message());
|
||||
#ifndef TLS_DISABLED
|
||||
// There is no function in OpenSSL to use to check if an error code is from OpenSSL,
|
||||
// but all OpenSSL errors have a non-zero "library" code set in bits 24-32, and linux
|
||||
// error codes should never go that high.
|
||||
if (error.value() >= (1 << 24L)) {
|
||||
evt.detail("WhichMeans", TLSPolicy::ErrorString(error));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
p.sendError(connection_failed());
|
||||
@ -793,7 +787,6 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
#ifndef TLS_DISABLED
|
||||
typedef boost::asio::ssl::stream<boost::asio::ip::tcp::socket&> ssl_socket;
|
||||
|
||||
struct SSLHandshakerThread final : IThreadPoolReceiver {
|
||||
@ -1197,7 +1190,6 @@ private:
|
||||
}
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
struct PromiseTask final : public Task, public FastAllocated<PromiseTask> {
|
||||
Promise<Void> promise;
|
||||
@ -1214,12 +1206,10 @@ struct PromiseTask final : public Task, public FastAllocated<PromiseTask> {
|
||||
|
||||
Net2::Net2(const TLSConfig& tlsConfig, bool useThreadPool, bool useMetrics)
|
||||
: globals(enumGlobal::COUNT), useThreadPool(useThreadPool), reactor(this),
|
||||
#ifndef TLS_DISABLED
|
||||
sslContextVar({ ReferencedObject<boost::asio::ssl::context>::from(
|
||||
boost::asio::ssl::context(boost::asio::ssl::context::tls)) }),
|
||||
sslHandshakerThreadsStarted(0), sslPoolHandshakesInProgress(0),
|
||||
#endif
|
||||
tlsConfig(tlsConfig), tlsInitializedState(ETLSInitState::NONE), network(this), tscBegin(0), tscEnd(0), taskBegin(0),
|
||||
sslHandshakerThreadsStarted(0), sslPoolHandshakesInProgress(0), tlsConfig(tlsConfig),
|
||||
tlsInitializedState(ETLSInitState::NONE), network(this), tscBegin(0), tscEnd(0), taskBegin(0),
|
||||
currentTaskID(TaskPriority::DefaultYield), tasksIssued(0), stopped(false), started(false), numYields(0),
|
||||
lastPriorityStats(nullptr), ready(FLOW_KNOBS->READY_QUEUE_RESERVED_SIZE) {
|
||||
// Until run() is called, yield() will always yield
|
||||
@ -1243,7 +1233,6 @@ Net2::Net2(const TLSConfig& tlsConfig, bool useThreadPool, bool useMetrics)
|
||||
updateNow();
|
||||
}
|
||||
|
||||
#ifndef TLS_DISABLED
|
||||
ACTOR static Future<Void> watchFileForChanges(std::string filename, AsyncTrigger* fileChanged) {
|
||||
if (filename == "") {
|
||||
return Never();
|
||||
@ -1320,13 +1309,11 @@ ACTOR static Future<Void> reloadCertificatesOnChange(
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void Net2::initTLS(ETLSInitState targetState) {
|
||||
if (tlsInitializedState >= targetState) {
|
||||
return;
|
||||
}
|
||||
#ifndef TLS_DISABLED
|
||||
// Any target state must be higher than NONE so if the current state is NONE
|
||||
// then initialize the TLS config
|
||||
if (tlsInitializedState == ETLSInitState::NONE) {
|
||||
@ -1380,7 +1367,6 @@ void Net2::initTLS(ETLSInitState targetState) {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
tlsInitializedState = targetState;
|
||||
}
|
||||
@ -1834,12 +1820,10 @@ THREAD_HANDLE Net2::startThread(THREAD_FUNC_RETURN (*func)(void*), void* arg, in
|
||||
}
|
||||
|
||||
Future<Reference<IConnection>> Net2::connect(NetworkAddress toAddr, const std::string& host) {
|
||||
#ifndef TLS_DISABLED
|
||||
if (toAddr.isTLS()) {
|
||||
initTLS(ETLSInitState::CONNECT);
|
||||
return SSLConnection::connect(&this->reactor.ios, this->sslContextVar.get(), toAddr);
|
||||
}
|
||||
#endif
|
||||
|
||||
return Connection::connect(&this->reactor.ios, toAddr);
|
||||
}
|
||||
@ -1979,12 +1963,10 @@ bool Net2::isAddressOnThisHost(NetworkAddress const& addr) const {
|
||||
|
||||
Reference<IListener> Net2::listen(NetworkAddress localAddr) {
|
||||
try {
|
||||
#ifndef TLS_DISABLED
|
||||
if (localAddr.isTLS()) {
|
||||
initTLS(ETLSInitState::LISTEN);
|
||||
return Reference<IListener>(new SSLListener(reactor.ios, &this->sslContextVar, localAddr));
|
||||
}
|
||||
#endif
|
||||
return Reference<IListener>(new Listener(reactor.ios, localAddr));
|
||||
} catch (boost::system::system_error const& e) {
|
||||
Error x;
|
||||
|
@ -31,10 +31,8 @@
|
||||
#include "flow/Platform.actor.h"
|
||||
#include "flow/Arena.h"
|
||||
|
||||
#if (!defined(TLS_DISABLED) && !defined(_WIN32))
|
||||
#include "flow/StreamCipher.h"
|
||||
#include "flow/BlobCipher.h"
|
||||
#endif
|
||||
#include "flow/Trace.h"
|
||||
#include "flow/Error.h"
|
||||
|
||||
@ -3552,11 +3550,9 @@ void crashHandler(int sig) {
|
||||
|
||||
bool error = (sig != SIGUSR2);
|
||||
|
||||
#if (!defined(TLS_DISABLED) && !defined(_WIN32))
|
||||
StreamCipherKey::cleanup();
|
||||
StreamCipher::cleanup();
|
||||
BlobCipherKeyCache::cleanup();
|
||||
#endif
|
||||
|
||||
fflush(stdout);
|
||||
{
|
||||
|
@ -20,14 +20,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#if (!defined(TLS_DISABLED))
|
||||
#define ENCRYPTION_ENABLED 1
|
||||
#else
|
||||
#define ENCRYPTION_ENABLED 0
|
||||
#endif
|
||||
|
||||
#if ENCRYPTION_ENABLED
|
||||
|
||||
#include "flow/Arena.h"
|
||||
#include "flow/FastRef.h"
|
||||
#include "flow/flow.h"
|
||||
@ -117,5 +109,3 @@ public:
|
||||
};
|
||||
|
||||
void applyHmacKeyDerivationFunc(StreamCipherKey* cipherKey, HmacSha256StreamCipher* hmacGenerator, Arena& arena);
|
||||
|
||||
#endif // ENCRYPTION_ENABLED
|
||||
|
@ -25,14 +25,6 @@
|
||||
// To force typeinfo to only be emitted once.
|
||||
TLSPolicy::~TLSPolicy() {}
|
||||
|
||||
#ifdef TLS_DISABLED
|
||||
|
||||
void LoadedTLSConfig::print(FILE* fp) {
|
||||
fprintf(fp, "Cannot print LoadedTLSConfig. TLS support is not enabled.\n");
|
||||
}
|
||||
|
||||
#else // TLS is enabled
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
#include <exception>
|
||||
@ -837,4 +829,3 @@ bool TLSPolicy::verify_peer(bool preverified, X509_STORE_CTX* store_ctx) {
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
#endif
|
||||
|
@ -37,8 +37,6 @@
|
||||
#include "flow/Knobs.h"
|
||||
#include "flow/flow.h"
|
||||
|
||||
#ifndef TLS_DISABLED
|
||||
|
||||
#if defined(HAVE_WOLFSSL)
|
||||
#include <wolfssl/options.h>
|
||||
#endif
|
||||
@ -72,7 +70,6 @@ struct Criteria {
|
||||
return criteria == c.criteria && match_type == c.match_type && location == c.location;
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
#include "flow/actorcompiler.h" // This must be the last #include.
|
||||
|
||||
@ -204,7 +201,6 @@ private:
|
||||
TLSEndpointType endpointType = TLSEndpointType::UNSET;
|
||||
};
|
||||
|
||||
#ifndef TLS_DISABLED
|
||||
namespace boost {
|
||||
namespace asio {
|
||||
namespace ssl {
|
||||
@ -216,7 +212,6 @@ void ConfigureSSLContext(
|
||||
const LoadedTLSConfig& loaded,
|
||||
boost::asio::ssl::context* context,
|
||||
std::function<void()> onPolicyFailure = []() {});
|
||||
#endif
|
||||
|
||||
class TLSPolicy : ReferenceCounted<TLSPolicy> {
|
||||
public:
|
||||
@ -226,7 +221,6 @@ public:
|
||||
virtual void addref() { ReferenceCounted<TLSPolicy>::addref(); }
|
||||
virtual void delref() { ReferenceCounted<TLSPolicy>::delref(); }
|
||||
|
||||
#ifndef TLS_DISABLED
|
||||
static std::string ErrorString(boost::system::error_code e);
|
||||
|
||||
void set_verify_peers(std::vector<std::string> verify_peers);
|
||||
@ -248,7 +242,6 @@ public:
|
||||
};
|
||||
|
||||
std::vector<Rule> rules;
|
||||
#endif
|
||||
bool is_client;
|
||||
};
|
||||
|
||||
@ -264,8 +257,9 @@ public:
|
||||
{ TLSConfig::OPT_TLS_CERTIFICATES, TLS_CERTIFICATE_FILE_FLAG, SO_REQ_SEP }, \
|
||||
{ TLSConfig::OPT_TLS_KEY, TLS_KEY_FILE_FLAG, SO_REQ_SEP }, \
|
||||
{ TLSConfig::OPT_TLS_VERIFY_PEERS, TLS_VERIFY_PEERS_FLAG, SO_REQ_SEP }, \
|
||||
{ TLSConfig::OPT_TLS_PASSWORD, TLS_PASSWORD_FLAG, SO_REQ_SEP }, \
|
||||
{ TLSConfig::OPT_TLS_CA_FILE, TLS_CA_FILE_FLAG, SO_REQ_SEP },
|
||||
{ TLSConfig::OPT_TLS_PASSWORD, TLS_PASSWORD_FLAG, SO_REQ_SEP }, { \
|
||||
TLSConfig::OPT_TLS_CA_FILE, TLS_CA_FILE_FLAG, SO_REQ_SEP \
|
||||
}
|
||||
|
||||
#define TLS_HELP \
|
||||
" " TLS_CERTIFICATE_FILE_FLAG " CERTFILE\n" \
|
||||
|
@ -1,6 +1,7 @@
|
||||
set(FLOWBENCH_SRCS
|
||||
flowbench.actor.cpp
|
||||
BenchCallback.actor.cpp
|
||||
BenchEncrypt.cpp
|
||||
BenchHash.cpp
|
||||
BenchIterate.cpp
|
||||
BenchIONet2.actor.cpp
|
||||
@ -16,12 +17,6 @@ set(FLOWBENCH_SRCS
|
||||
GlobalData.h
|
||||
GlobalData.cpp)
|
||||
|
||||
if(WITH_TLS AND NOT WIN32)
|
||||
set(FLOWBENCH_SRCS
|
||||
${FLOWBENCH_SRCS}
|
||||
BenchEncrypt.cpp)
|
||||
endif()
|
||||
|
||||
project (flowbench)
|
||||
# include the configurations from benchmark.cmake
|
||||
configure_file(benchmark.cmake googlebenchmark-download/CMakeLists.txt)
|
||||
|
Loading…
x
Reference in New Issue
Block a user