diff options
author | Dr. Matthias St. Pierre <matthias.st.pierre@ncp-e.com> | 2020-10-15 12:55:50 +0300 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2020-10-15 11:59:53 +0100 |
commit | b425001010044adbdbcd98f8682694b30b73bbf4 (patch) | |
tree | e87a5b512d7869cb6a500ecc74b706281be762cf /test | |
parent | 29000e43ea257bf54f6ccb2064b3744853b821b2 (diff) |
Rename OPENSSL_CTX prefix to OSSL_LIB_CTX
Many of the new types introduced by OpenSSL 3.0 have an OSSL_ prefix,
e.g., OSSL_CALLBACK, OSSL_PARAM, OSSL_ALGORITHM, OSSL_SERIALIZER.
The OPENSSL_CTX type stands out a little by using a different prefix.
For consistency reasons, this type is renamed to OSSL_LIB_CTX.
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12621)
Diffstat (limited to 'test')
-rw-r--r-- | test/acvp_test.c | 8 | ||||
-rw-r--r-- | test/asynctest.c | 32 | ||||
-rw-r--r-- | test/cmp_client_test.c | 4 | ||||
-rw-r--r-- | test/cmp_msg_test.c | 4 | ||||
-rw-r--r-- | test/cmp_protect_test.c | 4 | ||||
-rw-r--r-- | test/cmp_server_test.c | 4 | ||||
-rw-r--r-- | test/cmp_testlib.c | 4 | ||||
-rw-r--r-- | test/cmp_testlib.h | 4 | ||||
-rw-r--r-- | test/cmp_vfy_test.c | 4 | ||||
-rw-r--r-- | test/context_internal_test.c | 16 | ||||
-rw-r--r-- | test/evp_extra_test.c | 16 | ||||
-rw-r--r-- | test/evp_extra_test2.c | 14 | ||||
-rw-r--r-- | test/evp_fetch_prov_test.c | 18 | ||||
-rw-r--r-- | test/evp_libctx_test.c | 8 | ||||
-rw-r--r-- | test/evp_test.c | 14 | ||||
-rw-r--r-- | test/filterprov.c | 10 | ||||
-rw-r--r-- | test/keymgmt_internal_test.c | 12 | ||||
-rw-r--r-- | test/property_test.c | 6 | ||||
-rw-r--r-- | test/provider_fallback_test.c | 8 | ||||
-rw-r--r-- | test/provider_status_test.c | 6 | ||||
-rw-r--r-- | test/ssl_test.c | 4 | ||||
-rw-r--r-- | test/ssl_test_ctx.c | 7 | ||||
-rw-r--r-- | test/ssl_test_ctx.h | 6 | ||||
-rw-r--r-- | test/sslapitest.c | 18 | ||||
-rw-r--r-- | test/ssltest_old.c | 8 | ||||
-rw-r--r-- | test/ssltestlib.c | 2 | ||||
-rw-r--r-- | test/ssltestlib.h | 2 | ||||
-rw-r--r-- | test/testutil.h | 2 | ||||
-rw-r--r-- | test/testutil/provider.c | 6 | ||||
-rw-r--r-- | test/tls-provider.c | 12 |
30 files changed, 132 insertions, 131 deletions
diff --git a/test/acvp_test.c b/test/acvp_test.c index 9fa259ec16..1686d759db 100644 --- a/test/acvp_test.c +++ b/test/acvp_test.c @@ -43,7 +43,7 @@ typedef struct st_args { } SELF_TEST_ARGS; static OSSL_PROVIDER *prov_null = NULL; -static OPENSSL_CTX *libctx = NULL; +static OSSL_LIB_CTX *libctx = NULL; static SELF_TEST_ARGS self_test_args = { 0 }; static OSSL_CALLBACK self_test_events; @@ -1440,9 +1440,9 @@ int setup_tests(void) return 0; } - libctx = OPENSSL_CTX_new(); + libctx = OSSL_LIB_CTX_new(); if (libctx == NULL - || !OPENSSL_CTX_load_config(libctx, config_file)) { + || !OSSL_LIB_CTX_load_config(libctx, config_file)) { opt_printf_stderr("Failed to load config\n"); return 0; } @@ -1489,5 +1489,5 @@ int setup_tests(void) void cleanup_tests(void) { OSSL_PROVIDER_unload(prov_null); - OPENSSL_CTX_free(libctx); + OSSL_LIB_CTX_free(libctx); } diff --git a/test/asynctest.c b/test/asynctest.c index a7aab8efde..6502ee9845 100644 --- a/test/asynctest.c +++ b/test/asynctest.c @@ -45,33 +45,33 @@ static int save_current(void *args) static int change_deflt_libctx(void *args) { - OPENSSL_CTX *libctx = OPENSSL_CTX_new(); - OPENSSL_CTX *oldctx, *tmpctx; + OSSL_LIB_CTX *libctx = OSSL_LIB_CTX_new(); + OSSL_LIB_CTX *oldctx, *tmpctx; int ret = 0; if (libctx == NULL) return 0; - oldctx = OPENSSL_CTX_set0_default(libctx); + oldctx = OSSL_LIB_CTX_set0_default(libctx); ASYNC_pause_job(); /* Check the libctx is set up as we expect */ - tmpctx = OPENSSL_CTX_set0_default(oldctx); + tmpctx = OSSL_LIB_CTX_set0_default(oldctx); if (tmpctx != libctx) goto err; /* Set it back again to continue to use our own libctx */ - oldctx = OPENSSL_CTX_set0_default(libctx); + oldctx = OSSL_LIB_CTX_set0_default(libctx); ASYNC_pause_job(); /* Check the libctx is set up as we expect */ - tmpctx = OPENSSL_CTX_set0_default(oldctx); + tmpctx = OSSL_LIB_CTX_set0_default(oldctx); if (tmpctx != libctx) goto err; ret = 1; err: - OPENSSL_CTX_free(libctx); + OSSL_LIB_CTX_free(libctx); return ret; } @@ -344,8 +344,8 @@ static int test_ASYNC_start_job_ex(void) ASYNC_JOB *job = NULL; int funcret; ASYNC_WAIT_CTX *waitctx = NULL; - OPENSSL_CTX *libctx = OPENSSL_CTX_new(); - OPENSSL_CTX *oldctx, *tmpctx, *globalctx; + OSSL_LIB_CTX *libctx = OSSL_LIB_CTX_new(); + OSSL_LIB_CTX *oldctx, *tmpctx, *globalctx; int ret = 0; if (libctx == NULL) { @@ -354,7 +354,7 @@ static int test_ASYNC_start_job_ex(void) goto err; } - globalctx = oldctx = OPENSSL_CTX_set0_default(libctx); + globalctx = oldctx = OSSL_LIB_CTX_set0_default(libctx); if ((waitctx = ASYNC_WAIT_CTX_new()) == NULL || ASYNC_start_job(&job, waitctx, &funcret, change_deflt_libctx, @@ -366,8 +366,8 @@ static int test_ASYNC_start_job_ex(void) } /* Reset the libctx temporarily to find out what it is*/ - tmpctx = OPENSSL_CTX_set0_default(oldctx); - oldctx = OPENSSL_CTX_set0_default(tmpctx); + tmpctx = OSSL_LIB_CTX_set0_default(oldctx); + oldctx = OSSL_LIB_CTX_set0_default(tmpctx); if (tmpctx != libctx) { fprintf(stderr, "test_ASYNC_start_job_ex() failed - unexpected libctx\n"); @@ -382,7 +382,7 @@ static int test_ASYNC_start_job_ex(void) } /* Reset the libctx and continue with the global default libctx */ - tmpctx = OPENSSL_CTX_set0_default(oldctx); + tmpctx = OSSL_LIB_CTX_set0_default(oldctx); if (tmpctx != libctx) { fprintf(stderr, "test_ASYNC_start_job_ex() failed - unexpected libctx\n"); @@ -398,8 +398,8 @@ static int test_ASYNC_start_job_ex(void) } /* Reset the libctx temporarily to find out what it is*/ - tmpctx = OPENSSL_CTX_set0_default(libctx); - OPENSSL_CTX_set0_default(tmpctx); + tmpctx = OSSL_LIB_CTX_set0_default(libctx); + OSSL_LIB_CTX_set0_default(tmpctx); if (tmpctx != globalctx) { fprintf(stderr, "test_ASYNC_start_job_ex() failed - global libctx check failed\n"); @@ -409,7 +409,7 @@ static int test_ASYNC_start_job_ex(void) ret = 1; err: ASYNC_WAIT_CTX_free(waitctx); - OPENSSL_CTX_free(libctx); + OSSL_LIB_CTX_free(libctx); return ret; } diff --git a/test/cmp_client_test.c b/test/cmp_client_test.c index 169f63a822..dfb7dcb9f0 100644 --- a/test/cmp_client_test.c +++ b/test/cmp_client_test.c @@ -30,7 +30,7 @@ typedef struct test_fixture { STACK_OF(X509) *caPubs; } CMP_SES_TEST_FIXTURE; -static OPENSSL_CTX *libctx = NULL; +static OSSL_LIB_CTX *libctx = NULL; static OSSL_PROVIDER *default_null_provider = NULL, *provider = NULL; static EVP_PKEY *server_key = NULL; @@ -343,7 +343,7 @@ void cleanup_tests(void) EVP_PKEY_free(server_key); X509_free(client_cert); EVP_PKEY_free(client_key); - OPENSSL_CTX_free(libctx); + OSSL_LIB_CTX_free(libctx); return; } diff --git a/test/cmp_msg_test.c b/test/cmp_msg_test.c index 6f3b931eaa..cc5a6268fd 100644 --- a/test/cmp_msg_test.c +++ b/test/cmp_msg_test.c @@ -30,7 +30,7 @@ typedef struct test_fixture { OSSL_CMP_PKISI *si; } CMP_MSG_TEST_FIXTURE; -static OPENSSL_CTX *libctx = NULL; +static OSSL_LIB_CTX *libctx = NULL; static OSSL_PROVIDER *default_null_provider = NULL, *provider = NULL; /* TODO(3.0) Clean this up - See issue #12680 */ @@ -551,7 +551,7 @@ void cleanup_tests(void) { EVP_PKEY_free(newkey); X509_free(cert); - OPENSSL_CTX_free(libctx); + OSSL_LIB_CTX_free(libctx); } #define USAGE "new.key server.crt pkcs10.der module_name [module_conf_file]\n" diff --git a/test/cmp_protect_test.c b/test/cmp_protect_test.c index 8f76a14222..933adcb196 100644 --- a/test/cmp_protect_test.c +++ b/test/cmp_protect_test.c @@ -31,7 +31,7 @@ typedef struct test_fixture { int expected; } CMP_PROTECT_TEST_FIXTURE; -static OPENSSL_CTX *libctx = NULL; +static OSSL_LIB_CTX *libctx = NULL; static OSSL_PROVIDER *default_null_provider = NULL, *provider = NULL; static void tear_down(CMP_PROTECT_TEST_FIXTURE *fixture) @@ -500,7 +500,7 @@ void cleanup_tests(void) X509_free(intermediate); OSSL_CMP_MSG_free(ir_protected); OSSL_CMP_MSG_free(ir_unprotected); - OPENSSL_CTX_free(libctx); + OSSL_LIB_CTX_free(libctx); } #define USAGE "server.pem IR_protected.der IR_unprotected.der IP_PBM.der " \ diff --git a/test/cmp_server_test.c b/test/cmp_server_test.c index 4b3525d7bd..d2a34695c3 100644 --- a/test/cmp_server_test.c +++ b/test/cmp_server_test.c @@ -18,7 +18,7 @@ typedef struct test_fixture { OSSL_CMP_MSG *req; } CMP_SRV_TEST_FIXTURE; -static OPENSSL_CTX *libctx = NULL; +static OSSL_LIB_CTX *libctx = NULL; static OSSL_PROVIDER *default_null_provider = NULL, *provider = NULL; static OSSL_CMP_MSG *request = NULL; @@ -123,7 +123,7 @@ void cleanup_tests(void) OSSL_CMP_MSG_free(request); OSSL_PROVIDER_unload(default_null_provider); OSSL_PROVIDER_unload(provider); - OPENSSL_CTX_free(libctx); + OSSL_LIB_CTX_free(libctx); return; } diff --git a/test/cmp_testlib.c b/test/cmp_testlib.c index ee6f91a951..627b73c3b1 100644 --- a/test/cmp_testlib.c +++ b/test/cmp_testlib.c @@ -12,7 +12,7 @@ #include "cmp_testlib.h" #include <openssl/rsa.h> /* needed in case config no-deprecated */ -EVP_PKEY *load_pem_key(const char *file, OPENSSL_CTX *libctx) +EVP_PKEY *load_pem_key(const char *file, OSSL_LIB_CTX *libctx) { EVP_PKEY *key = NULL; BIO *bio = NULL; @@ -27,7 +27,7 @@ EVP_PKEY *load_pem_key(const char *file, OPENSSL_CTX *libctx) return key; } -X509 *load_pem_cert(const char *file, OPENSSL_CTX *libctx) +X509 *load_pem_cert(const char *file, OSSL_LIB_CTX *libctx) { X509 *cert = NULL; BIO *bio = NULL; diff --git a/test/cmp_testlib.h b/test/cmp_testlib.h index e6b37a6e3d..e4361b198a 100644 --- a/test/cmp_testlib.h +++ b/test/cmp_testlib.h @@ -23,8 +23,8 @@ # ifndef OPENSSL_NO_CMP # define CMP_TEST_REFVALUE_LENGTH 15 /* arbitrary value */ -EVP_PKEY *load_pem_key(const char *file, OPENSSL_CTX *libctx); -X509 *load_pem_cert(const char *file, OPENSSL_CTX *libctx); +EVP_PKEY *load_pem_key(const char *file, OSSL_LIB_CTX *libctx); +X509 *load_pem_cert(const char *file, OSSL_LIB_CTX *libctx); X509_REQ *load_csr(const char *file); OSSL_CMP_MSG *load_pkimsg(const char *file); int valid_asn1_encoding(const OSSL_CMP_MSG *msg); diff --git a/test/cmp_vfy_test.c b/test/cmp_vfy_test.c index 0559ec47c3..2343ebe699 100644 --- a/test/cmp_vfy_test.c +++ b/test/cmp_vfy_test.c @@ -37,7 +37,7 @@ typedef struct test_fixture { int additional_arg; } CMP_VFY_TEST_FIXTURE; -static OPENSSL_CTX *libctx = NULL; +static OSSL_LIB_CTX *libctx = NULL; static OSSL_PROVIDER *default_null_provider = NULL, *provider = NULL; static void tear_down(CMP_VFY_TEST_FIXTURE *fixture) @@ -549,7 +549,7 @@ void cleanup_tests(void) X509_free(instaca_cert); OSSL_CMP_MSG_free(ir_unprotected); OSSL_CMP_MSG_free(ir_rmprotection); - OPENSSL_CTX_free(libctx); + OSSL_LIB_CTX_free(libctx); return; } diff --git a/test/context_internal_test.c b/test/context_internal_test.c index 6c675bcf9d..e2d7b0f441 100644 --- a/test/context_internal_test.c +++ b/test/context_internal_test.c @@ -14,7 +14,7 @@ /* * Everything between BEGIN EXAMPLE and END EXAMPLE is copied from - * doc/internal/man3/openssl_ctx_get_data.pod + * doc/internal/man3/ossl_lib_ctx_get_data.pod */ /* @@ -27,7 +27,7 @@ typedef struct foo_st { void *data; } FOO; -static void *foo_new(OPENSSL_CTX *ctx) +static void *foo_new(OSSL_LIB_CTX *ctx) { FOO *ptr = OPENSSL_zalloc(sizeof(*ptr)); if (ptr != NULL) @@ -38,7 +38,7 @@ static void foo_free(void *ptr) { OPENSSL_free(ptr); } -static const OPENSSL_CTX_METHOD foo_method = { +static const OSSL_LIB_CTX_METHOD foo_method = { foo_new, foo_free }; @@ -48,23 +48,23 @@ static const OPENSSL_CTX_METHOD foo_method = { * ====================================================================== */ -static int test_context(OPENSSL_CTX *ctx) +static int test_context(OSSL_LIB_CTX *ctx) { FOO *data = NULL; - return TEST_ptr(data = openssl_ctx_get_data(ctx, 0, &foo_method)) + return TEST_ptr(data = ossl_lib_ctx_get_data(ctx, 0, &foo_method)) /* OPENSSL_zalloc in foo_new() initialized it to zero */ && TEST_int_eq(data->i, 42); } static int test_app_context(void) { - OPENSSL_CTX *ctx = NULL; + OSSL_LIB_CTX *ctx = NULL; int result = - TEST_ptr(ctx = OPENSSL_CTX_new()) + TEST_ptr(ctx = OSSL_LIB_CTX_new()) && test_context(ctx); - OPENSSL_CTX_free(ctx); + OSSL_LIB_CTX_free(ctx); return result; } diff --git a/test/evp_extra_test.c b/test/evp_extra_test.c index 872b9d5313..8ee41ab5ce 100644 --- a/test/evp_extra_test.c +++ b/test/evp_extra_test.c @@ -34,7 +34,7 @@ #include "crypto/evp.h" #include "../e_os.h" /* strcasecmp */ -static OPENSSL_CTX *testctx = NULL; +static OSSL_LIB_CTX *testctx = NULL; /* * kExampleRSAKeyDER is an RSA private key in ASN.1, DER format. Of course, you @@ -478,11 +478,11 @@ static EVP_PKEY *load_example_hmac_key(void) static int test_EVP_set_default_properties(void) { - OPENSSL_CTX *ctx; + OSSL_LIB_CTX *ctx; EVP_MD *md = NULL; int res = 0; - if (!TEST_ptr(ctx = OPENSSL_CTX_new()) + if (!TEST_ptr(ctx = OSSL_LIB_CTX_new()) || !TEST_ptr(md = EVP_MD_fetch(ctx, "sha256", NULL))) goto err; EVP_MD_free(md); @@ -501,7 +501,7 @@ static int test_EVP_set_default_properties(void) res = 1; err: EVP_MD_free(md); - OPENSSL_CTX_free(ctx); + OSSL_LIB_CTX_free(ctx); return res; } @@ -1894,7 +1894,7 @@ static int test_keygen_with_empty_template(int n) */ static int test_pkey_ctx_fail_without_provider(int tst) { - OPENSSL_CTX *tmpctx = OPENSSL_CTX_new(); + OSSL_LIB_CTX *tmpctx = OSSL_LIB_CTX_new(); OSSL_PROVIDER *nullprov = NULL; EVP_PKEY_CTX *pctx = NULL; const char *keytype = NULL; @@ -1949,7 +1949,7 @@ static int test_pkey_ctx_fail_without_provider(int tst) err: EVP_PKEY_CTX_free(pctx); OSSL_PROVIDER_unload(nullprov); - OPENSSL_CTX_free(tmpctx); + OSSL_LIB_CTX_free(tmpctx); return ret; } @@ -2098,7 +2098,7 @@ err: int setup_tests(void) { - testctx = OPENSSL_CTX_new(); + testctx = OSSL_LIB_CTX_new(); if (!TEST_ptr(testctx)) return 0; @@ -2162,5 +2162,5 @@ int setup_tests(void) void cleanup_tests(void) { - OPENSSL_CTX_free(testctx); + OSSL_LIB_CTX_free(testctx); } diff --git a/test/evp_extra_test2.c b/test/evp_extra_test2.c index 0667a82647..f91e66a08b 100644 --- a/test/evp_extra_test2.c +++ b/test/evp_extra_test2.c @@ -20,7 +20,7 @@ #include "testutil.h" #include "internal/nelem.h" -static OPENSSL_CTX *mainctx = NULL; +static OSSL_LIB_CTX *mainctx = NULL; static OSSL_PROVIDER *nullprov = NULL; /* @@ -214,7 +214,7 @@ static int test_d2i_AutoPrivateKey_ex(int i) static int test_alternative_default(void) { - OPENSSL_CTX *oldctx; + OSSL_LIB_CTX *oldctx; EVP_MD *sha256; int ok = 0; @@ -229,7 +229,7 @@ static int test_alternative_default(void) * Now we switch to our main library context, and try again. Since no * providers are loaded in this one, it should fall back to the default. */ - if (!TEST_ptr(oldctx = OPENSSL_CTX_set0_default(mainctx)) + if (!TEST_ptr(oldctx = OSSL_LIB_CTX_set0_default(mainctx)) || !TEST_ptr(sha256 = EVP_MD_fetch(NULL, "SHA2-256", NULL))) goto err; EVP_MD_free(sha256); @@ -239,7 +239,7 @@ static int test_alternative_default(void) * Switching back should give us our main library context back, and * fetching SHA2-256 should fail again. */ - if (!TEST_ptr_eq(OPENSSL_CTX_set0_default(oldctx), mainctx) + if (!TEST_ptr_eq(OSSL_LIB_CTX_set0_default(oldctx), mainctx) || !TEST_ptr_null(sha256 = EVP_MD_fetch(NULL, "SHA2-256", NULL))) goto err; @@ -272,14 +272,14 @@ static int test_d2i_PrivateKey_ex(void) { int setup_tests(void) { - mainctx = OPENSSL_CTX_new(); + mainctx = OSSL_LIB_CTX_new(); if (!TEST_ptr(mainctx)) return 0; nullprov = OSSL_PROVIDER_load(NULL, "null"); if (!TEST_ptr(nullprov)) { - OPENSSL_CTX_free(mainctx); + OSSL_LIB_CTX_free(mainctx); mainctx = NULL; return 0; } @@ -293,6 +293,6 @@ int setup_tests(void) void cleanup_tests(void) { - OPENSSL_CTX_free(mainctx); + OSSL_LIB_CTX_free(mainctx); OSSL_PROVIDER_unload(nullprov); } diff --git a/test/evp_fetch_prov_test.c b/test/evp_fetch_prov_test.c index d7f43f229d..18e57c76c6 100644 --- a/test/evp_fetch_prov_test.c +++ b/test/evp_fetch_prov_test.c @@ -76,17 +76,17 @@ static int calculate_digest(const EVP_MD *md, const char *msg, size_t len, return ret; } -static int load_providers(OPENSSL_CTX **libctx, OSSL_PROVIDER *prov[]) +static int load_providers(OSSL_LIB_CTX **libctx, OSSL_PROVIDER *prov[]) { - OPENSSL_CTX *ctx = NULL; + OSSL_LIB_CTX *ctx = NULL; int ret = 0; size_t i; - ctx = OPENSSL_CTX_new(); + ctx = OSSL_LIB_CTX_new(); if (!TEST_ptr(ctx)) goto err; - if (!TEST_true(OPENSSL_CTX_load_config(ctx, config_file))) + if (!TEST_true(OSSL_LIB_CTX_load_config(ctx, config_file))) goto err; if (test_get_argument_count() > 2) goto err; @@ -102,7 +102,7 @@ static int load_providers(OPENSSL_CTX **libctx, OSSL_PROVIDER *prov[]) *libctx = ctx; err: if (ret == 0) - OPENSSL_CTX_free(ctx); + OSSL_LIB_CTX_free(ctx); return ret; } @@ -111,7 +111,7 @@ err: */ static int test_EVP_MD_fetch(void) { - OPENSSL_CTX *ctx = NULL; + OSSL_LIB_CTX *ctx = NULL; EVP_MD *md = NULL; OSSL_PROVIDER *prov[2] = {NULL, NULL}; int ret = 0; @@ -162,7 +162,7 @@ err: */ if (ctx != NULL) { OPENSSL_thread_stop_ex(ctx); - OPENSSL_CTX_free(ctx); + OSSL_LIB_CTX_free(ctx); } return ret; } @@ -197,7 +197,7 @@ err: */ static int test_EVP_CIPHER_fetch(void) { - OPENSSL_CTX *ctx = NULL; + OSSL_LIB_CTX *ctx = NULL; EVP_CIPHER *cipher = NULL; OSSL_PROVIDER *prov[2] = {NULL, NULL}; int ret = 0; @@ -229,7 +229,7 @@ err: EVP_CIPHER_free(cipher); OSSL_PROVIDER_unload(prov[0]); OSSL_PROVIDER_unload(prov[1]); - OPENSSL_CTX_free(ctx); + OSSL_LIB_CTX_free(ctx); return ret; } diff --git a/test/evp_libctx_test.c b/test/evp_libctx_test.c index 50d463680a..e8d41ab2a7 100644 --- a/test/evp_libctx_test.c +++ b/test/evp_libctx_test.c @@ -32,7 +32,7 @@ #include "crypto/bn_dh.h" /* _bignum_ffdhe2048_p */ #include "../e_os.h" /* strcasecmp */ -static OPENSSL_CTX *libctx = NULL; +static OSSL_LIB_CTX *libctx = NULL; static OSSL_PROVIDER *nullprov = NULL; static OSSL_PROVIDER *libprov = NULL; static STACK_OF(OPENSSL_CSTRING) *cipher_names = NULL; @@ -643,11 +643,11 @@ int setup_tests(void) if (!TEST_ptr(nullprov)) return 0; - libctx = OPENSSL_CTX_new(); + libctx = OSSL_LIB_CTX_new(); if (!TEST_ptr(libctx)) return 0; if (config_file != NULL - && !TEST_true(OPENSSL_CTX_load_config(libctx, config_file))) + && !TEST_true(OSSL_LIB_CTX_load_config(libctx, config_file))) return 0; libprov = OSSL_PROVIDER_load(libctx, prov_name); @@ -681,6 +681,6 @@ void cleanup_tests(void) { sk_OPENSSL_CSTRING_free(cipher_names); OSSL_PROVIDER_unload(libprov); - OPENSSL_CTX_free(libctx); + OSSL_LIB_CTX_free(libctx); OSSL_PROVIDER_unload(nullprov); } diff --git a/test/evp_test.c b/test/evp_test.c index d7e40f214e..fc9121edac 100644 --- a/test/evp_test.c +++ b/test/evp_test.c @@ -73,7 +73,7 @@ typedef enum OPTION_choice { } OPTION_CHOICE; static OSSL_PROVIDER *prov_null = NULL; -static OPENSSL_CTX *libctx = NULL; +static OSSL_LIB_CTX *libctx = NULL; /* List of public and private keys */ static KEY_LIST *private_keys; @@ -1842,9 +1842,9 @@ static int pbe_test_run(EVP_TEST *t) PBE_DATA *expected = t->data; unsigned char *key; EVP_MD *fetched_digest = NULL; - OPENSSL_CTX *save_libctx; + OSSL_LIB_CTX *save_libctx; - save_libctx = OPENSSL_CTX_set0_default(libctx); + save_libctx = OSSL_LIB_CTX_set0_default(libctx); if (!TEST_ptr(key = OPENSSL_malloc(expected->key_len))) { t->err = "INTERNAL_ERROR"; @@ -1890,7 +1890,7 @@ static int pbe_test_run(EVP_TEST *t) err: EVP_MD_free(fetched_digest); OPENSSL_free(key); - OPENSSL_CTX_set0_default(save_libctx); + OSSL_LIB_CTX_set0_default(save_libctx); return 1; } @@ -3595,9 +3595,9 @@ int setup_tests(void) } /* load the provider via configuration into the created library context */ - libctx = OPENSSL_CTX_new(); + libctx = OSSL_LIB_CTX_new(); if (libctx == NULL - || !OPENSSL_CTX_load_config(libctx, config_file)) { + || !OSSL_LIB_CTX_load_config(libctx, config_file)) { TEST_error("Failed to load config %s\n", config_file); return 0; } @@ -3613,7 +3613,7 @@ int setup_tests(void) void cleanup_tests(void) { OSSL_PROVIDER_unload(prov_null); - OPENSSL_CTX_free(libctx); + OSSL_LIB_CTX_free(libctx); } #define STR_STARTS_WITH(str, pre) strncasecmp(pre, str, strlen(pre)) == 0 diff --git a/test/filterprov.c b/test/filterprov.c index 9c4f24f349..5b9cd30668 100644 --- a/test/filterprov.c +++ b/test/filterprov.c @@ -26,7 +26,7 @@ int filter_provider_set_filter(int operation, const char *name); #define MAX_ALG_FILTERS 5 struct filter_prov_globals_st { - OPENSSL_CTX *libctx; + OSSL_LIB_CTX *libctx; OSSL_PROVIDER *deflt; struct { int operation; @@ -40,7 +40,7 @@ static struct filter_prov_globals_st ourglobals; static struct filter_prov_globals_st *get_globals(void) { /* - * Ideally we'd like to store this in the OPENSSL_CTX so that we can have + * Ideally we'd like to store this in the OSSL_LIB_CTX so that we can have * more than one instance of the filter provider at a time. But for now we * just make it simple. */ @@ -97,7 +97,7 @@ static void filter_teardown(void *provctx) struct filter_prov_globals_st *globs = get_globals(); OSSL_PROVIDER_unload(globs->deflt); - OPENSSL_CTX_free(globs->libctx); + OSSL_LIB_CTX_free(globs->libctx); } /* Functions we provide to the core */ @@ -116,7 +116,7 @@ int filter_provider_init(const OSSL_CORE_HANDLE *handle, void **provctx) { memset(&ourglobals, 0, sizeof(ourglobals)); - ourglobals.libctx = OPENSSL_CTX_new(); + ourglobals.libctx = OSSL_LIB_CTX_new(); if (ourglobals.libctx == NULL) goto err; @@ -130,7 +130,7 @@ int filter_provider_init(const OSSL_CORE_HANDLE *handle, err: OSSL_PROVIDER_unload(ourglobals.deflt); - OPENSSL_CTX_free(ourglobals.libctx); + OSSL_LIB_CTX_free(ourglobals.libctx); return 0; } diff --git a/test/keymgmt_internal_test.c b/test/keymgmt_internal_test.c index 1508123c7e..596019d294 100644 --- a/test/keymgmt_internal_test.c +++ b/test/keymgmt_internal_test.c @@ -21,9 +21,9 @@ #include "testutil.h" typedef struct { - OPENSSL_CTX *ctx1; + OSSL_LIB_CTX *ctx1; OSSL_PROVIDER *prov1; - OPENSSL_CTX *ctx2; + OSSL_LIB_CTX *ctx2; OSSL_PROVIDER *prov2; } FIXTURE; @@ -32,8 +32,8 @@ static void tear_down(FIXTURE *fixture) if (fixture != NULL) { OSSL_PROVIDER_unload(fixture->prov1); OSSL_PROVIDER_unload(fixture->prov2); - OPENSSL_CTX_free(fixture->ctx1); - OPENSSL_CTX_free(fixture->ctx2); + OSSL_LIB_CTX_free(fixture->ctx1); + OSSL_LIB_CTX_free(fixture->ctx2); OPENSSL_free(fixture); } } @@ -43,10 +43,10 @@ static FIXTURE *set_up(const char *testcase_name) FIXTURE *fixture; if (!TEST_ptr(fixture = OPENSSL_zalloc(sizeof(*fixture))) - || !TEST_ptr(fixture->ctx1 = OPENSSL_CTX_new()) + || !TEST_ptr(fixture->ctx1 = OSSL_LIB_CTX_new()) || !TEST_ptr(fixture->prov1 = OSSL_PROVIDER_load(fixture->ctx1, "default")) - || !TEST_ptr(fixture->ctx2 = OPENSSL_CTX_new()) + || !TEST_ptr(fixture->ctx2 = OSSL_LIB_CTX_new()) || !TEST_ptr(fixture->prov2 = OSSL_PROVIDER_load(fixture->ctx2, "default"))) { tear_down(fixture); diff --git a/test/property_test.c b/test/property_test.c index 6f8216ef33..ab61d01107 100644 --- a/test/property_test.c +++ b/test/property_test.c @@ -387,9 +387,9 @@ err: static int test_fips_mode(void) { int ret = 0; - OPENSSL_CTX *ctx = NULL; + OSSL_LIB_CTX *ctx = NULL; - if (!TEST_ptr(ctx = OPENSSL_CTX_new())) + if (!TEST_ptr(ctx = OSSL_LIB_CTX_new())) goto err; ret = TEST_true(EVP_set_default_properties(ctx, "default=yes,fips=yes")) @@ -408,7 +408,7 @@ static int test_fips_mode(void) && TEST_true(EVP_default_properties_enable_fips(ctx, 0)) && TEST_false(EVP_default_properties_is_fips_enabled(ctx)); err: - OPENSSL_CTX_free(ctx); + OSSL_LIB_CTX_free(ctx); return ret; } diff --git a/test/provider_fallback_test.c b/test/provider_fallback_test.c index ce62184551..79765d9b65 100644 --- a/test/provider_fallback_test.c +++ b/test/provider_fallback_test.c @@ -12,7 +12,7 @@ #include <openssl/evp.h> #include "testutil.h" -static int test_provider(OPENSSL_CTX *ctx) +static int test_provider(OSSL_LIB_CT |