map_slot_unlocked (Proxy *px,
                   CK_SLOT_ID slot,
                   Mapping *mapping)
{
	unsigned int i;

	assert (px != NULL);
	assert (mapping != NULL);

	for (i = 0; i < px->n_mappings; i++) {
		assert (px->mappings != NULL);
		if (px->mappings[i].wrap_slot == slot) {
			memcpy (mapping, &px->mappings[i], sizeof(Mapping));
			return CKR_OK;
		}
	}

	return CKR_SLOT_ID_INVALID;
}
map_slot_unlocked (Proxy *px,
                   CK_SLOT_ID slot,
                   Mapping *mapping)
{
	unsigned int i;

	assert (px != NULL);
	assert (mapping != NULL);

	for (i = 0; i < px->n_mappings; i++) {
		assert (px->mappings != NULL);
		if (px->mappings[i].wrap_slot == slot) {
			memcpy (mapping, &px->mappings[i], sizeof(Mapping));
			return CKR_OK;
		}
	}

	return CKR_SLOT_ID_INVALID;
}