Skip to content

Commit c247e77

Browse files
unwind freeze perf tests
Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org> Reviewed-by: Saša Nedvědický <sashan@openssl.org> Reviewed-by: Norbert Pocs <norbertp@openssl.org> MergeDate: Thu Jun 4 07:29:31 2026 (Merged from #89)
1 parent 0720238 commit c247e77

9 files changed

Lines changed: 3 additions & 198 deletions

File tree

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ and two required arguments:
5151
```
5252
handshake [-t] [-s] [-f] <certsdir> <threadcount>
5353
-t - produce terse output
54-
-f - freeze default context (available only with openssl >= 4.x.x)
5554
-s - create an ssl_ctx per connection, rather than a single thread-shared ctx
5655
-p - use ossl_lib_ctx per thread
5756
-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:
229228
Usage: evp_hash [-h] [-t] [-f] [-o operation] [-u update-times] [-a algorithm] thread-count
230229
-h - print this help output
231230
-t - terse output
232-
-f - freeze default context (available only with openssl >= 4.x.x)
233231
-o operation - mode of operation. One of [deprecated, evp_isolated, evp_shared] (default: evp_shared)
234232
-u update-times - times to update digest. 1 for one-shot (default: 1)
235233
-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
254252
-t - terse output
255253
-f - fetch only the specified algorithm
256254
-q - include post-quantum algorithms (available with OpenSSL >= 3.5 and PQ enabled)
257-
-F - freeze context (available only with openssl >= 4.x.x)
258255
-V - print version information and exit
259256
threadcount - number of threads
260257
```
@@ -283,7 +280,6 @@ Two modes of operation:
283280
Usage: evp_cipher [-h] [-t] [-f] [-o operation] [-u update-times] [-a algorithm] thread-count
284281
-h - print this help output
285282
-t - terse output
286-
-f - freeze default context (available only with openssl >= 4.x.x)
287283
-o operation - mode of operation. One of [evp_isolated, evp_shared] (default: evp_shared)
288284
-u update-times - times to update (default: 1)
289285
-a algorithm - One of: [AES-128-CBC, AES-256-CBC] (default: AES-128-CBC)
@@ -333,7 +329,6 @@ Four modes of operation:
333329
Usage: evp_kdf [-h] [-t] [-f] [-o operation] [-V] thread-count
334330
-h - print this help output
335331
-t - terse output
336-
-f - freeze default context (available only with openssl >= 4.x.x)
337332
-o operation - mode of operation. One of [evp_isolated, evp_shared, deprecated_isolated, deprecated_shared] (default: evp_shared)
338333
-V - print version information and exit
339334
thread-count - number of threads
@@ -356,7 +351,6 @@ Two modes of operation:
356351
Usage: evp_rand [-h] [-t] [-f] [-o operation] [-V] thread-count
357352
-h - print this help output
358353
-t - terse output
359-
-f - freeze default context
360354
-o operation - mode of operation. One of [evp_isolated, evp_shared] (default: evp_shared)
361355
-V - print version information and exit
362356
thread-count - number of threads

source/CMakeLists.txt

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ else()
208208
set(CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCLUDE_DIR}")
209209
endif()
210210

211-
check_symbol_exists(OSSL_LIB_CTX_freeze "openssl/crypto.h" HAVE_OSSL_LIB_CTX_FREEZE)
212211
check_symbol_exists(SSL_set1_dnsname "openssl/ssl.h" HAVE_SSL_SET1_DNSNAME)
213212

214213
set(run_tests CACHE STRING "List of tests to run")
@@ -223,12 +222,6 @@ if( OPENSSL_VERSION VERSION_GREATER_EQUAL 3 )
223222
evp_fetch "" "" "-q"
224223
CACHE STRING "Post-quantum option for evp_fetch")
225224
list(APPEND run_opts run_evp_fetch_pqs)
226-
if(HAVE_OSSL_LIB_CTX_FREEZE)
227-
set(run_evp_fetch_freeze
228-
evp_fetch "" "" "-F"
229-
CACHE STRING "Freeze LIB_CTX for evp_fetch")
230-
list(APPEND run_opts run_evp_fetch_freeze)
231-
endif()
232225

