diff --git a/README.md b/README.md index b92238a..9c48f64 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,6 @@ and two required arguments: ``` handshake [-t] [-s] [-f] -t - produce terse output --f - freeze default context (available only with openssl >= 4.x.x) -s - create an ssl_ctx per connection, rather than a single thread-shared ctx -p - use ossl_lib_ctx per thread -P - use ossl_lib_ctx pool (can be combined with -s. If sharing is enabled, ssl_ctx @@ -229,7 +228,6 @@ Three modes of operation: Usage: evp_hash [-h] [-t] [-f] [-o operation] [-u update-times] [-a algorithm] thread-count -h - print this help output -t - terse output --f - freeze default context (available only with openssl >= 4.x.x) -o operation - mode of operation. One of [deprecated, evp_isolated, evp_shared] (default: evp_shared) -u update-times - times to update digest. 1 for one-shot (default: 1) -a algorithm - One of: [SHA1, SHA224, SHA256, SHA384, SHA512] (default: SHA1) @@ -254,7 +252,6 @@ Usage: evp_fetch [-t] [-f TYPE:ALGORITHM] [-V] [-q] [-F] threadcount -t - terse output -f - fetch only the specified algorithm -q - include post-quantum algorithms (available with OpenSSL >= 3.5 and PQ enabled) --F - freeze context (available only with openssl >= 4.x.x) -V - print version information and exit threadcount - number of threads ``` @@ -283,7 +280,6 @@ Two modes of operation: Usage: evp_cipher [-h] [-t] [-f] [-o operation] [-u update-times] [-a algorithm] thread-count -h - print this help output -t - terse output --f - freeze default context (available only with openssl >= 4.x.x) -o operation - mode of operation. One of [evp_isolated, evp_shared] (default: evp_shared) -u update-times - times to update (default: 1) -a algorithm - One of: [AES-128-CBC, AES-256-CBC] (default: AES-128-CBC) @@ -333,7 +329,6 @@ Four modes of operation: Usage: evp_kdf [-h] [-t] [-f] [-o operation] [-V] thread-count -h - print this help output -t - terse output --f - freeze default context (available only with openssl >= 4.x.x) -o operation - mode of operation. One of [evp_isolated, evp_shared, deprecated_isolated, deprecated_shared] (default: evp_shared) -V - print version information and exit thread-count - number of threads @@ -356,7 +351,6 @@ Two modes of operation: Usage: evp_rand [-h] [-t] [-f] [-o operation] [-V] thread-count -h - print this help output -t - terse output --f - freeze default context -o operation - mode of operation. One of [evp_isolated, evp_shared] (default: evp_shared) -V - print version information and exit thread-count - number of threads diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index f0e6743..1c48f90 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -208,7 +208,6 @@ else() set(CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCLUDE_DIR}") endif() -check_symbol_exists(OSSL_LIB_CTX_freeze "openssl/crypto.h" HAVE_OSSL_LIB_CTX_FREEZE) check_symbol_exists(SSL_set1_dnsname "openssl/ssl.h" HAVE_SSL_SET1_DNSNAME) set(run_tests CACHE STRING "List of tests to run") @@ -223,12 +222,6 @@ if( OPENSSL_VERSION VERSION_GREATER_EQUAL 3 ) evp_fetch "" "" "-q" CACHE STRING "Post-quantum option for evp_fetch") list(APPEND run_opts run_evp_fetch_pqs) - if(HAVE_OSSL_LIB_CTX_FREEZE) - set(run_evp_fetch_freeze - evp_fetch "" "" "-F" - CACHE STRING "Freeze LIB_CTX for evp_fetch") - list(APPEND run_opts run_evp_fetch_freeze) - endif() add_executable(providerdoall providerdoall.c) target_link_libraries(providerdoall PRIVATE perf) @@ -245,12 +238,6 @@ if( OPENSSL_VERSION VERSION_GREATER_EQUAL 3 ) evp_cipher "" "" "-a AES-128-CBC" "-a AES-256-CBC" CACHE STRING "Encryption algorithms for evp_cipher") list(APPEND run_opts run_evp_cipher_algorithms) - if(HAVE_OSSL_LIB_CTX_FREEZE) - set(run_evp_cipher_freeze - evp_cipher "" "" "-f" - CACHE STRING "Freeze LIB_CTX for evp_cipher") - list(APPEND run_opts run_evp_cipher_freeze) - endif() add_executable(evp_mac evp_mac.c) target_link_libraries(evp_mac PRIVATE perf) @@ -267,12 +254,6 @@ if( OPENSSL_VERSION VERSION_GREATER_EQUAL 3 ) evp_kdf "" "" "-o evp_shared" "-o evp_isolated" "-o deprecated_shared" "-o deprecated_isolated" CACHE STRING "Modes of operation for evp_kdf") list(APPEND run_opts run_evp_kdf_operations) - if(HAVE_OSSL_LIB_CTX_FREEZE) - set(run_evp_kdf_freeze - evp_kdf "" "" "-f" - CACHE STRING "Freeze LIB_CTX for evp_kdf") - list(APPEND run_opts run_evp_kdf_freeze) - endif() add_executable(evp_rand evp_rand.c) target_link_libraries(evp_rand PRIVATE perf) @@ -281,12 +262,6 @@ if( OPENSSL_VERSION VERSION_GREATER_EQUAL 3 ) evp_rand "" "" "-o evp_isolated" "-o evp_shared" CACHE STRING "Modes of operation for evp_rand") list(APPEND run_opts run_evp_rand_operations) - if(HAVE_OSSL_LIB_CTX_FREEZE) - set(run_evp_rand_freeze - evp_rand "" "" "-f" - CACHE STRING "Freeze LIB_CTX for evp_rand") - list(APPEND run_opts run_evp_rand_freeze) - endif() add_executable(evp_pkey evp_pkey.c) target_link_libraries(evp_pkey PRIVATE perf) @@ -435,12 +410,6 @@ if( NOT WITH_OPENSSL_FORK ) evp_hash "" "" "-a SHA1" "-a SHA224" "-a SHA256" "-a SHA384" "-a SHA512" CACHE STRING "Digest hash algorithms for evp_hash") list(APPEND run_opts run_evp_hash_algorithms) - if(HAVE_OSSL_LIB_CTX_FREEZE) - set(run_evp_hash_freeze - evp_hash "" "" "-f" - CACHE STRING "Freeze LIB_CTX for evp_hash") - list(APPEND run_opts run_evp_hash_freeze) - endif() endif() set(run_add_version_dep ON diff --git a/source/config.h.in b/source/config.h.in index 90e79ad..041093b 100644 --- a/source/config.h.in +++ b/source/config.h.in @@ -1,7 +1,4 @@ /* config.h.in */ -/* Define to 1 if you have the `OSSL_LIB_CTX_freeze' function. */ -#cmakedefine HAVE_OSSL_LIB_CTX_FREEZE - /* Define to 1 if you have the `SSL_set1_dnsname' function. */ #cmakedefine HAVE_SSL_SET1_DNSNAME diff --git a/source/evp_cipher.c b/source/evp_cipher.c index 864de37..741917d 100644 --- a/source/evp_cipher.c +++ b/source/evp_cipher.c @@ -14,7 +14,6 @@ #define OPENSSL_SUPPRESS_DEPRECATED -#include "config.h" #include #include #ifndef _WIN32 @@ -122,16 +121,9 @@ static void do_cipher_shared(size_t num) static void print_help(FILE *file) { -#ifdef HAVE_OSSL_LIB_CTX_FREEZE - fprintf(file, "Usage: evp_cipher [-h] [-f] [-t] [-o operation] [-u update-times] [-a algorithm] [-V] thread-count\n"); -#else fprintf(file, "Usage: evp_cipher [-h] [-t] [-o operation] [-u update-times] [-a algorithm] [-V] thread-count\n"); -#endif fprintf(file, "-h - print this help output\n"); fprintf(file, "-t - terse output\n"); -#ifdef HAVE_OSSL_LIB_CTX_FREEZE - fprintf(file, "-f - freeze default context\n"); -#endif fprintf(file, "-o operation - mode of operation. One of [evp_isolated, evp_shared] (default: evp_shared)\n"); fprintf(file, "-u update-times - times to update (default: 1)\n"); fprintf(file, "-a algorithm - One of: [AES-128-CBC, AES-256-CBC] (default: AES-128-CBC)\n"); @@ -148,18 +140,9 @@ int main(int argc, char *argv[]) int j, opt, rc = EXIT_FAILURE; int key_len, iv_len; char *getopt_options = "Vhto:u:a:"; -#ifdef HAVE_OSSL_LIB_CTX_FREEZE - int freeze = 0; - getopt_options = "Vhto:u:a:f"; -#endif while ((opt = getopt(argc, argv, getopt_options)) != -1) { switch (opt) { -#ifdef HAVE_OSSL_LIB_CTX_FREEZE - case 'f': - freeze = 1; - break; -#endif case 't': terse = 1; break; @@ -246,15 +229,6 @@ int main(int argc, char *argv[]) max_time = ossl_time_add(ossl_time_now(), ossl_seconds2time(RUN_TIME)); -#ifdef HAVE_OSSL_LIB_CTX_FREEZE - if (freeze) { - if (OSSL_LIB_CTX_freeze(NULL, NULL) == 0) { - fprintf(stderr, "Freezing LIB CTX failed\n"); - goto err; - } - } -#endif - switch (operation) { case EVP_ISOLATED: err = !perflib_run_multi_thread_test(do_cipher_isolated, threadcount, &duration) || err; diff --git a/source/evp_fetch.c b/source/evp_fetch.c index 851e2a8..3ec6408 100644 --- a/source/evp_fetch.c +++ b/source/evp_fetch.c @@ -7,7 +7,6 @@ * https://www.openssl.org/source/license.html */ -#include "config.h" #include #include #include @@ -39,16 +38,6 @@ # define PQ_USAGE_DESC "" #endif -#ifdef HAVE_OSSL_LIB_CTX_FREEZE -#define FREEZE_GETOPT "F" -#define FREEZE_USAGE_OPT " [-F]" -#define FREEZE_USAGE_DESC "-F - freeze context\n" -#else -#define FREEZE_GETOPT "" -#define FREEZE_USAGE_OPT "" -#define FREEZE_USAGE_DESC "" -#endif - #define RUN_TIME 5 /* @@ -301,12 +290,11 @@ void do_fetch(size_t num) static void usage(const char *progname) { - printf("Usage: %s [-t] [-f TYPE:ALGORITHM]" PQ_USAGE_OPT " [-V]" FREEZE_USAGE_OPT + printf("Usage: %s [-t] [-f TYPE:ALGORITHM]" PQ_USAGE_OPT " [-V]" " threadcount\n" "-t - terse output\n" "-f - fetch only the specified algorithm\n" PQ_USAGE_DESC - FREEZE_USAGE_DESC "-V - print version information and exit\n" "\nEnvironment variables:\n" " EVP_FETCH_TYPE - if no -f option is provided, fetch only\n" @@ -333,17 +321,9 @@ int main(int argc, char *argv[]) int rc = EXIT_FAILURE; char *fetch_type = getenv("EVP_FETCH_TYPE"); int opt; -#ifdef HAVE_OSSL_LIB_CTX_FREEZE - int freeze = 0; -#endif - while ((opt = getopt(argc, argv, "tf:" PQ_GETOPT "V" FREEZE_GETOPT)) != -1) { + while ((opt = getopt(argc, argv, "tf:" PQ_GETOPT "V")) != -1) { switch (opt) { -#ifdef HAVE_OSSL_LIB_CTX_FREEZE - case 'F': - freeze = 1; - break; -#endif case 't': terse = 1; break; @@ -401,15 +381,6 @@ int main(int argc, char *argv[]) if (ctx == NULL) return EXIT_FAILURE; -#ifdef HAVE_OSSL_LIB_CTX_FREEZE - if (freeze) { - if (OSSL_LIB_CTX_freeze(ctx, NULL) == 0) { - fprintf(stderr, "Freezing LIB CTX failed\n"); - goto out; - } - } -#endif - counts = OPENSSL_malloc(sizeof(size_t) * threadcount); if (counts == NULL) { printf("Failed to create counts array\n"); diff --git a/source/evp_hash.c b/source/evp_hash.c index 7c07316..9b29bae 100644 --- a/source/evp_hash.c +++ b/source/evp_hash.c @@ -15,7 +15,6 @@ #define OPENSSL_SUPPRESS_DEPRECATED -#include "config.h" #include #include #ifndef _WIN32 @@ -251,16 +250,9 @@ static void do_hash_evp_shared(size_t num) static void print_help() { -#ifdef HAVE_OSSL_LIB_CTX_FREEZE - printf("Usage: evp_hash [-h] [-t] [-f] [-o operation] [-u update-times] [-a algorithm] [-V] thread-count\n"); -#else printf("Usage: evp_hash [-h] [-t] [-o operation] [-u update-times] [-a algorithm] [-V] thread-count\n"); -#endif printf("-h - print this help output\n"); printf("-t - terse output\n"); -#ifdef HAVE_OSSL_LIB_CTX_FREEZE - printf("-f - freeze default context\n"); -#endif printf("-o operation - mode of operation. One of [deprecated, evp_isolated, evp_shared] (default: evp_shared)\n"); printf("-u update-times - times to update digest. 1 for one-shot (default: 1)\n"); printf("-a algorithm - One of: [SHA1, SHA224, SHA256, SHA384, SHA512] (default: SHA1)\n"); @@ -276,18 +268,9 @@ int main(int argc, char *argv[]) int terse = 0, operation = EVP_SHARED, hash_algorithm = SHA1_ALG; int j, opt, rc = EXIT_FAILURE; char *getopt_options = "hto:u:a:V"; -#ifdef HAVE_OSSL_LIB_CTX_FREEZE - int freeze = 0; - getopt_options = "hto:u:a:Vf"; -#endif while ((opt = getopt(argc, argv, getopt_options)) != -1) { switch (opt) { -#ifdef HAVE_OSSL_LIB_CTX_FREEZE - case 'f': - freeze = 1; - break; -#endif case 't': terse = 1; break; @@ -365,15 +348,6 @@ int main(int argc, char *argv[]) max_time = ossl_time_add(ossl_time_now(), ossl_seconds2time(RUN_TIME)); -#ifdef HAVE_OSSL_LIB_CTX_FREEZE - if (freeze) { - if (OSSL_LIB_CTX_freeze(NULL, NULL) == 0) { - fprintf(stderr, "Freezing LIB CTX failed\n"); - goto out; - } - } -#endif - switch (operation) { case DEPRECATED: switch (hash_algorithm) { diff --git a/source/evp_kdf.c b/source/evp_kdf.c index 2ba4d64..9170872 100644 --- a/source/evp_kdf.c +++ b/source/evp_kdf.c @@ -14,7 +14,6 @@ #define OPENSSL_SUPPRESS_DEPRECATED -#include "config.h" #include #include #ifndef _WIN32 @@ -170,16 +169,9 @@ static void do_deprecated_shared(size_t num) static void print_help(FILE *file) { -#ifdef HAVE_OSSL_LIB_CTX_FREEZE - fprintf(file, "Usage: evp_kdf [-h] [-t] [-f] [-o operation] [-V] thread-count\n"); -#else fprintf(file, "Usage: evp_kdf [-h] [-t] [-o operation] [-V] thread-count\n"); -#endif fprintf(file, "-h - print this help output\n"); fprintf(file, "-t - terse output\n"); -#ifdef HAVE_OSSL_LIB_CTX_FREEZE - printf("-f - freeze default context\n"); -#endif fprintf(file, "-o operation - mode of operation. One of [evp_isolated, evp_shared, deprecated_isolated, deprecated_shared] (default: evp_shared)\n"); fprintf(file, "-V - print version information and exit\n"); fprintf(file, "thread-count - number of threads\n"); @@ -193,18 +185,9 @@ int main(int argc, char *argv[]) int terse = 0, operation = EVP_SHARED; int j, opt, rc = EXIT_FAILURE; char *getopt_options = "Vhto:"; -#ifdef HAVE_OSSL_LIB_CTX_FREEZE - int freeze = 0; - getopt_options = "Vhto:f"; -#endif while ((opt = getopt(argc, argv, getopt_options)) != -1) { switch (opt) { -#ifdef HAVE_OSSL_LIB_CTX_FREEZE - case 'f': - freeze = 1; - break; -#endif case 't': terse = 1; break; @@ -260,14 +243,6 @@ int main(int argc, char *argv[]) max_time = ossl_time_add(ossl_time_now(), ossl_seconds2time(RUN_TIME)); -#ifdef HAVE_OSSL_LIB_CTX_FREEZE - if (freeze) { - if (OSSL_LIB_CTX_freeze(NULL, NULL) == 0) { - fprintf(stderr, "Freezing LIB CTX failed\n"); - goto err; - } - } -#endif switch (operation) { case EVP_SHARED: run_err = !perflib_run_multi_thread_test(do_evp_shared, threadcount, &duration) || run_err; diff --git a/source/evp_rand.c b/source/evp_rand.c index 0252dd6..b15b6c5 100644 --- a/source/evp_rand.c +++ b/source/evp_rand.c @@ -14,7 +14,6 @@ #define OPENSSL_SUPPRESS_DEPRECATED -#include "config.h" #include #include #ifndef _WIN32 @@ -122,16 +121,9 @@ static void do_evp_shared(size_t num) static void print_help(FILE *file) { -#ifdef HAVE_OSSL_LIB_CTX_FREEZE - fprintf(file, "Usage: evp_rand [-h] [-t] [-f] [-o operation] [-V] thread-count\n"); -#else fprintf(file, "Usage: evp_rand [-h] [-t] [-o operation] [-V] thread-count\n"); -#endif fprintf(file, "-h - print this help output\n"); fprintf(file, "-t - terse output\n"); -#ifdef HAVE_OSSL_LIB_CTX_FREEZE - fprintf(file, "-f - freeze default context\n"); -#endif fprintf(file, "-o operation - mode of operation. One of [evp_isolated, evp_shared] (default: evp_shared)\n"); fprintf(file, "-V - print version information and exit\n"); fprintf(file, "thread-count - number of threads\n"); @@ -144,24 +136,13 @@ int main(int argc, char *argv[]) double av; int terse = 0, operation = EVP_SHARED; int j, opt, rc = EXIT_FAILURE; -#ifdef HAVE_OSSL_LIB_CTX_FREEZE - int freeze = 0; - char *getopt_options = "Vhtfo:"; -#else char *getopt_options = "Vhto:"; -#endif - while ((opt = getopt(argc, argv, getopt_options)) != -1) { switch (opt) { case 't': terse = 1; break; -#ifdef HAVE_OSSL_LIB_CTX_FREEZE - case 'f': - freeze = 1; - break; -#endif case 'o': if (strcmp(optarg, "evp_isolated") == 0) { operation = EVP_ISOLATED; @@ -204,15 +185,6 @@ int main(int argc, char *argv[]) goto err; } -#ifdef HAVE_OSSL_LIB_CTX_FREEZE - if (freeze) { - if (OSSL_LIB_CTX_freeze(NULL, NULL) == 0) { - fprintf(stderr, "Freezing LIB CTX failed\n"); - goto err; - } - } -#endif - max_time = ossl_time_add(ossl_time_now(), ossl_seconds2time(RUN_TIME)); switch (operation) { diff --git a/source/handshake.c b/source/handshake.c index c18e92e..06c1f7f 100644 --- a/source/handshake.c +++ b/source/handshake.c @@ -7,7 +7,6 @@ * https://www.openssl.org/source/license.html */ -#include "config.h" #include #include #include @@ -337,9 +336,6 @@ void usage(const char *progname) printf("-P - use ossl_lib_ctx pool\n"); printf("-l - use ssl ctx pool\n"); printf("-o - set ossl_lib_ctx pool size\n"); -#endif -#ifdef HAVE_OSSL_LIB_CTX_FREEZE - printf("-f - freeze default context\n"); #endif printf("-S [n] - use secure memory\n"); printf("-V - print version information and exit\n"); @@ -358,20 +354,12 @@ int main(int argc, char * const argv[]) int p_flag = 0, P_flag = 0, l_flag = 0; char *endptr = NULL; char *getopt_options = "tsS:V"; -#if OPENSSL_VERSION_NUMBER >= 0x30000000L && defined(HAVE_OSSL_LIB_CTX_FREEZE) - int freeze = 0; - getopt_options = "tspPo:lS:Vf"; -#else +#if OPENSSL_VERSION_NUMBER >= 0x30000000L getopt_options = "tspPo:lS:V"; #endif while ((opt = getopt(argc, argv, getopt_options)) != -1) { switch (opt) { -#ifdef HAVE_OSSL_LIB_CTX_FREEZE - case 'f': - freeze = 1; - break; -#endif case 't': terse = 1; break; @@ -484,15 +472,6 @@ int main(int argc, char * const argv[]) max_time = ossl_time_add(ossl_time_now(), ossl_seconds2time(RUN_TIME)); -#ifdef HAVE_OSSL_LIB_CTX_FREEZE - if (freeze) { - if (OSSL_LIB_CTX_freeze(NULL, NULL) == 0) { - fprintf(stderr, "Freezing LIB CTX failed\n"); - goto err; - } - } -#endif - switch (test_case) { case TC_SSL_CTX: { if (share_ctx == 1) {