aboutsummaryrefslogtreecommitdiff
path: root/test/ectest.c
diff options
context:
space:
mode:
authorslontis <shane.lontis@oracle.com>2021-10-11 12:00:12 +1000
committerTomas Mraz <tomas@openssl.org>2021-11-05 16:38:44 +0100
commit884400d78992d1da1573a3677876b06421b797eb (patch)
treec5cc026c875624584c9cab9a25ea8ac8025c70c1 /test/ectest.c
parent09d91264c8ee1fdfcbe41f326a96a21cd85eb732 (diff)
downloadopenssl-884400d78992d1da1573a3677876b06421b797eb.zip
openssl-884400d78992d1da1573a3677876b06421b797eb.tar.gz
openssl-884400d78992d1da1573a3677876b06421b797eb.tar.bz2
Fix tests to check for negative results when calling EVP_PKEY_fromdata_init
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16801)
Diffstat (limited to 'test/ectest.c')
-rw-r--r--test/ectest.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/ectest.c b/test/ectest.c
index 56a0674..30680c7 100644
--- a/test/ectest.c
+++ b/test/ectest.c
@@ -2919,11 +2919,11 @@ static int custom_params_test(int id)
/* create two new provider-native `EVP_PKEY`s */
EVP_PKEY_CTX_free(pctx2);
if (!TEST_ptr(pctx2 = EVP_PKEY_CTX_new_from_name(NULL, "EC", NULL))
- || !TEST_true(EVP_PKEY_fromdata_init(pctx2))
- || !TEST_true(EVP_PKEY_fromdata(pctx2, &pkey1, EVP_PKEY_KEYPAIR,
- params1))
- || !TEST_true(EVP_PKEY_fromdata(pctx2, &pkey2, EVP_PKEY_PUBLIC_KEY,
- params2)))
+ || !TEST_int_eq(EVP_PKEY_fromdata_init(pctx2), 1)
+ || !TEST_int_eq(EVP_PKEY_fromdata(pctx2, &pkey1, EVP_PKEY_KEYPAIR,
+ params1), 1)
+ || !TEST_int_eq(EVP_PKEY_fromdata(pctx2, &pkey2, EVP_PKEY_PUBLIC_KEY,
+ params2), 1))
goto err;
/* compute keyexchange once more using the provider keys */