233226
add_executable(providerdoall providerdoall.c)
234227
target_link_libraries(providerdoall PRIVATE perf)
@@ -245,12 +238,6 @@ if( OPENSSL_VERSION VERSION_GREATER_EQUAL 3 )
245238
evp_cipher "" "" "-a AES-128-CBC" "-a AES-256-CBC"
246239
CACHE STRING "Encryption algorithms for evp_cipher")
247240
list(APPEND run_opts run_evp_cipher_algorithms)
248-
if(HAVE_OSSL_LIB_CTX_FREEZE)
249-
set(run_evp_cipher_freeze
250-
evp_cipher "" "" "-f"
251-
CACHE STRING "Freeze LIB_CTX for evp_cipher")
252-
list(APPEND run_opts run_evp_cipher_freeze)
253-
endif()
254241

255242
add_executable(evp_mac evp_mac.c)
256243
target_link_libraries(evp_mac PRIVATE perf)
@@ -267,12 +254,6 @@ if( OPENSSL_VERSION VERSION_GREATER_EQUAL 3 )
267254
evp_kdf "" "" "-o evp_shared" "-o evp_isolated" "-o deprecated_shared" "-o deprecated_isolated"
268255
CACHE STRING "Modes of operation for evp_kdf")
269256
list(APPEND run_opts run_evp_kdf_operations)
270-
if(HAVE_OSSL_LIB_CTX_FREEZE)
271-
set(run_evp_kdf_freeze
272-
evp_kdf "" "" "-f"
273-
CACHE STRING "Freeze LIB_CTX for evp_kdf")
274-
list(APPEND run_opts run_evp_kdf_freeze)
275-
endif()
276257

277258
add_executable(evp_rand evp_rand.c)
278259
target_link_libraries(evp_rand PRIVATE perf)
@@ -281,12 +262,6 @@ if( OPENSSL_VERSION VERSION_GREATER_EQUAL 3 )
281262
evp_rand "" "" "-o evp_isolated" "-o evp_shared"
282263
CACHE STRING "Modes of operation for evp_rand")
283264
list(APPEND run_opts run_evp_rand_operations)
284-
if(HAVE_OSSL_LIB_CTX_FREEZE)
285-
set(run_evp_rand_freeze
286-
evp_rand "" "" "-f"
287-
CACHE STRING "Freeze LIB_CTX for evp_rand")
288-
list(APPEND run_opts run_evp_rand_freeze)
289-
endif()
290265

291266
add_executable(evp_pkey evp_pkey.c)
292267
target_link_libraries(evp_pkey PRIVATE perf)
@@ -435,12 +410,6 @@ if( NOT WITH_OPENSSL_FORK )
435410
evp_hash "" "" "-a SHA1" "-a SHA224" "-a SHA256" "-a SHA384" "-a SHA512"
436411
CACHE STRING "Digest hash algorithms for evp_hash")
437412
list(APPEND run_opts run_evp_hash_algorithms)
438-
if(HAVE_OSSL_LIB_CTX_FREEZE)
439-
set(run_evp_hash_freeze
440-
evp_hash "" "" "-f"
441-
CACHE STRING "Freeze LIB_CTX for evp_hash")
442-
list(APPEND run_opts run_evp_hash_freeze)
443-
endif()
444413
endif()
445414

