Ticket #203 (closed defect: fixed)

NB! Read about ReportingBugs before filing a ticket!

Opened 23 months ago

Last modified 17 months ago

pkcs11-tool --list-slots returns invalid slot

Reported by: jmpoure Owned by: opensc-devel@…
Priority: normal Milestone:
Component: pkcs11 Version: trunk
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

Per discussion on mailing list, my OpenSC installation returns:

pkcs11-tool --list-slots
Available slots:
Slot 4294967295          Virtual hotplug slot
  (empty)
Slot 1           Feitian SCR301 00 00
  (empty)
Slot 2           Feitian SCR301 00 00
  (empty)
Slot 3           Feitian SCR301 00 00
  (empty)
Slot 4           Feitian SCR301 00 00
  (empty)
You must specify a slot ID

You must specify a slot ID is not a normal message.

This happens with any smart card reader, even none:

pkcs11-tool --list-slots
Available slots:
Slot 4294967295          Virtual hotplug slot
  (empty)
You must specify a slot ID

I am using OpenSC trunk compiled from sources, with libpkcs11-helper1 1.07 compiled from binaries.

Kind regards, Jean-Michel

Change History

comment:1 Changed 23 months ago by aj

  • Status changed from new to closed
  • Resolution set to fixed

svn commit Sending src/tools/pkcs11-tool.c Transmitting file data . Committed revision 4122.

fixed in trunk.

comment:2 Changed 23 months ago by jmpoure

Thanks for the commit.

Now I was able to run OpenSSL code:

req -engine pkcs11 -new -key slot_5-id_c6f280080fb0ed1ebff0480a01d00a98a1b3b89a -keyform engine -x509 -out cert.pem -text

Do we really have to specify slot number? The syntax seems rather complex.

Kind regards, Jean-Michel

comment:3 Changed 23 months ago by martin

There's a bug in engine_pkcs11, it tries to use a slot id that is not in the list of slots returned by C_GetSlotList

With the hash style ID-s used internally by OpenSC (and by other PKCS#11 providers as well) there's not requirement to give the slot ID. The ID can be searched from all available tokens without first logging in. If the slot ID is present, a C_Login can be done before.

Note: See TracTickets for help on using tickets.