diff options
author | Pauli <pauli@openssl.org> | 2022-01-24 16:17:25 +1100 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-11-11 10:03:06 +0100 |
commit | f46befd667e808df56b6351e3056025503badf85 (patch) | |
tree | 38b16c7f03ceb9f9c7e863ec3d55f4751e5daf3e /test | |
parent | a262d4ff1816159686d9e95ee79f0b2a5cf596b6 (diff) |
evp_test: add a ctx dup operation to the KDF tests
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/17572)
(cherry picked from commit c8adf19d2da318cd7b007753d6c8a7f9dc94d4ed)
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/evp_test.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/evp_test.c b/test/evp_test.c index 097e74104d..5412b1f95e 100644 --- a/test/evp_test.c +++ b/test/evp_test.c @@ -2808,6 +2808,7 @@ static int kdf_test_run(EVP_TEST *t) KDF_DATA *expected = t->data; unsigned char *got = NULL; size_t got_len = expected->output_len; + EVP_KDF_CTX *ctx; if (!EVP_KDF_CTX_set_params(expected->ctx, expected->params)) { t->err = "KDF_CTRL_ERROR"; @@ -2817,6 +2818,10 @@ static int kdf_test_run(EVP_TEST *t) t->err = "INTERNAL_ERROR"; goto err; } + if ((ctx = EVP_KDF_CTX_dup(expected->ctx)) != NULL) { + EVP_KDF_CTX_free(expected->ctx); + expected->ctx = ctx; + } if (EVP_KDF_derive(expected->ctx, got, got_len, NULL) <= 0) { t->err = "KDF_DERIVE_ERROR"; goto err; |