#125 OCKv3: init_slotinfo() is redundant

Joy Latten
Joy Latten

pkcsslotd reads opencryptoki.conf and gets the manufacturer, description, firmware version and hardware version for a slot. This info is then entered into a slot entery and the slot itself becomes part of an aray of slots. The array is stored in pkcsslotd's shared memory.
Since the api access this shared memory, this slotinfo is returned in calls to C_GetSlotInfo().

BUT, in utility.c, there is an init_slotinfo() which declares a slot for the token and puts the manufacturer, etc... info into it using the info defined in the token.

This is redundant! Why does the token also create a slot entry and use different info from what pkcsslotd does.

There should be one method to acquire slot info and both pkcsslotd and token should use it.
One idea is to pass the slotinfo from pkcsslotd in the SC_XXX api to the token and let it use that.
if it is better to keep init_slotinfo() in the token, then a token specific getslotinfo and token specific getslotlist are needed.

Either way, this is redundant and needs to be examined and fixed.