Open Bug 1316293 Opened 8 years ago Updated 2 years ago

pkcs11testmodule.cpp should ensure tokenPresent doesn't change in between calls to Test_C_GetSlotList()

Categories

(Core :: Security: PSM, defect, P3)

defect

Tracking

()

People

(Reporter: Cykesiopka, Unassigned)

References

()

Details

(Whiteboard: [psm-backlog])

The C_GetSlotList() function on a PKCS #11 module can potentially be called multiple times by calling code (such as NSS) to first determine the number of slots the module has, and to get a list of slot IDs using that number.

Currently, the implementation of the function in pkcs11testmodule.cpp does this:
> CK_ULONG slotCount = (!limitToTokensPresent || tokenPresent ? 1 : 0) + 1;
... to determine the number of slots.

The cyclic behaviour of slot 1 of the test module means `tokenPresent` may change in between calls to C_GetSlotList(). As such, the slot list that the calling code ends up with may not be correct.

This doesn't seem to be a problem at the moment, but it would be better if this could be addressed.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.