OpenSC pkcs11_eventmgr doesn't detect token removal

Bug #1857912 reported by remfalc
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
opensc (Ubuntu)
Fix Released
Wishlist
Unassigned
pam-pkcs11 (Ubuntu)
Invalid
Wishlist
Unassigned

Bug Description

Apparently there is a bug in the OpenSC PKCS11 library and keep returning the token even after it has been removed.

Environment:
Arch x86_64
Ubuntu 19.10 (eoan)
OpenSC 0.19.0-2

Steps to reproduce:

I am using the command line pkcs11-tool to test the detection of the insertion/removal of the token.

shell # pkcs11-tool --test-hotplug
Testing card detection using C_GetSlotList()
Please press return to continue, x to exit: <==== Token inserted
Available slots:
Slot 0 (0x0): Yubico Yubikey NEO OTP+U2F+CCID 00 00
  token label : xxxxx
  token manufacturer : piv_II
  token model : PKCS#15 emulated
  token flags : login required, rng, token initialized, PIN initialized
  hardware version : 0.0
  firmware version : 0.0
  serial num : xxxxxxxxx
  pin min/max : 4/8

Please press return to continue, x to exit: <==== Token removed
Available slots:
Slot 0 (0x0): (GetSlotInfo failed, CKR_GENERAL_ERROR)

Please press return to continue, x to exit:
Available slots:
Slot 0 (0x0): (GetSlotInfo failed, CKR_GENERAL_ERROR)

Please press return to continue, x to exit: <==== Still detecting a token despite token being removed
Available slots:
Slot 0 (0x0): Yubico Yubikey NEO OTP+U2F+CCID 00 00
  token label : xxxxx
  token manufacturer : piv_II
  token model : PKCS#15 emulated
  token flags : login required, rng, token initialized, PIN initialized
  hardware version : 0.0
  firmware version : 0.0
  serial num : xxxxxxxxxxx
  pin min/max : 4/8

Fix
A bug was opened with OpenSC and is now fixed as of version 0.20.0
https://github.com/OpenSC/OpenSC/issues/1706

Would it be possible to upgrade OpenSC to 0.20.0 in the next version?

remfalc (remfalc)
description: updated
affects: network-manager (Ubuntu) → opensc (Ubuntu)
Revision history for this message
Sebastien Bacher (seb128) wrote :
Changed in opensc (Ubuntu):
importance: Undecided → Wishlist
status: New → Fix Released
Changed in pam-pkcs11 (Ubuntu):
status: New → Invalid
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.