diff options
author | Tomas Mraz <tomas@openssl.org> | 2021-05-21 16:58:08 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2021-06-01 12:40:00 +0200 |
commit | ed576acdf591d4164905ab98e89ca5a3b99d90ab (patch) | |
tree | c0f36ca1b3d42f34c0c502e700ad09b69b713d3c /test | |
parent | Pass library context and property query into private key decoders (diff) | |
download | openssl-ed576acdf591d4164905ab98e89ca5a3b99d90ab.tar.xz openssl-ed576acdf591d4164905ab98e89ca5a3b99d90ab.zip |
Rename all getters to use get/get0 in name
For functions that exist in 1.1.1 provide a simple aliases via #define.
Fixes #15236
Functions with OSSL_DECODER_, OSSL_ENCODER_, OSSL_STORE_LOADER_,
EVP_KEYEXCH_, EVP_KEM_, EVP_ASYM_CIPHER_, EVP_SIGNATURE_,
EVP_KEYMGMT_, EVP_RAND_, EVP_MAC_, EVP_KDF_, EVP_PKEY_,
EVP_MD_, and EVP_CIPHER_ prefixes are renamed.
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15405)
Diffstat (limited to 'test')
-rw-r--r-- | test/acvp_test.c | 2 | ||||
-rw-r--r-- | test/aesgcmtest.c | 4 | ||||
-rw-r--r-- | test/bad_dtls_test.c | 2 | ||||
-rw-r--r-- | test/defltfips_test.c | 3 | ||||
-rw-r--r-- | test/drbgtest.c | 2 | ||||
-rw-r--r-- | test/ecdsatest.c | 2 | ||||
-rw-r--r-- | test/endecoder_legacy_test.c | 2 | ||||
-rw-r--r-- | test/enginetest.c | 2 | ||||
-rw-r--r-- | test/evp_extra_test.c | 14 | ||||
-rw-r--r-- | test/evp_extra_test2.c | 2 | ||||
-rw-r--r-- | test/evp_fetch_prov_test.c | 4 | ||||
-rw-r--r-- | test/evp_kdf_test.c | 4 | ||||
-rw-r--r-- | test/evp_libctx_test.c | 18 | ||||
-rw-r--r-- | test/evp_pkey_provided_test.c | 36 | ||||
-rw-r--r-- | test/evp_test.c | 41 | ||||
-rw-r--r-- | test/helpers/handshake.c | 2 | ||||
-rw-r--r-- | test/provider_fallback_test.c | 2 | ||||
-rw-r--r-- | test/provider_internal_test.c | 2 | ||||
-rw-r--r-- | test/ssl_old_test.c | 6 | ||||
-rw-r--r-- | test/sslapitest.c | 2 | ||||
-rw-r--r-- | test/tls13encryptiontest.c | 2 | ||||
-rw-r--r-- | test/tls13secretstest.c | 2 |
22 files changed, 79 insertions, 77 deletions
diff --git a/test/acvp_test.c b/test/acvp_test.c index 84009193c2..05a328a6ad 100644 --- a/test/acvp_test.c +++ b/test/acvp_test.c @@ -92,7 +92,7 @@ static int sig_gen(EVP_PKEY *pkey, OSSL_PARAM *params, const char *digest_name, EVP_MD_CTX *md_ctx = NULL; unsigned char *sig = NULL; size_t sig_len; - size_t sz = EVP_PKEY_size(pkey); + size_t sz = EVP_PKEY_get_size(pkey); if (!TEST_ptr(sig = OPENSSL_malloc(sz)) || !TEST_ptr(md_ctx = EVP_MD_CTX_new()) diff --git a/test/aesgcmtest.c b/test/aesgcmtest.c index 1dc3aa86be..c371f4754e 100644 --- a/test/aesgcmtest.c +++ b/test/aesgcmtest.c @@ -54,7 +54,7 @@ static int do_encrypt(unsigned char *iv_gen, unsigned char *ct, int *ct_len, && TEST_true(EVP_EncryptUpdate(ctx, ct, ct_len, gcm_pt, sizeof(gcm_pt)) > 0) && TEST_true(EVP_EncryptFinal_ex(ctx, outbuf, &outlen) > 0) - && TEST_int_eq(EVP_CIPHER_CTX_tag_length(ctx), 16) + && TEST_int_eq(EVP_CIPHER_CTX_get_tag_length(ctx), 16) && TEST_true(EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_GET_TAG, 16, tag) > 0) && TEST_true(iv_gen == NULL @@ -76,7 +76,7 @@ static int do_decrypt(const unsigned char *iv, const unsigned char *ct, && TEST_true(EVP_DecryptInit_ex(ctx, EVP_aes_256_gcm(), NULL, NULL, NULL) > 0) && TEST_true(EVP_DecryptInit_ex(ctx, NULL, NULL, gcm_key, iv) > 0) - && TEST_int_eq(EVP_CIPHER_CTX_tag_length(ctx), 16) + && TEST_int_eq(EVP_CIPHER_CTX_get_tag_length(ctx), 16) && TEST_true(EVP_DecryptUpdate(ctx, NULL, &outlen, gcm_aad, sizeof(gcm_aad)) > 0) && TEST_true(EVP_DecryptUpdate(ctx, pt, &ptlen, ct, diff --git a/test/bad_dtls_test.c b/test/bad_dtls_test.c index a67db1737e..f8c6b142d8 100644 --- a/test/bad_dtls_test.c +++ b/test/bad_dtls_test.c @@ -382,7 +382,7 @@ static int send_finished(SSL *s, BIO *rbio) return 0; do_PRF(TLS_MD_SERVER_FINISH_CONST, TLS_MD_SERVER_FINISH_CONST_SIZE, - handshake_hash, EVP_MD_CTX_size(handshake_md), + handshake_hash, EVP_MD_CTX_get_size(handshake_md), NULL, 0, finished_msg + DTLS1_HM_HEADER_LENGTH, TLS1_FINISH_MAC_LENGTH); diff --git a/test/defltfips_test.c b/test/defltfips_test.c index a8349211b6..a2325a19fc 100644 --- a/test/defltfips_test.c +++ b/test/defltfips_test.c @@ -36,7 +36,8 @@ static int test_is_fips_enabled(void) if (!TEST_ptr(sha256)) return 0; if (is_fips - && !TEST_str_eq(OSSL_PROVIDER_name(EVP_MD_provider(sha256)), "fips")) { + && !TEST_str_eq(OSSL_PROVIDER_name(EVP_MD_get0_provider(sha256)), + "fips")) { EVP_MD_free(sha256); return 0; } diff --git a/test/drbgtest.c b/test/drbgtest.c index ad5266ce3e..a6fd46595a 100644 --- a/test/drbgtest.c +++ b/test/drbgtest.c @@ -81,7 +81,7 @@ static int rand_priv_bytes(unsigned char *buf, int num) */ static int state(EVP_RAND_CTX *drbg) { - return EVP_RAND_state(drbg); + return EVP_RAND_get_state(drbg); } static unsigned int query_rand_uint(EVP_RAND_CTX *drbg, const char *name) diff --git a/test/ecdsatest.c b/test/ecdsatest.c index 66ab2bc930..c94d7d8dab 100644 --- a/test/ecdsatest.c +++ b/test/ecdsatest.c @@ -179,7 +179,7 @@ static int set_sm2_id(EVP_MD_CTX *mctx, EVP_PKEY *pkey) static const char sm2_id[] = { 1, 2, 3, 4, 'l', 'e', 't', 't', 'e', 'r' }; EVP_PKEY_CTX *pctx; - if (!TEST_ptr(pctx = EVP_MD_CTX_pkey_ctx(mctx)) + if (!TEST_ptr(pctx = EVP_MD_CTX_get_pkey_ctx(mctx)) || !TEST_int_gt(EVP_PKEY_CTX_set1_id(pctx, sm2_id, sizeof(sm2_id)), 0)) return 0; return 1; diff --git a/test/endecoder_legacy_test.c b/test/endecoder_legacy_test.c index b3bd4f5872..121e2de3d4 100644 --- a/test/endecoder_legacy_test.c +++ b/test/endecoder_legacy_test.c @@ -518,7 +518,7 @@ static int test_key(int idx) if (!TEST_ptr(pkey = key->key) || !TEST_true(evp_pkey_copy_downgraded(&downgraded_pkey, pkey)) || !TEST_ptr(downgraded_pkey) - || !TEST_int_eq(EVP_PKEY_id(downgraded_pkey), key->evp_type) + || !TEST_int_eq(EVP_PKEY_get_id(downgraded_pkey), key->evp_type) || !TEST_ptr(legacy_obj = EVP_PKEY_get0(downgraded_pkey))) goto end; diff --git a/test/enginetest.c b/test/enginetest.c index 67e4941cdf..64d31acadb 100644 --- a/test/enginetest.c +++ b/test/enginetest.c @@ -260,7 +260,7 @@ static int test_redirect(void) if (!TEST_ptr(pkey = get_test_pkey())) goto err; - len = EVP_PKEY_size(pkey); + len = EVP_PKEY_get_size(pkey); if (!TEST_ptr(tmp = OPENSSL_malloc(len))) goto err; diff --git a/test/evp_extra_test.c b/test/evp_extra_test.c index 10ab4bfc9e..f91784b3a9 100644 --- a/test/evp_extra_test.c +++ b/test/evp_extra_test.c @@ -844,7 +844,7 @@ static int test_EVP_Enveloped(int n) goto err; if (!TEST_ptr(keypair = load_example_rsa_key()) - || !TEST_ptr(kek = OPENSSL_zalloc(EVP_PKEY_size(keypair))) + || !TEST_ptr(kek = OPENSSL_zalloc(EVP_PKEY_get_size(keypair))) || !TEST_ptr(ctx = EVP_CIPHER_CTX_new()) || !TEST_true(EVP_SealInit(ctx, type, &kek, &kek_len, iv, &keypair, 1)) @@ -1088,7 +1088,7 @@ static int test_d2i_AutoPrivateKey(int i) p = input; if (!TEST_ptr(pkey = d2i_AutoPrivateKey(NULL, &p, input_len)) || !TEST_ptr_eq(p, input + input_len) - || !TEST_int_eq(EVP_PKEY_id(pkey), expected_id)) + || !TEST_int_eq(EVP_PKEY_get_id(pkey), expected_id)) goto done; ret = 1; @@ -1734,7 +1734,7 @@ static int test_EVP_PKEY_check(int i) if (!TEST_ptr(pkey = load_example_key(ak->keytype, input, input_len))) goto done; if (type == 0 - && !TEST_int_eq(EVP_PKEY_id(pkey), expected_id)) + && !TEST_int_eq(EVP_PKEY_get_id(pkey), expected_id)) goto done; if (!TEST_ptr(ctx = EVP_PKEY_CTX_new_from_pkey(testctx, pkey, testpropq))) @@ -2334,11 +2334,11 @@ static int test_EVP_PKEY_set1_DH(void) goto err; if(!TEST_true(EVP_PKEY_set1_DH(pkey1, x942dh)) - || !TEST_int_eq(EVP_PKEY_id(pkey1), EVP_PKEY_DHX)) + || !TEST_int_eq(EVP_PKEY_get_id(pkey1), EVP_PKEY_DHX)) goto err; if(!TEST_true(EVP_PKEY_set1_DH(pkey2, noqdh)) - || !TEST_int_eq(EVP_PKEY_id(pkey2), EVP_PKEY_DH)) + || !TEST_int_eq(EVP_PKEY_get_id(pkey2), EVP_PKEY_DH)) goto err; ret = 1; @@ -2616,7 +2616,7 @@ static int test_evp_iv_aes(int idx) || !TEST_true(EVP_CIPHER_CTX_get_updated_iv(ctx, iv, sizeof(iv))) || !TEST_true(EVP_EncryptFinal_ex(ctx, ciphertext, &len))) goto err; - ivlen = EVP_CIPHER_CTX_iv_length(ctx); + ivlen = EVP_CIPHER_CTX_get_iv_length(ctx); if (!TEST_mem_eq(init_iv, ivlen, oiv, ivlen) || !TEST_mem_eq(ref_iv, ref_len, iv, ivlen)) goto err; @@ -2727,7 +2727,7 @@ static int test_evp_iv_des(int idx) || !TEST_true(EVP_CIPHER_CTX_get_updated_iv(ctx, iv, sizeof(iv))) || !TEST_true(EVP_EncryptFinal_ex(ctx, ciphertext, &len))) goto err; - ivlen = EVP_CIPHER_CTX_iv_length(ctx); + ivlen = EVP_CIPHER_CTX_get_iv_length(ctx); if (!TEST_mem_eq(init_iv, ivlen, oiv, ivlen) || !TEST_mem_eq(ref_iv, ref_len, iv, ivlen)) goto err; diff --git a/test/evp_extra_test2.c b/test/evp_extra_test2.c index e480ae9555..d932b73dd7 100644 --- a/test/evp_extra_test2.c +++ b/test/evp_extra_test2.c @@ -275,7 +275,7 @@ static int test_d2i_AutoPrivateKey_ex(int i) if (!TEST_ptr(pkey = d2i_AutoPrivateKey_ex(NULL, &p, input_len, mainctx, NULL)) || !TEST_ptr_eq(p, input + input_len) - || !TEST_int_eq(EVP_PKEY_id(pkey), expected_id)) + || !TEST_int_eq(EVP_PKEY_get_id(pkey), expected_id)) goto done; if (ak->evptype == EVP_PKEY_RSA) { diff --git a/test/evp_fetch_prov_test.c b/test/evp_fetch_prov_test.c index 07cf79d8ae..fc10bdad57 100644 --- a/test/evp_fetch_prov_test.c +++ b/test/evp_fetch_prov_test.c @@ -149,8 +149,8 @@ static int test_md(const EVP_MD *md) return TEST_ptr(md) && TEST_true(EVP_MD_is_a(md, "SHA256")) && TEST_true(calculate_digest(md, testmsg, sizeof(testmsg), exptd)) - && TEST_int_eq(EVP_MD_size(md), SHA256_DIGEST_LENGTH) - && TEST_int_eq(EVP_MD_block_size(md), SHA256_CBLOCK); + && TEST_int_eq(EVP_MD_get_size(md), SHA256_DIGEST_LENGTH) + && TEST_int_eq(EVP_MD_get_block_size(md), SHA256_CBLOCK); } static int test_implicit_EVP_MD_fetch(void) diff --git a/test/evp_kdf_test.c b/test/evp_kdf_test.c index ed7407255a..94d2b0ac58 100644 --- a/test/evp_kdf_test.c +++ b/test/evp_kdf_test.c @@ -1352,8 +1352,8 @@ static int test_kdfs_same( EVP_KDF *kdf1, EVP_KDF *kdf2) * because without the algorithm in the cache, fetching it a second time * will result in a different pointer. */ - return TEST_ptr_eq(EVP_KDF_provider(kdf1), EVP_KDF_provider(kdf2)) - && TEST_str_eq(EVP_KDF_name(kdf1), EVP_KDF_name(kdf2)); + return TEST_ptr_eq(EVP_KDF_get0_provider(kdf1), EVP_KDF_get0_provider(kdf2)) + && TEST_str_eq(EVP_KDF_get0_name(kdf1), EVP_KDF_get0_name(kdf2)); } static int test_kdf_get_kdf(void) diff --git a/test/evp_libctx_test.c b/test/evp_libctx_test.c index f51de88c55..b9794b6b7d 100644 --- a/test/evp_libctx_test.c +++ b/test/evp_libctx_test.c @@ -349,10 +349,10 @@ static int test_cipher_reinit(int test_id) goto err; /* ccm fails on the second update - this matches OpenSSL 1_1_1 behaviour */ - ccm = (EVP_CIPHER_mode(cipher) == EVP_CIPH_CCM_MODE); + ccm = (EVP_CIPHER_get_mode(cipher) == EVP_CIPH_CCM_MODE); /* siv cannot be called with NULL key as the iv is irrelevant */ - siv = (EVP_CIPHER_mode(cipher) == EVP_CIPH_SIV_MODE); + siv = (EVP_CIPHER_get_mode(cipher) == EVP_CIPH_SIV_MODE); /* * Skip init call with a null key for RC4 as the stream cipher does not @@ -439,14 +439,14 @@ static int test_cipher_reinit_partialupdate(int test_id) if (!TEST_ptr(cipher = EVP_CIPHER_fetch(libctx, name, NULL))) goto err; - in_len = EVP_CIPHER_block_size(cipher) / 2; + in_len = EVP_CIPHER_get_block_size(cipher) / 2; /* skip any ciphers that don't allow partial updates */ - if (((EVP_CIPHER_flags(cipher) + if (((EVP_CIPHER_get_flags(cipher) & (EVP_CIPH_FLAG_CTS | EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK)) != 0) - || EVP_CIPHER_mode(cipher) == EVP_CIPH_CCM_MODE - || EVP_CIPHER_mode(cipher) == EVP_CIPH_XTS_MODE - || EVP_CIPHER_mode(cipher) == EVP_CIPH_WRAP_MODE) { + || EVP_CIPHER_get_mode(cipher) == EVP_CIPH_CCM_MODE + || EVP_CIPHER_get_mode(cipher) == EVP_CIPH_XTS_MODE + || EVP_CIPHER_get_mode(cipher) == EVP_CIPH_WRAP_MODE) { ret = 1; goto err; } @@ -460,7 +460,7 @@ static int test_cipher_reinit_partialupdate(int test_id) if (!TEST_mem_eq(out1, out1_len, out2, out2_len)) goto err; - if (EVP_CIPHER_mode(cipher) != EVP_CIPH_SIV_MODE) { + if (EVP_CIPHER_get_mode(cipher) != EVP_CIPH_SIV_MODE) { if (!TEST_true(EVP_EncryptInit_ex(ctx, NULL, NULL, NULL, iv)) || !TEST_true(EVP_EncryptUpdate(ctx, out3, &out3_len, in, in_len))) goto err; @@ -484,7 +484,7 @@ static int name_cmp(const char * const *a, const char * const *b) static void collect_cipher_names(EVP_CIPHER *cipher, void *cipher_names_list) { STACK_OF(OPENSSL_STRING) *names = cipher_names_list; - const char *name = EVP_CIPHER_name(cipher); + const char *name = EVP_CIPHER_get0_name(cipher); char *namedup = NULL; assert(name != NULL); diff --git a/test/evp_pkey_provided_test.c b/test/evp_pkey_provided_test.c index 681a8e5846..92b3614f6e 100644 --- a/test/evp_pkey_provided_test.c +++ b/test/evp_pkey_provided_test.c @@ -346,9 +346,9 @@ static int test_fromdata_rsa(void) while (dup_pk == NULL) { ret = 0; - if (!TEST_int_eq(EVP_PKEY_bits(pk), 32) - || !TEST_int_eq(EVP_PKEY_security_bits(pk), 8) - || !TEST_int_eq(EVP_PKEY_size(pk), 4) + if (!TEST_int_eq(EVP_PKEY_get_bits(pk), 32) + || !TEST_int_eq(EVP_PKEY_get_security_bits(pk), 8) + || !TEST_int_eq(EVP_PKEY_get_size(pk), 4) || !TEST_false(EVP_PKEY_missing_parameters(pk))) goto err; @@ -528,9 +528,9 @@ static int test_fromdata_dh_named_group(void) while (dup_pk == NULL) { ret = 0; - if (!TEST_int_eq(EVP_PKEY_bits(pk), 2048) - || !TEST_int_eq(EVP_PKEY_security_bits(pk), 112) - || !TEST_int_eq(EVP_PKEY_size(pk), 256) + if (!TEST_int_eq(EVP_PKEY_get_bits(pk), 2048) + || !TEST_int_eq(EVP_PKEY_get_security_bits(pk), 112) + || !TEST_int_eq(EVP_PKEY_get_size(pk), 256) || !TEST_false(EVP_PKEY_missing_parameters(pk))) goto err; @@ -709,9 +709,9 @@ static int test_fromdata_dh_fips186_4(void) while (dup_pk == NULL) { ret = 0; - if (!TEST_int_eq(EVP_PKEY_bits(pk), 2048) - || !TEST_int_eq(EVP_PKEY_security_bits(pk), 112) - || !TEST_int_eq(EVP_PKEY_size(pk), 256) + if (!TEST_int_eq(EVP_PKEY_get_bits(pk), 2048) + || !TEST_int_eq(EVP_PKEY_get_security_bits(pk), 112) + || !TEST_int_eq(EVP_PKEY_get_size(pk), 256) || !TEST_false(EVP_PKEY_missing_parameters(pk))) goto err; @@ -1016,9 +1016,9 @@ static int test_fromdata_ecx(int tst) while (dup_pk == NULL) { ret = 0; - if (!TEST_int_eq(EVP_PKEY_bits(pk), bits) - || !TEST_int_eq(EVP_PKEY_security_bits(pk), security_bits) - || !TEST_int_eq(EVP_PKEY_size(pk), size) + if (!TEST_int_eq(EVP_PKEY_get_bits(pk), bits) + || !TEST_int_eq(EVP_PKEY_get_security_bits(pk), security_bits) + || !TEST_int_eq(EVP_PKEY_get_size(pk), size) || !TEST_false(EVP_PKEY_missing_parameters(pk))) goto err; @@ -1154,9 +1154,9 @@ static int test_fromdata_ec(void) while (dup_pk == NULL) { ret = 0; - if (!TEST_int_eq(EVP_PKEY_bits(pk), 256) - || !TEST_int_eq(EVP_PKEY_security_bits(pk), 128) - || !TEST_int_eq(EVP_PKEY_size(pk), 2 + 35 * 2) + if (!TEST_int_eq(EVP_PKEY_get_bits(pk), 256) + || !TEST_int_eq(EVP_PKEY_get_security_bits(pk), 128) + || !TEST_int_eq(EVP_PKEY_get_size(pk), 2 + 35 * 2) || !TEST_false(EVP_PKEY_missing_parameters(pk))) goto err; @@ -1459,9 +1459,9 @@ static int test_fromdata_dsa_fips186_4(void) while (dup_pk == NULL) { ret = 0; - if (!TEST_int_eq(EVP_PKEY_bits(pk), 2048) - || !TEST_int_eq(EVP_PKEY_security_bits(pk), 112) - || !TEST_int_eq(EVP_PKEY_size(pk), 2 + 2 * (3 + sizeof(q_data))) + if (!TEST_int_eq(EVP_PKEY_get_bits(pk), 2048) + || !TEST_int_eq(EVP_PKEY_get_security_bits(pk), 112) + || !TEST_int_eq(EVP_PKEY_get_size(pk), 2 + 2 * (3 + sizeof(q_data))) || !TEST_false(EVP_PKEY_missing_parameters(pk))) goto err; diff --git a/test/evp_test.c b/test/evp_test.c index bf4777eb56..059de1251f 100644 --- a/test/evp_test.c +++ b/test/evp_test.c @@ -431,7 +431,7 @@ static int digest_test_run(EVP_TEST *t) goto err; } - if (EVP_MD_flags(expected->digest) & EVP_MD_FLAG_XOF) { + if (EVP_MD_get_flags(expected->digest) & EVP_MD_FLAG_XOF) { EVP_MD_CTX *mctx_cpy; char dont[] = "touch"; @@ -541,13 +541,13 @@ static int cipher_test_init(EVP_TEST *t, const char *alg) cdat->cipher = cipher; cdat->fetched_cipher = fetched_cipher; cdat->enc = -1; - m = EVP_CIPHER_mode(cipher); + m = EVP_CIPHER_get_mode(cipher); if (m == EVP_CIPH_GCM_MODE || m == EVP_CIPH_OCB_MODE || m == EVP_CIPH_SIV_MODE || m == EVP_CIPH_CCM_MODE) cdat->aead = m; - else if (EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER) + else if (EVP_CIPHER_get_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER) cdat->aead = -1; else cdat->aead = 0; @@ -714,7 +714,7 @@ static int cipher_test_enc(EVP_TEST *t, int enc, t->err = "INVALID_IV_LENGTH"; goto err; } - } else if (expected->iv_len != (size_t)EVP_CIPHER_CTX_iv_length(ctx_base)) { + } else if (expected->iv_len != (size_t)EVP_CIPHER_CTX_get_iv_length(ctx_base)) { t->err = "INVALID_IV_LENGTH"; goto err; } @@ -770,9 +770,9 @@ static int cipher_test_enc(EVP_TEST *t, int enc, /* Some (e.g., GCM) tests use IVs longer than EVP_MAX_IV_LENGTH. */ unsigned char iv[128]; if (!TEST_true(EVP_CIPHER_CTX_get_updated_iv(ctx_base, iv, sizeof(iv))) - || ((EVP_CIPHER_flags(expected->cipher) & EVP_CIPH_CUSTOM_IV) == 0 - && !TEST_mem_eq(expected->iv, expected->iv_len, iv, - expected->iv_len))) { + || ((EVP_CIPHER_get_flags(expected->cipher) & EVP_CIPH_CUSTOM_IV) == 0 + && !TEST_mem_eq(expected->iv, expected->iv_len, iv, + expected->iv_len))) { t->err = "INVALID_IV"; goto err; } @@ -894,9 +894,9 @@ static int cipher_test_enc(EVP_TEST *t, int enc, /* Some (e.g., GCM) tests use IVs longer than EVP_MAX_IV_LENGTH. */ unsigned char iv[128]; if (!TEST_true(EVP_CIPHER_CTX_get_updated_iv(ctx, iv, sizeof(iv))) - || ((EVP_CIPHER_flags(expected->cipher) & EVP_CIPH_CUSTOM_IV) == 0 - && !TEST_mem_eq(expected->next_iv, expected->iv_len, iv, - expected->iv_len))) { + || ((EVP_CIPHER_get_flags(expected->cipher) & EVP_CIPH_CUSTOM_IV) == 0 + && !TEST_mem_eq(expected->next_iv, expected->iv_len, iv, + expected->iv_len))) { t->err = "INVALID_NEXT_IV"; goto err; } @@ -922,9 +922,9 @@ static int cipher_test_run(EVP_TEST *t) t->err = "NO_KEY"; return 0; } - if (!cdat->iv && EVP_CIPHER_iv_length(cdat->cipher)) { + if (!cdat->iv && EVP_CIPHER_get_iv_length(cdat->cipher)) { /* IV is optional and usually omitted in wrap mode */ - if (EVP_CIPHER_mode(cdat->cipher) != EVP_CIPH_WRAP_MODE) { + if (EVP_CIPHER_get_mode(cdat->cipher) != EVP_CIPH_WRAP_MODE) { t->err = "NO_IV"; return 0; } @@ -976,10 +976,10 @@ static int cipher_test_run(EVP_TEST *t) * lengths so we don't fragment for those */ if (cdat->aead == EVP_CIPH_CCM_MODE - || ((EVP_CIPHER_flags(cdat->cipher) & EVP_CIPH_FLAG_CTS) != 0) - || EVP_CIPHER_mode(cdat->cipher) == EVP_CIPH_SIV_MODE - || EVP_CIPHER_mode(cdat->cipher) == EVP_CIPH_XTS_MODE - || EVP_CIPHER_mode(cdat->cipher) == EVP_CIPH_WRAP_MODE) + || ((EVP_CIPHER_get_flags(cdat->cipher) & EVP_CIPH_FLAG_CTS) != 0) + || EVP_CIPHER_get_mode(cdat->cipher) == EVP_CIPH_SIV_MODE + || EVP_CIPHER_get_mode(cdat->cipher) == EVP_CIPH_XTS_MODE + || EVP_CIPHER_get_mode(cdat->cipher) == EVP_CIPH_WRAP_MODE) break; out_misalign = 0; frag++; @@ -1959,7 +1959,8 @@ static int pbe_test_run(EVP_TEST *t) } #endif } else if (expected->pbe_type == PBE_TYPE_PKCS12) { - fetched_digest = EVP_MD_fetch(libctx, EVP_MD_name(expected->md), NULL); + fetched_digest = EVP_MD_fetch(libctx, EVP_MD_get0_name(expected->md), + NULL); if (fetched_digest == NULL) { t->err = "PKCS12_ERROR"; goto err; @@ -2332,7 +2333,7 @@ static int rand_test_run(EVP_TEST *t) if (!TEST_true(EVP_RAND_CTX_set_params(expected->ctx, params))) goto err; - strength = EVP_RAND_strength(expected->ctx); + strength = EVP_RAND_get_strength(expected->ctx); for (i = 0; i <= expected->n; i++) { item = expected->data + i; @@ -2401,7 +2402,7 @@ static int rand_test_run(EVP_TEST *t) if (!TEST_true(EVP_RAND_uninstantiate(expected->ctx)) || !TEST_true(EVP_RAND_uninstantiate(expected->parent)) || !TEST_true(EVP_RAND_verify_zeroization(expected->ctx)) - || !TEST_int_eq(EVP_RAND_state(expected->ctx), + || !TEST_int_eq(EVP_RAND_get_state(expected->ctx), EVP_RAND_STATE_UNINITIALISED)) goto err; } @@ -2971,7 +2972,7 @@ static int digestsigver_test_parse(EVP_TEST *t, if (strcmp(keyword, "Key") == 0) { EVP_PKEY *pkey = NULL; int rv = 0; - const char *name = mdata->md == NULL ? NULL : EVP_MD_name(mdata->md); + const char *name = mdata->md == NULL ? NULL : EVP_MD_get0_name(mdata->md); if (mdata->is_verify) rv = find_key(&pkey, value, public_keys); diff --git a/test/helpers/handshake.c b/test/helpers/handshake.c index bba78f6d79..97255306da 100644 --- a/test/helpers/handshake.c +++ b/test/helpers/handshake.c @@ -1240,7 +1240,7 @@ static int pkey_type(EVP_PKEY *pkey) return NID_undef; return OBJ_txt2nid(name); } - return EVP_PKEY_id(pkey); + return EVP_PKEY_get_id(pkey); } static int peer_pkey_type(SSL *s) diff --git a/test/provider_fallback_test.c b/test/provider_fallback_test.c index 79765d9b65..0e38bd8605 100644 --- a/test/provider_fallback_test.c +++ b/test/provider_fallback_test.c @@ -20,7 +20,7 @@ static int test_provider(OSSL_LIB_CTX *ctx) ok = TEST_true(OSSL_PROVIDER_available(ctx, "default")) && TEST_ptr(rsameth = EVP_KEYMGMT_fetch(ctx, "RSA", NULL)) - && TEST_ptr(prov = EVP_KEYMGMT_provider(rsameth)) + && TEST_ptr(prov = EVP_KEYMGMT_get0_provider(rsameth)) && TEST_str_eq(OSSL_PROVIDER_name(prov), "default"); EVP_KEYMGMT_free(rsameth); diff --git a/test/provider_internal_test.c b/test/provider_internal_test.c index 6c295451c1..451d0f61b0 100644 --- a/test/provider_internal_test.c +++ b/test/provider_internal_test.c @@ -118,7 +118,7 @@ static int test_cache_flushes(void) goto err; if (!TEST_ptr_null(md = EVP_MD_fetch(ctx, "SHA256", NULL))) { - const char *provname = OSSL_PROVIDER_name(EVP_MD_provider(md)); + const char *provname = OSSL_PROVIDER_name(EVP_MD_get0_provider(md)); if (OSSL_PROVIDER_available(NULL, provname)) TEST_info("%s provider is available\n", provname); diff --git a/test/ssl_old_test.c b/test/ssl_old_test.c index ad9a4a256c..c779b72371 100644 --- a/test/ssl_old_test.c +++ b/test/ssl_old_test.c @@ -717,7 +717,7 @@ static void sv_usage(void) static void print_key_details(BIO *out, EVP_PKEY *key) { - int keyid = EVP_PKEY_id(key); + int keyid = EVP_PKEY_get_id(key); #ifndef OPENSSL_NO_EC if (keyid == EVP_PKEY_EC) { @@ -726,7 +726,7 @@ static void print_key_details(BIO *out, EVP_PKEY *key) if (!EVP_PKEY_get_group_name(key, group, sizeof(group), &size)) strcpy(group, "unknown group"); - BIO_printf(out, "%d bits EC (%s)", EVP_PKEY_bits(key), group); + BIO_printf(out, "%d bits EC (%s)", EVP_PKEY_get_bits(key), group); } else #endif { @@ -745,7 +745,7 @@ static void print_key_details(BIO *out, EVP_PKEY *key) algname = OBJ_nid2sn(keyid); break; } - BIO_printf(out, "%d bits %s", EVP_PKEY_bits(key), algname); + BIO_printf(out, "%d bits %s", EVP_PKEY_get_bits(key), algname); } } diff --git a/test/sslapitest.c b/test/sslapitest.c index b687ab9e22..7275d6f9c6 100644 --- a/test/sslapitest.c +++ b/test/sslapitest.c @@ -8850,7 +8850,7 @@ static int test_dh_auto(int idx) if (!TEST_int_gt(SSL_get_tmp_key(serverssl, &tmpkey), 0)) goto end; - if (!TEST_size_t_eq(EVP_PKEY_bits(tmpkey), expdhsize)) + if (!TEST_size_t_eq(EVP_PKEY_get_bits(tmpkey), expdhsize)) goto end; if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) diff --git a/test/tls13encryptiontest.c b/test/tls13encryptiontest.c index 3bb189f0b5..f83da872e8 100644 --- a/test/tls13encryptiontest.c +++ b/test/tls13encryptiontest.c @@ -347,7 +347,7 @@ static int test_tls13_encryption(void) for (ctr = 0; ctr < OSSL_NELEM(refdata); ctr++) { /* Load the record */ - ivlen = EVP_CIPHER_iv_length(ciph); + ivlen = EVP_CIPHER_get_iv_length(ciph); if (!load_record(&rec, &refdata[ctr], &key, s->read_iv, ivlen, RECORD_LAYER_get_read_sequence(&s->rlayer))) { TEST_error("Failed loading key into EVP_CIPHER_CTX"); diff --git a/test/tls13secretstest.c b/test/tls13secretstest.c index 5a16f306f7..bf214d3d5b 100644 --- a/test/tls13secretstest.c +++ b/test/tls13secretstest.c @@ -314,7 +314,7 @@ static int test_handshake_secrets(void) handshake_secret, sizeof(handshake_secret))) goto err; - hashsize = EVP_MD_size(ssl_handshake_md(s)); + hashsize = EVP_MD_get_size(ssl_handshake_md(s)); if (!TEST_size_t_eq(sizeof(client_hts), hashsize)) goto err; if (!TEST_size_t_eq(sizeof(client_hts_key), KEYLEN)) |