summaryrefslogtreecommitdiffstats
path: root/test/keymgmt_internal_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/keymgmt_internal_test.c')
-rw-r--r--test/keymgmt_internal_test.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/keymgmt_internal_test.c b/test/keymgmt_internal_test.c
index ce2e458f8c..78b1cd717e 100644
--- a/test/keymgmt_internal_test.c
+++ b/test/keymgmt_internal_test.c
@@ -224,7 +224,7 @@ static int test_pass_rsa(FIXTURE *fixture)
|| !TEST_ptr_ne(km1, km2))
goto err;
- while (dup_pk == NULL) {
+ for (;;) {
ret = 0;
km = km3;
/* Check that we can't export an RSA key into an RSA-PSS keymanager */
@@ -255,7 +255,11 @@ static int test_pass_rsa(FIXTURE *fixture)
}
ret = (ret == OSSL_NELEM(expected));
- if (!ret || !TEST_ptr(dup_pk = EVP_PKEY_dup(pk)))
+
+ if (!ret || dup_pk != NULL)
+ break;
+
+ if (!TEST_ptr(dup_pk = EVP_PKEY_dup(pk)))
goto err;
ret = TEST_int_eq(EVP_PKEY_eq(pk, dup_pk), 1);