446415
set(run_add_version_dep ON

source/config.h.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
/* config.h.in */
22

3-
/* Define to 1 if you have the `OSSL_LIB_CTX_freeze' function. */
4-
#cmakedefine HAVE_OSSL_LIB_CTX_FREEZE
5-
63
/* Define to 1 if you have the `SSL_set1_dnsname' function. */
74
#cmakedefine HAVE_SSL_SET1_DNSNAME

source/evp_cipher.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
#define OPENSSL_SUPPRESS_DEPRECATED
1616

17-
#include "config.h"
1817
#include <stdlib.h>
1918
#include <stdio.h>
2019
#ifndef _WIN32
@@ -122,16 +121,9 @@ static void do_cipher_shared(size_t num)
122121

123122
static void print_help(FILE *file)
124123
{
125-
#ifdef HAVE_OSSL_LIB_CTX_FREEZE
126-
fprintf(file, "Usage: evp_cipher [-h] [-f] [-t] [-o operation] [-u update-times] [-a algorithm] [-V] thread-count\n");
127-
#else
128124
fprintf(file, "Usage: evp_cipher [-h] [-t] [-o operation] [-u update-times] [-a algorithm] [-V] thread-count\n");
129-
#endif
130125
fprintf(file, "-h - print this help output\n");
131126
fprintf(file, "-t - terse output\n");
132-
#ifdef HAVE_OSSL_LIB_CTX_FREEZE
133-
fprintf(file, "-f - freeze default context\n");
134-
#endif
135127
fprintf(file, "-o operation - mode of operation. One of [evp_isolated, evp_shared] (default: evp_shared)\n");
136128
fprintf(file, "-u update-times - times to update (default: 1)\n");
137129
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[])
148140
int j, opt, rc = EXIT_FAILURE;
149141
int key_len, iv_len;
150142
char *getopt_options = "Vhto:u:a:";
151-
#ifdef HAVE_OSSL_LIB_CTX_FREEZE
152-
int freeze = 0;
153-
getopt_options = "Vhto:u:a:f";
154-
#endif
155143

156144
while ((opt = getopt(argc, argv, getopt_options)) != -1) {
157145
switch (opt) {
158-
#ifdef HAVE_OSSL_LIB_CTX_FREEZE
159-
case 'f':
160-
freeze = 1;
161-
break;
162-
#endif
163146
case 't':
164147
terse = 1;
165148
break;
@@ -246,15 +229,6 @@ int main(int argc, char *argv[])
246229

247230
max_time = ossl_time_add(ossl_time_now(), ossl_seconds2time(RUN_TIME));
248231

249-
#ifdef HAVE_OSSL_LIB_CTX_FREEZE
250-
if (freeze) {
251-
if (OSSL_LIB_CTX_freeze(NULL, NULL) == 0) {
252-
fprintf(stderr, "Freezing LIB CTX failed\n");
253-
goto err;
254-
}
255-
}
256-
#endif
257-
258232
switch (operation) {
259233
case EVP_ISOLATED:
260234
err = !perflib_run_multi_thread_test(do_cipher_isolated, threadcount, &duration) || err;

source/evp_fetch.c

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* https://www.openssl.org/source/license.html
88
*/
99

10-
#include "config.h"
1110
#include <stdlib.h>
1211
#include <stdio.h>
1312
#include <string.h>
@@ -39,16 +38,6 @@
3938
# define PQ_USAGE_DESC ""
4039
#endif
4140

42-
#ifdef HAVE_OSSL_LIB_CTX_FREEZE
43-
#define FREEZE_GETOPT "F"
44-
#define FREEZE_USAGE_OPT " [-F]"
45-
#define FREEZE_USAGE_DESC "-F - freeze context\n"
46-
#else
47-
#define FREEZE_GETOPT ""
48-
#define FREEZE_USAGE_OPT ""
49-
#define FREEZE_USAGE_DESC ""
50-
#endif
51-
5241
#define RUN_TIME 5
5342

5443
/*
@@ -301,12 +290,11 @@ void do_fetch(size_t num)
301290
static void
302291
usage(const char *progname)
303292
{
304-
printf("Usage: %s [-t] [-f TYPE:ALGORITHM]" PQ_USAGE_OPT " [-V]" FREEZE_USAGE_OPT
293+
printf("Usage: %s [-t] [-f TYPE:ALGORITHM]" PQ_USAGE_OPT " [-V]"
305294
" threadcount\n"
306295
"-t - terse output\n"
307296
"-f - fetch only the specified algorithm\n"
308297
PQ_USAGE_DESC
309-
FREEZE_USAGE_DESC
310298
"-V - print version information and exit\n"
311299
"\nEnvironment variables:\n"
312300
" EVP_FETCH_TYPE - if no -f option is provided, fetch only\n"
@@ -333,17 +321,9 @@ int main(int argc, char *argv[])
333321
int rc = EXIT_FAILURE;
334322
char *fetch_type = getenv("EVP_FETCH_TYPE");
335323
int opt;
336-
#ifdef HAVE_OSSL_LIB_CTX_FREEZE
337-
int freeze = 0;
338-
#endif
339324

340-
while ((opt = getopt(argc, argv, "tf:" PQ_GETOPT "V" FREEZE_GETOPT)) != -1) {
325+
while ((opt = getopt(argc, argv, "tf:" PQ_GETOPT "V")) != -1) {
341326
switch (opt) {
342-
#ifdef HAVE_OSSL_LIB_CTX_FREEZE
343-
case 'F':
344-
freeze = 1;
345-
break;
346-
#endif
347327
case 't':
348328
terse = 1;
349329
break;
@@ -401,15 +381,6 @@ int main(int argc, char *argv[])
401381
if (ctx == NULL)
402382
return EXIT_FAILURE;
403383

404-
#ifdef HAVE_OSSL_LIB_CTX_FREEZE
405-
if (freeze) {
406-
if (OSSL_LIB_CTX_freeze(ctx, NULL) == 0) {
407-
fprintf(stderr, "Freezing LIB CTX failed\n");
408-
goto out;
409-
}
410-
}
411-
#endif
412-
413384
counts = OPENSSL_malloc(sizeof(size_t) * threadcount);
414385
if (counts == NULL) {
415386
printf("Failed to create counts array\n");

source/evp_hash.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
#define OPENSSL_SUPPRESS_DEPRECATED
1717

18-
#include "config.h"
1918
#include <stdlib.h>
2019
#include <stdio.h>
2120
#ifndef _WIN32
@@ -251,16 +250,9 @@ static void do_hash_evp_shared(size_t num)
251250

252251
static void print_help()
253252
{
254-
#ifdef HAVE_OSSL_LIB_CTX_FREEZE
255-
printf("Usage: evp_hash [-h] [-t] [-f] [-o operation] [-u update-times] [-a algorithm] [-V] thread-count\n");
256-
#else
257253
printf("Usage: evp_hash [-h] [-t] [-o operation] [-u update-times] [-a algorithm] [-V] thread-count\n");
258-
#endif
259254
printf("-h - print this help output\n");
260255
printf("-t - terse output\n");
261-
#ifdef HAVE_OSSL_LIB_CTX_FREEZE
262-
printf("-f - freeze default context\n");
263-
#endif
264256
printf("-o operation - mode of operation. One of [deprecated, evp_isolated, evp_shared] (default: evp_shared)\n");
265257
printf("-u update-times - times to update digest. 1 for one-shot (default: 1)\n");
266258
printf("-a algorithm - One of: [SHA1, SHA224, SHA256, SHA384, SHA512] (default: SHA1)\n");
@@ -276,18 +268,9 @@ int main(int argc, char *argv[])
276268
int terse = 0, operation = EVP_SHARED, hash_algorithm = SHA1_ALG;
277269
int j, opt, rc = EXIT_FAILURE;
278270
char *getopt_options = "hto:u:a:V";
279-
#ifdef HAVE_OSSL_LIB_CTX_FREEZE
280-
int freeze = 0;
281-
getopt_options = "hto:u:a:Vf";
282-
#endif
283271

284272
while ((opt = getopt(argc, argv, getopt_options)) != -1) {
285273
switch (opt) {
286-
#ifdef HAVE_OSSL_LIB_CTX_FREEZE
287-
case 'f':
288-
freeze = 1;
289-
break;
290-
#endif
291274
case 't':
292275
terse = 1;
293276
break;
@@ -365,15 +348,6 @@ int main(int argc, char *argv[])
365348

366349
max_time = ossl_time_add(ossl_time_now(), ossl_seconds2time(RUN_TIME));
367350

368-
#ifdef HAVE_OSSL_LIB_CTX_FREEZE
369-
if (freeze) {
370-
if (OSSL_LIB_CTX_freeze(NULL, NULL) == 0) {
371-
fprintf(stderr, "Freezing LIB CTX failed\n");
372-
goto out;
373-
}
374-
}
375-
#endif
376-
377351
switch (operation) {
378352
case DEPRECATED:
379353
switch (hash_algorithm) {

source/evp_kdf.c

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
#define OPENSSL_SUPPRESS_DEPRECATED
1616

17-
#include "config.h"
1817
#include <stdlib.h>
1918
#include <stdio.h>
2019
#ifndef _WIN32
@@ -170,16 +169,9 @@ static void do_deprecated_shared(size_t num)
170169

171170
static void print_help(FILE *file)
172171
{
173-
#ifdef HAVE_OSSL_LIB_CTX_FREEZE
174-
fprintf(file, "Usage: evp_kdf [-h] [-t] [-f] [-o operation] [-V] thread-count\n");
175-
#else
176172
fprintf(file, "Usage: evp_kdf [-h] [-t] [-o operation] [-V] thread-count\n");
177-
#endif
178173
fprintf(file, "-h - print this help output\n");
179174
fprintf(file, "-t - terse output\n");
180-
#ifdef HAVE_OSSL_LIB_CTX_FREEZE
181-
printf("-f - freeze default context\n");
182-
#endif
183175
fprintf(file, "-o operation - mode of operation. One of [evp_isolated, evp_shared, deprecated_isolated, deprecated_shared] (default: evp_shared)\n");
184176
fprintf(file, "-V - print version information and exit\n");
185177
fprintf(file, "thread-count - number of threads\n");
@@ -193,18 +185,9 @@ int main(int argc, char *argv[])
193185
int terse = 0, operation = EVP_SHARED;
194186
int j, opt, rc = EXIT_FAILURE;
195187
char *getopt_options = "Vhto:";
196-
#ifdef HAVE_OSSL_LIB_CTX_FREEZE
197-
int freeze = 0;
198-
getopt_options = "Vhto:f";
199-
#endif
200188

201189
while ((opt = getopt(argc, argv, getopt_options)) != -1) {
202190
switch (opt) {
203-
#ifdef HAVE_OSSL_LIB_CTX_FREEZE
204-
case 'f':
205-
freeze = 1;
206-
break;
207-
#endif
208191
case 't':
209192
terse = 1;
210193
break;
@@ -260,14 +243,6 @@ int main(int argc, char *argv[])
260243

261244
max_time = ossl_time_add(ossl_time_now(), ossl_seconds2time(RUN_TIME));
262245

263-
#ifdef HAVE_OSSL_LIB_CTX_FREEZE
264-
if (freeze) {
265-
if (OSSL_LIB_CTX_freeze(NULL, NULL) == 0) {
266-
fprintf(stderr, "Freezing LIB CTX failed\n");
267-
goto err;
268-
}
269-
}
270-
#endif
271246
switch (operation) {
272247
case EVP_SHARED:
273248
run_err = !perflib_run_multi_thread_test(do_evp_shared, threadcount, &duration) || run_err;

0 commit comments

Comments
 (0)