Always set number of slots

Relates to #98.
This commit is contained in:
Alessio Di Mauro
2016-10-05 16:33:24 +02:00
parent 7b7c798ef6
commit af78e18151
+5 -2
View File
@@ -198,14 +198,17 @@ CK_DEFINE_FUNCTION(CK_RV, C_GetSlotList)(
return CKR_CRYPTOKI_NOT_INITIALIZED; return CKR_CRYPTOKI_NOT_INITIALIZED;
} }
if (pSlotList == NULL_PTR) { if (pulCount) {
// Just return the number of slots
*pulCount = n_slots; *pulCount = n_slots;
if (tokenPresent) if (tokenPresent)
*pulCount = n_slots_with_token; *pulCount = n_slots_with_token;
else else
*pulCount = n_slots; *pulCount = n_slots;
}
if (pSlotList == NULL_PTR) {
// Just return the number of slots
DOUT; DOUT;
return CKR_OK; return CKR_OK;