Problem Description
pkcs11-tool --slot parameter expects ID in decimal format and --list-slots parameter prints slots in hex format.
Proposed Resolution
Specify that it excpects slot ID in decimal format or modify code to accept hex format.
Steps to reproduce
pkcs11-tool -L
Available slots:
Slot 0 (0x0): SafeNet Token JC
...
Slot 8 (0x10):
...
pkcs11-tool -O --slot=10
error: PKCS11 function C_OpenSession failed: rv = CKR_SLOT_ID_INVALID (0x3)
Aborting.
pkcs11-tool -O --slot=16
Using slot with index 8 (0x10)
...