Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xtest: pkcs11: fix test_find_objects() when wrong count #756

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions host/xtest/pkcs11_1000.c
Original file line number Diff line number Diff line change
Expand Up @@ -2622,23 +2622,25 @@ static CK_RV test_find_objects(ADBG_Case_t *c, CK_SESSION_HANDLE session,
CK_ULONG expected_cnt)
{
CK_RV rv = CKR_GENERAL_ERROR;
CK_RV rv2 = CKR_GENERAL_ERROR;
CK_ULONG hdl_count = 0;

rv = C_FindObjectsInit(session, find_template, attr_count);
if (!ADBG_EXPECT_CK_OK(c, rv))
return rv;

rv = C_FindObjects(session, obj_found, obj_count, &hdl_count);
if (!ADBG_EXPECT_CK_OK(c, rv))
return rv;
if (!ADBG_EXPECT_COMPARE_UNSIGNED(c, hdl_count, ==, expected_cnt))
return CKR_GENERAL_ERROR;
rv2 = C_FindObjects(session, obj_found, obj_count, &hdl_count);
if (ADBG_EXPECT_CK_OK(c, rv2)) {
if (!ADBG_EXPECT_COMPARE_UNSIGNED(c, hdl_count, ==,
expected_cnt))
rv2 = CKR_GENERAL_ERROR;
}

rv = C_FindObjectsFinal(session);
if (!ADBG_EXPECT_CK_OK(c, rv))
return rv;

return rv;
return rv2;
}

static void destroy_persistent_objects(ADBG_Case_t *c, CK_SLOT_ID slot)
Expand Down
Loading