From d8652be06e2778e8898453a391deb7253e1a35a2 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Thu, 24 Sep 2020 10:42:23 +0100 Subject: Run the withlibctx.pl script Automatically rename all instances of _with_libctx() to _ex() as per our coding style. Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/12970) --- test/acvp_test.c | 16 +++++++--------- test/asynctest.c | 18 +++++++++--------- test/cmp_msg_test.c | 10 +++++----- test/cmp_testlib.c | 2 +- test/cmp_testlib.h | 2 +- test/evp_extra_test.c | 9 ++++----- test/evp_libctx_test.c | 2 +- test/evp_test.c | 31 ++++++++++++++----------------- test/ossl_store_test.c | 5 ++--- test/ssl_test.c | 30 ++++++++++++++---------------- test/ssl_test_ctx.c | 2 +- test/sslapitest.c | 24 ++++++++++++------------ test/ssltest_old.c | 6 +++--- test/ssltestlib.c | 4 ++-- 14 files changed, 76 insertions(+), 85 deletions(-) (limited to 'test') diff --git a/test/acvp_test.c b/test/acvp_test.c index 74e2eace7e..9fa259ec16 100644 --- a/test/acvp_test.c +++ b/test/acvp_test.c @@ -101,9 +101,8 @@ static int sig_gen(EVP_PKEY *pkey, OSSL_PARAM *params, const char *digest_name, if (!TEST_ptr(sig = OPENSSL_malloc(sz)) || !TEST_ptr(md_ctx = EVP_MD_CTX_new()) - || !TEST_int_eq(EVP_DigestSignInit_with_libctx(md_ctx, NULL, - digest_name, libctx, NULL, - pkey), 1) + || !TEST_int_eq(EVP_DigestSignInit_ex(md_ctx, NULL, digest_name, libctx, + NULL, pkey), 1) || !TEST_int_gt(EVP_DigestSign(md_ctx, sig, &sig_len, msg, msg_len), 0)) goto err; *sig_out = sig; @@ -311,9 +310,8 @@ static int ecdsa_sigver_test(int id) ret = TEST_int_gt((sig_len = i2d_ECDSA_SIG(sign, &sig)), 0) && TEST_ptr(md_ctx = EVP_MD_CTX_new()) - && TEST_true(EVP_DigestVerifyInit_with_libctx(md_ctx, NULL, - tst->digest_alg, - libctx, NULL, pkey) + && TEST_true(EVP_DigestVerifyInit_ex(md_ctx, NULL, tst->digest_alg, + libctx, NULL, pkey) && TEST_int_eq(EVP_DigestVerify(md_ctx, sig, sig_len, tst->msg, tst->msg_len), tst->pass)); err: @@ -1254,9 +1252,9 @@ static int rsa_sigver_test(int id) || !TEST_true(rsa_create_pkey(&pkey, tst->n, tst->n_len, tst->e, tst->e_len, NULL, 0, bn_ctx)) || !TEST_ptr(md_ctx = EVP_MD_CTX_new()) - || !TEST_true(EVP_DigestVerifyInit_with_libctx(md_ctx, &pkey_ctx, - tst->digest_alg, - libctx, NULL, pkey) + || !TEST_true(EVP_DigestVerifyInit_ex(md_ctx, &pkey_ctx, + tst->digest_alg, libctx, NULL, + pkey) || !TEST_true(EVP_PKEY_CTX_set_params(pkey_ctx, params)) || !TEST_int_eq(EVP_DigestVerify(md_ctx, tst->sig, tst->sig_len, tst->msg, tst->msg_len), tst->pass))) diff --git a/test/asynctest.c b/test/asynctest.c index d59104226b..a7aab8efde 100644 --- a/test/asynctest.c +++ b/test/asynctest.c @@ -339,7 +339,7 @@ static int test_ASYNC_block_pause(void) return 1; } -static int test_ASYNC_start_job_with_libctx(void) +static int test_ASYNC_start_job_ex(void) { ASYNC_JOB *job = NULL; int funcret; @@ -350,7 +350,7 @@ static int test_ASYNC_start_job_with_libctx(void) if (libctx == NULL) { fprintf(stderr, - "test_ASYNC_start_job_with_libctx() failed to create libctx\n"); + "test_ASYNC_start_job_ex() failed to create libctx\n"); goto err; } @@ -361,7 +361,7 @@ static int test_ASYNC_start_job_with_libctx(void) NULL, 0) != ASYNC_PAUSE) { fprintf(stderr, - "test_ASYNC_start_job_with_libctx() failed to start job\n"); + "test_ASYNC_start_job_ex() failed to start job\n"); goto err; } @@ -370,14 +370,14 @@ static int test_ASYNC_start_job_with_libctx(void) oldctx = OPENSSL_CTX_set0_default(tmpctx); if (tmpctx != libctx) { fprintf(stderr, - "test_ASYNC_start_job_with_libctx() failed - unexpected libctx\n"); + "test_ASYNC_start_job_ex() failed - unexpected libctx\n"); goto err; } if (ASYNC_start_job(&job, waitctx, &funcret, change_deflt_libctx, NULL, 0) != ASYNC_PAUSE) { fprintf(stderr, - "test_ASYNC_start_job_with_libctx() - restarting job failed\n"); + "test_ASYNC_start_job_ex() - restarting job failed\n"); goto err; } @@ -385,7 +385,7 @@ static int test_ASYNC_start_job_with_libctx(void) tmpctx = OPENSSL_CTX_set0_default(oldctx); if (tmpctx != libctx) { fprintf(stderr, - "test_ASYNC_start_job_with_libctx() failed - unexpected libctx\n"); + "test_ASYNC_start_job_ex() failed - unexpected libctx\n"); goto err; } @@ -393,7 +393,7 @@ static int test_ASYNC_start_job_with_libctx(void) != ASYNC_FINISH || funcret != 1) { fprintf(stderr, - "test_ASYNC_start_job_with_libctx() - finishing job failed\n"); + "test_ASYNC_start_job_ex() - finishing job failed\n"); goto err; } @@ -402,7 +402,7 @@ static int test_ASYNC_start_job_with_libctx(void) OPENSSL_CTX_set0_default(tmpctx); if (tmpctx != globalctx) { fprintf(stderr, - "test_ASYNC_start_job_with_libctx() failed - global libctx check failed\n"); + "test_ASYNC_start_job_ex() failed - global libctx check failed\n"); goto err; } @@ -425,7 +425,7 @@ int main(int argc, char **argv) || !test_ASYNC_get_current_job() || !test_ASYNC_WAIT_CTX_get_all_fds() || !test_ASYNC_block_pause() - || !test_ASYNC_start_job_with_libctx()) { + || !test_ASYNC_start_job_ex()) { return 1; } } diff --git a/test/cmp_msg_test.c b/test/cmp_msg_test.c index 3a0db7ece3..6f3b931eaa 100644 --- a/test/cmp_msg_test.c +++ b/test/cmp_msg_test.c @@ -34,7 +34,7 @@ static OPENSSL_CTX *libctx = NULL; static OSSL_PROVIDER *default_null_provider = NULL, *provider = NULL; /* TODO(3.0) Clean this up - See issue #12680 */ -static X509 *X509_dup_with_libctx(const X509 *cert) +static X509 *X509_dup_ex(const X509 *cert) { X509 *dup = X509_dup(cert); @@ -296,7 +296,7 @@ static int test_cmp_create_certconf(void) fixture->fail_info = 0; fixture->expected = 1; if (!TEST_true(ossl_cmp_ctx_set0_newCert(fixture->cmp_ctx, - X509_dup_with_libctx(cert)))) { + X509_dup_ex(cert)))) { tear_down(fixture); fixture = NULL; } @@ -310,7 +310,7 @@ static int test_cmp_create_certconf_badAlg(void) fixture->fail_info = 1 << OSSL_CMP_PKIFAILUREINFO_badAlg; fixture->expected = 1; if (!TEST_true(ossl_cmp_ctx_set0_newCert(fixture->cmp_ctx, - X509_dup_with_libctx(cert)))) { + X509_dup_ex(cert)))) { tear_down(fixture); fixture = NULL; } @@ -324,7 +324,7 @@ static int test_cmp_create_certconf_fail_info_max(void) fixture->fail_info = 1 << OSSL_CMP_PKIFAILUREINFO_MAX; fixture->expected = 1; if (!TEST_true(ossl_cmp_ctx_set0_newCert(fixture->cmp_ctx, - X509_dup_with_libctx(cert)))) { + X509_dup_ex(cert)))) { tear_down(fixture); fixture = NULL; } @@ -405,7 +405,7 @@ static int execute_certrep_create(CMP_MSG_TEST_FIXTURE *fixture) cresp->certifiedKeyPair->certOrEncCert->type = OSSL_CMP_CERTORENCCERT_CERTIFICATE; if ((cresp->certifiedKeyPair->certOrEncCert->value.certificate = - X509_dup_with_libctx(cert)) == NULL + X509_dup_ex(cert)) == NULL || !sk_OSSL_CMP_CERTRESPONSE_push(crepmsg->response, cresp)) goto err; cresp = NULL; diff --git a/test/cmp_testlib.c b/test/cmp_testlib.c index 7a8570afeb..ee6f91a951 100644 --- a/test/cmp_testlib.c +++ b/test/cmp_testlib.c @@ -35,7 +35,7 @@ X509 *load_pem_cert(const char *file, OPENSSL_CTX *libctx) if (!TEST_ptr(bio = BIO_new(BIO_s_file()))) return NULL; if (TEST_int_gt(BIO_read_filename(bio, file), 0) - && TEST_ptr(cert = X509_new_with_libctx(libctx, NULL))) + && TEST_ptr(cert = X509_new_ex(libctx, NULL))) (void)TEST_ptr(cert = PEM_read_bio_X509(bio, &cert, NULL, NULL)); BIO_free(bio); diff --git a/test/cmp_testlib.h b/test/cmp_testlib.h index e8ae7a1834..e6b37a6e3d 100644 --- a/test/cmp_testlib.h +++ b/test/cmp_testlib.h @@ -15,7 +15,7 @@ # include # include # include -# include "crypto/x509.h" /* for x509_set0_libctx() and x509_dup_with_libctx() */ +# include "crypto/x509.h" /* for x509_set0_libctx() and x509_dup_ex() */ # include "../crypto/cmp/cmp_local.h" diff --git a/test/evp_extra_test.c b/test/evp_extra_test.c index 1cc4f94941..872b9d5313 100644 --- a/test/evp_extra_test.c +++ b/test/evp_extra_test.c @@ -1189,7 +1189,7 @@ static int test_set_get_raw_keys_int(int tst, int pub, int uselibctx) inlen = strlen(keys[tst].pub); in = (unsigned char *)keys[tst].pub; if (uselibctx) { - pkey = EVP_PKEY_new_raw_public_key_with_libctx( + pkey = EVP_PKEY_new_raw_public_key_ex( testctx, OBJ_nid2sn(keys[tst].type), NULL, @@ -1205,7 +1205,7 @@ static int test_set_get_raw_keys_int(int tst, int pub, int uselibctx) inlen = strlen(keys[tst].priv); in = (unsigned char *)keys[tst].priv; if (uselibctx) { - pkey = EVP_PKEY_new_raw_private_key_with_libctx( + pkey = EVP_PKEY_new_raw_private_key_ex( testctx, OBJ_nid2sn(keys[tst].type), NULL, in, @@ -1605,9 +1605,8 @@ static int test_EVP_PKEY_CTX_get_set_params(EVP_PKEY *pkey) */ mdctx = EVP_MD_CTX_new(); if (!TEST_ptr(mdctx) - || !TEST_true(EVP_DigestSignInit_with_libctx(mdctx, NULL, - "SHA1", NULL, NULL, - pkey))) + || !TEST_true(EVP_DigestSignInit_ex(mdctx, NULL, "SHA1", NULL, NULL, + pkey))) goto err; /* diff --git a/test/evp_libctx_test.c b/test/evp_libctx_test.c index 4325cc272f..50d463680a 100644 --- a/test/evp_libctx_test.c +++ b/test/evp_libctx_test.c @@ -279,7 +279,7 @@ static int dhx_cert_load(void) }; if (!TEST_ptr(bio = BIO_new_mem_buf(dhx_cert, sizeof(dhx_cert))) - || !TEST_ptr(cert = X509_new_with_libctx(libctx, NULL)) + || !TEST_ptr(cert = X509_new_ex(libctx, NULL)) || !TEST_ptr(d2i_X509_bio(bio, &cert))) goto err; ret = 1; diff --git a/test/evp_test.c b/test/evp_test.c index a146f4726f..d7e40f214e 100644 --- a/test/evp_test.c +++ b/test/evp_test.c @@ -1160,15 +1160,12 @@ static int mac_test_run_pkey(EVP_TEST *t) t->err = "MAC_KEY_CREATE_ERROR"; goto err; } - key = EVP_PKEY_new_CMAC_key_with_libctx(expected->key, - expected->key_len, - EVP_CIPHER_name(cipher), - libctx, NULL); + key = EVP_PKEY_new_CMAC_key_ex(expected->key, expected->key_len, + EVP_CIPHER_name(cipher), libctx, NULL); } else { - key = EVP_PKEY_new_raw_private_key_with_libctx(libctx, - OBJ_nid2sn(expected->type), - NULL, expected->key, - expected->key_len); + key = EVP_PKEY_new_raw_private_key_ex(libctx, + OBJ_nid2sn(expected->type), NULL, + expected->key, expected->key_len); } if (key == NULL) { t->err = "MAC_KEY_CREATE_ERROR"; @@ -1188,7 +1185,7 @@ static int mac_test_run_pkey(EVP_TEST *t) t->err = "INTERNAL_ERROR"; goto err; } - if (!EVP_DigestSignInit_with_libctx(mctx, &pctx, mdname, libctx, NULL, key)) { + if (!EVP_DigestSignInit_ex(mctx, &pctx, mdname, libctx, NULL, key)) { t->err = "DIGESTSIGNINIT_ERROR"; goto err; } @@ -2895,13 +2892,13 @@ static int digestsigver_test_parse(EVP_TEST *t, return 1; } if (mdata->is_verify) { - if (!EVP_DigestVerifyInit_with_libctx(mdata->ctx, &mdata->pctx, - name, libctx, NULL, pkey)) + if (!EVP_DigestVerifyInit_ex(mdata->ctx, &mdata->pctx, name, libctx, + NULL, pkey)) t->err = "DIGESTVERIFYINIT_ERROR"; return 1; } - if (!EVP_DigestSignInit_with_libctx(mdata->ctx, &mdata->pctx, - name, libctx, NULL, pkey)) + if (!EVP_DigestSignInit_ex(mdata->ctx, &mdata->pctx, name, libctx, NULL, + pkey)) t->err = "DIGESTSIGNINIT_ERROR"; return 1; } @@ -3415,11 +3412,11 @@ start: return 0; } if (klist == &private_keys) - pkey = EVP_PKEY_new_raw_private_key_with_libctx(libctx, strnid, NULL, - keybin, keylen); + pkey = EVP_PKEY_new_raw_private_key_ex(libctx, strnid, NULL, keybin, + keylen); else - pkey = EVP_PKEY_new_raw_public_key_with_libctx(libctx, strnid, NULL, - keybin, keylen); + pkey = EVP_PKEY_new_raw_public_key_ex(libctx, strnid, NULL, keybin, + keylen); if (pkey == NULL && !key_unsupported()) { TEST_info("Can't read %s data", pp->key); OPENSSL_free(keybin); diff --git a/test/ossl_store_test.c b/test/ossl_store_test.c index 2ce7d51877..c00e5fd1fb 100644 --- a/test/ossl_store_test.c +++ b/test/ossl_store_test.c @@ -29,9 +29,8 @@ static int test_store_open(void) ret = TEST_ptr(search = OSSL_STORE_SEARCH_by_alias("nothing")) && TEST_ptr(ui_method= UI_create_method("DummyUI")) - && TEST_ptr(sctx = OSSL_STORE_open_with_libctx(infile, NULL, NULL, - ui_method, NULL, - NULL, NULL)) + && TEST_ptr(sctx = OSSL_STORE_open_ex(infile, NULL, NULL, ui_method, + NULL, NULL, NULL)) && TEST_false(OSSL_STORE_find(sctx, NULL)) && TEST_true(OSSL_STORE_find(sctx, search)); UI_destroy_method(ui_method); diff --git a/test/ssl_test.c b/test/ssl_test.c index 1fbe938309..4b7e26b4c1 100644 --- a/test/ssl_test.c +++ b/test/ssl_test.c @@ -408,26 +408,25 @@ static int test_handshake(int idx) #ifndef OPENSSL_NO_DTLS if (test_ctx->method == SSL_TEST_METHOD_DTLS) { - server_ctx = SSL_CTX_new_with_libctx(libctx, NULL, DTLS_server_method()); + server_ctx = SSL_CTX_new_ex(libctx, NULL, DTLS_server_method()); if (!TEST_true(SSL_CTX_set_max_proto_version(server_ctx, 0))) goto err; if (test_ctx->extra.server.servername_callback != SSL_TEST_SERVERNAME_CB_NONE) { if (!TEST_ptr(server2_ctx = - SSL_CTX_new_with_libctx(libctx, NULL, - DTLS_server_method()))) + SSL_CTX_new_ex(libctx, NULL, DTLS_server_method()))) goto err; } - client_ctx = SSL_CTX_new_with_libctx(libctx, NULL, DTLS_client_method()); + client_ctx = SSL_CTX_new_ex(libctx, NULL, DTLS_client_method()); if (!TEST_true(SSL_CTX_set_max_proto_version(client_ctx, 0))) goto err; if (test_ctx->handshake_mode == SSL_TEST_HANDSHAKE_RESUME) { - resume_server_ctx = SSL_CTX_new_with_libctx(libctx, NULL, - DTLS_server_method()); + resume_server_ctx = SSL_CTX_new_ex(libctx, NULL, + DTLS_server_method()); if (!TEST_true(SSL_CTX_set_max_proto_version(resume_server_ctx, 0))) goto err; - resume_client_ctx = SSL_CTX_new_with_libctx(libctx, NULL, - DTLS_client_method()); + resume_client_ctx = SSL_CTX_new_ex(libctx, NULL, + DTLS_client_method()); if (!TEST_true(SSL_CTX_set_max_proto_version(resume_client_ctx, 0))) goto err; if (!TEST_ptr(resume_server_ctx) @@ -437,30 +436,29 @@ static int test_handshake(int idx) } #endif if (test_ctx->method == SSL_TEST_METHOD_TLS) { - server_ctx = SSL_CTX_new_with_libctx(libctx, NULL, TLS_server_method()); + server_ctx = SSL_CTX_new_ex(libctx, NULL, TLS_server_method()); if (!TEST_true(SSL_CTX_set_max_proto_version(server_ctx, 0))) goto err; /* SNI on resumption isn't supported/tested yet. */ if (test_ctx->extra.server.servername_callback != SSL_TEST_SERVERNAME_CB_NONE) { if (!TEST_ptr(server2_ctx = - SSL_CTX_new_with_libctx(libctx, NULL, - TLS_server_method()))) + SSL_CTX_new_ex(libctx, NULL, TLS_server_method()))) goto err; if (!TEST_true(SSL_CTX_set_max_proto_version(server2_ctx, 0))) goto err; } - client_ctx = SSL_CTX_new_with_libctx(libctx, NULL, TLS_client_method()); + client_ctx = SSL_CTX_new_ex(libctx, NULL, TLS_client_method()); if (!TEST_true(SSL_CTX_set_max_proto_version(client_ctx, 0))) goto err; if (test_ctx->handshake_mode == SSL_TEST_HANDSHAKE_RESUME) { - resume_server_ctx = SSL_CTX_new_with_libctx(libctx, NULL, - TLS_server_method()); + resume_server_ctx = SSL_CTX_new_ex(libctx, NULL, + TLS_server_method()); if (!TEST_true(SSL_CTX_set_max_proto_version(resume_server_ctx, 0))) goto err; - resume_client_ctx = SSL_CTX_new_with_libctx(libctx, NULL, - TLS_client_method()); + resume_client_ctx = SSL_CTX_new_ex(libctx, NULL, + TLS_client_method()); if (!TEST_true(SSL_CTX_set_max_proto_version(resume_client_ctx, 0))) goto err; if (!TEST_ptr(resume_server_ctx) diff --git a/test/ssl_test_ctx.c b/test/ssl_test_ctx.c index f440601799..7721b17646 100644 --- a/test/ssl_test_ctx.c +++ b/test/ssl_test_ctx.c @@ -613,7 +613,7 @@ __owur static int parse_expected_ca_names(STACK_OF(X509_NAME) **pnames, if (!strcmp(value, "empty")) *pnames = sk_X509_NAME_new_null(); else - *pnames = SSL_load_client_CA_file_with_libctx(value, libctx, NULL); + *pnames = SSL_load_client_CA_file_ex(value, libctx, NULL); return *pnames != NULL; } __owur static int parse_expected_server_ca_names(SSL_TEST_CTX *test_ctx, diff --git a/test/sslapitest.c b/test/sslapitest.c index 75d3c6fbfc..4331f41549 100644 --- a/test/sslapitest.c +++ b/test/sslapitest.c @@ -797,7 +797,7 @@ static int execute_test_large_message(const SSL_METHOD *smeth, if (!TEST_ptr(certbio = BIO_new_file(cert, "r"))) goto end; - if (!TEST_ptr(chaincert = X509_new_with_libctx(libctx, NULL))) + if (!TEST_ptr(chaincert = X509_new_ex(libctx, NULL))) goto end; if (PEM_read_bio_X509(certbio, &chaincert, NULL, NULL) == NULL) @@ -1546,7 +1546,7 @@ static int test_tlsext_status_type(void) if (!TEST_ptr(certbio = BIO_new_file(cert, "r")) || !TEST_ptr(id = OCSP_RESPID_new()) || !TEST_ptr(ids = sk_OCSP_RESPID_new_null()) - || !TEST_ptr(ocspcert = X509_new_with_libctx(libctx, NULL)) + || !TEST_ptr(ocspcert = X509_new_ex(libctx, NULL)) || !TEST_ptr(PEM_read_bio_X509(certbio, &ocspcert, NULL, NULL)) || !TEST_true(OCSP_RESPID_set_by_key_ex(id, ocspcert, libctx, NULL)) || !TEST_true(sk_OCSP_RESPID_push(ids, id))) @@ -2568,7 +2568,7 @@ static int execute_test_ssl_bio(int pop_ssl, bio_change_t change_bio) SSL *ssl = NULL; int testresult = 0; - if (!TEST_ptr(ctx = SSL_CTX_new_with_libctx(libctx, NULL, TLS_method())) + if (!TEST_ptr(ctx = SSL_CTX_new_ex(libctx, NULL, TLS_method())) || !TEST_ptr(ssl = SSL_new(ctx)) || !TEST_ptr(sslbio = BIO_new(BIO_f_ssl())) || !TEST_ptr(membio1 = BIO_new(BIO_s_mem()))) @@ -5279,7 +5279,7 @@ static int test_serverinfo(int tst) int ret, expected, testresult = 0; SSL_CTX *ctx; - ctx = SSL_CTX_new_with_libctx(libctx, NULL, TLS_method()); + ctx = SSL_CTX_new_ex(libctx, NULL, TLS_method()); if (!TEST_ptr(ctx)) goto end; @@ -5834,7 +5834,7 @@ static int test_max_fragment_len_ext(int idx_tst) int testresult = 0, MFL_mode = 0; BIO *rbio, *wbio; - ctx = SSL_CTX_new_with_libctx(libctx, NULL, TLS_method()); + ctx = SSL_CTX_new_ex(libctx, NULL, TLS_method()); if (!TEST_ptr(ctx)) goto end; @@ -6578,11 +6578,11 @@ static int int_test_ssl_get_shared_ciphers(int tst, int clnt) * having the full set of ciphersuites and once with the server side. */ if (clnt) { - cctx = SSL_CTX_new_with_libctx(tmplibctx, NULL, TLS_client_method()); + cctx = SSL_CTX_new_ex(tmplibctx, NULL, TLS_client_method()); if (!TEST_ptr(cctx)) goto end; } else { - sctx = SSL_CTX_new_with_libctx(tmplibctx, NULL, TLS_server_method()); + sctx = SSL_CTX_new_ex(tmplibctx, NULL, TLS_server_method()); if (!TEST_ptr(sctx)) goto end; } @@ -7188,7 +7188,7 @@ static int cert_cb(SSL *s, void *arg) goto out; if (!TEST_ptr(in = BIO_new(BIO_s_file())) || !TEST_int_ge(BIO_read_filename(in, rootfile), 0) - || !TEST_ptr(rootx = X509_new_with_libctx(libctx, NULL)) + || !TEST_ptr(rootx = X509_new_ex(libctx, NULL)) || !TEST_ptr(PEM_read_bio_X509(in, &rootx, NULL, NULL)) || !TEST_true(sk_X509_push(chain, rootx))) goto out; @@ -7196,7 +7196,7 @@ static int cert_cb(SSL *s, void *arg) BIO_free(in); if (!TEST_ptr(in = BIO_new(BIO_s_file())) || !TEST_int_ge(BIO_read_filename(in, ecdsacert), 0) - || !TEST_ptr(x509 = X509_new_with_libctx(libctx, NULL)) + || !TEST_ptr(x509 = X509_new_ex(libctx, NULL)) || !TEST_ptr(PEM_read_bio_X509(in, &x509, NULL, NULL))) goto out; BIO_free(in); @@ -7346,7 +7346,7 @@ static int client_cert_cb(SSL *ssl, X509 **x509, EVP_PKEY **pkey) if (!TEST_ptr(in)) return 0; - if (!TEST_ptr(xcert = X509_new_with_libctx(libctx, NULL)) + if (!TEST_ptr(xcert = X509_new_ex(libctx, NULL)) || !TEST_ptr(PEM_read_bio_X509(in, &xcert, NULL, NULL)) || !TEST_ptr(priv_in = BIO_new_file(privkey, "r")) || !TEST_ptr(privpkey = PEM_read_bio_PrivateKey_ex(priv_in, NULL, @@ -7865,8 +7865,8 @@ static int test_sigalgs_available(int idx) serverctx = tmpctx; } - cctx = SSL_CTX_new_with_libctx(clientctx, NULL, TLS_client_method()); - sctx = SSL_CTX_new_with_libctx(serverctx, NULL, TLS_server_method()); + cctx = SSL_CTX_new_ex(clientctx, NULL, TLS_client_method()); + sctx = SSL_CTX_new_ex(serverctx, NULL, TLS_server_method()); if (!TEST_ptr(cctx) || !TEST_ptr(sctx)) goto end; diff --git a/test/ssltest_old.c b/test/ssltest_old.c index d1733912bc..875e6eac13 100644 --- a/test/ssltest_old.c +++ b/test/ssltest_old.c @@ -1380,9 +1380,9 @@ int main(int argc, char *argv[]) goto end; } - c_ctx = SSL_CTX_new_with_libctx(libctx, NULL, meth); - s_ctx = SSL_CTX_new_with_libctx(libctx, NULL, meth); - s_ctx2 = SSL_CTX_new_with_libctx(libctx, NULL, meth); /* no SSL_CTX_dup! */ + c_ctx = SSL_CTX_new_ex(libctx, NULL, meth); + s_ctx = SSL_CTX_new_ex(libctx, NULL, meth); + s_ctx2 = SSL_CTX_new_ex(libctx, NULL, meth); /* no SSL_CTX_dup! */ if ((c_ctx == NULL) || (s_ctx == NULL) || (s_ctx2 == NULL)) { ERR_print_errors(bio_err); goto end; diff --git a/test/ssltestlib.c b/test/ssltestlib.c index 96c1a7f2de..b2baa9fa43 100644 --- a/test/ssltestlib.c +++ b/test/ssltestlib.c @@ -695,13 +695,13 @@ const SSL_METHOD *cm, if (*sctx != NULL) serverctx = *sctx; - else if (!TEST_ptr(serverctx = SSL_CTX_new_with_libctx(libctx, NULL, sm))) + else if (!TEST_ptr(serverctx = SSL_CTX_new_ex(libctx, NULL, sm))) goto err; if (cctx != NULL) { if (*cctx != NULL) clientctx = *cctx; - else if (!TEST_ptr(clientctx = SSL_CTX_new_with_libctx(libctx, NULL, cm))) + else if (!TEST_ptr(clientctx = SSL_CTX_new_ex(libctx, NULL, cm))) goto err; } -- cgit v1.2.3