Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ and two required arguments:
```
handshake [-t] [-s] [-f] <certsdir> <threadcount>
-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
Expand Down Expand Up @@ -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)
Expand All @@ -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
```
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
31 changes: 0 additions & 31 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions source/config.h.in
Original file line number Diff line number Diff line change
@@ -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
26 changes: 0 additions & 26 deletions source/evp_cipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#define OPENSSL_SUPPRESS_DEPRECATED

#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#ifndef _WIN32
Expand Down Expand Up @@ -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");
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
33 changes: 2 additions & 31 deletions source/evp_fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
* https://www.openssl.org/source/license.html
*/

#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
Expand Down Expand Up @@ -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

/*
Expand Down Expand Up @@ -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"
Expand All @@ -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;
Expand Down Expand Up @@ -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");
Expand Down
26 changes: 0 additions & 26 deletions source/evp_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

#define OPENSSL_SUPPRESS_DEPRECATED

#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#ifndef _WIN32
Expand Down Expand Up @@ -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");
Expand All @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
25 changes: 0 additions & 25 deletions source/evp_kdf.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#define OPENSSL_SUPPRESS_DEPRECATED

#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#ifndef _WIN32
Expand Down Expand Up @@ -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");
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Loading
Loading