diff options
author | Tomas Mraz <tomas@openssl.org> | 2021-03-19 18:45:43 +0100 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2021-03-28 08:38:57 +0200 |
commit | 2145ba5e8383184d7f212500ec2f759bdf08503a (patch) | |
tree | a862106cc508e75f170b3105e3b5919fb38219d3 /test/ecdsatest.c | |
parent | Remove RSA bignum_data that is not used anywhere (diff) | |
download | openssl-2145ba5e8383184d7f212500ec2f759bdf08503a.tar.xz openssl-2145ba5e8383184d7f212500ec2f759bdf08503a.zip |
Implement EVP_PKEY_dup() function
Fixes #14501
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14624)
Diffstat (limited to 'test/ecdsatest.c')
-rw-r--r-- | test/ecdsatest.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/ecdsatest.c b/test/ecdsatest.c index 38486f5955..2cd7b970a2 100644 --- a/test/ecdsatest.c +++ b/test/ecdsatest.c @@ -190,7 +190,7 @@ static int test_builtin(int n, int as) EC_KEY *eckey_neg = NULL, *eckey = NULL; unsigned char dirt, offset, tbs[128]; unsigned char *sig = NULL; - EVP_PKEY *pkey_neg = NULL, *pkey = NULL; + EVP_PKEY *pkey_neg = NULL, *pkey = NULL, *dup_pk = NULL; EVP_MD_CTX *mctx = NULL; size_t sig_len; int nid, ret = 0; @@ -237,6 +237,10 @@ static int test_builtin(int n, int as) || !TEST_true(EVP_PKEY_assign_EC_KEY(pkey_neg, eckey_neg))) goto err; + if (!TEST_ptr(dup_pk = EVP_PKEY_dup(pkey)) + || !TEST_int_eq(EVP_PKEY_eq(pkey, dup_pk), 1)) + goto err; + temp = ECDSA_size(eckey); /* @@ -337,6 +341,7 @@ static int test_builtin(int n, int as) err: EVP_PKEY_free(pkey); EVP_PKEY_free(pkey_neg); + EVP_PKEY_free(dup_pk); EVP_MD_CTX_free(mctx); OPENSSL_free(sig); return ret; |