aboutsummaryrefslogtreecommitdiffstats
path: root/test/evp_test.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2020-08-07 12:23:07 +0100
committerMatt Caswell <matt@openssl.org>2020-08-10 14:52:49 +0100
commit711ae5d359d9fa89a9aef90ac197ba26c8de3330 (patch)
tree3b2cae9dbaa225ba51cd6be52bf9409d0ad1ed53 /test/evp_test.c
parentcd0a4998a006f00d1e5c271cfcd8e1fd1f0b3c41 (diff)
downloadopenssl-711ae5d359d9fa89a9aef90ac197ba26c8de3330.tar.gz
Remove a TODO from evp_test
Now that the EVP_PKEY KDF bridge is based on provider code a TODO item can be removed from evp_test. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12573)
Diffstat (limited to 'test/evp_test.c')
-rw-r--r--test/evp_test.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/test/evp_test.c b/test/evp_test.c
index bff1ecb558..f384a8d863 100644
--- a/test/evp_test.c
+++ b/test/evp_test.c
@@ -2494,9 +2494,7 @@ typedef struct pkey_kdf_data_st {
*/
static int pkey_kdf_test_init(EVP_TEST *t, const char *name)
{
- OPENSSL_CTX *save_libctx = NULL;
PKEY_KDF_DATA *kdata = NULL;
- int kdf_nid = OBJ_sn2nid(name);
if (is_kdf_disabled(name)) {
TEST_info("skipping, '%s' is disabled", name);
@@ -2504,28 +2502,17 @@ static int pkey_kdf_test_init(EVP_TEST *t, const char *name)
return 1;
}
- if (kdf_nid == NID_undef)
- kdf_nid = OBJ_ln2nid(name);
-
if (!TEST_ptr(kdata = OPENSSL_zalloc(sizeof(*kdata))))
return 0;
- /*
- * TODO(3.0): This should be using EVP_PKEY_CTX_new_from_name(),
- * but it does not currently since the PKEY_KDF is using legacy paths.
- * Internally it still uses fetches with the legacy path,
- * So for now we hack in the library context.
- */
- save_libctx = OPENSSL_CTX_set0_default(libctx);
- kdata->ctx = EVP_PKEY_CTX_new_id(kdf_nid, NULL);
+
+ kdata->ctx = EVP_PKEY_CTX_new_from_name(libctx, name, NULL);
if (kdata->ctx == NULL
|| EVP_PKEY_derive_init(kdata->ctx) <= 0)
goto err;
- OPENSSL_CTX_set0_default(save_libctx);
t->data = kdata;
return 1;
err:
- OPENSSL_CTX_set0_default(save_libctx);
EVP_PKEY_CTX_free(kdata->ctx);
OPENSSL_free(kdata);
return 0;