Skip to content

Commit

Permalink
Ensure pools are consistent when we store objects
Browse files Browse the repository at this point in the history
This was broken by a recent commit as slotid is populated when a mock
object is actually stored in the session, but the object was not added
to the pool, leading the code that frees object to complain the pool was
in an inconsistent state because the object could not be found there.

Signed-off-by: Simo Sorce <[email protected]>
  • Loading branch information
simo5 committed Oct 8, 2024
1 parent d727a8c commit 1d2a53b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -3315,6 +3315,12 @@ static CK_RV p11prov_obj_store_public_key(P11PROV_OBJ *key)
rv = CKR_GENERAL_ERROR;
}

if (rv == CKR_OK) {
/* this is a real object now, add it to the pool, but do not
* fail if the operation goes haywire for some reason */
(void)obj_add_to_pool(key);
}

return rv;
}

Expand Down

0 comments on commit 1d2a53b

Please sign in to comment.