Bug 102624 - p11-kit-proxy: The slot list isn't updated
Summary: p11-kit-proxy: The slot list isn't updated
Status: NEW
Alias: None
Product: p11-glue
Classification: Unclassified
Component: p11-kit (show other bugs)
Version: unspecified
Hardware: Other Linux (All)
: medium normal
Assignee: Stef Walter
QA Contact:
Depends on:
Reported: 2017-09-08 12:31 UTC by Paul Wolneykien
Modified: 2017-09-08 12:31 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

A patch to fix the slot list caching problem (4.39 KB, patch)
2017-09-08 12:31 UTC, Paul Wolneykien
Details | Splinter Review

Description Paul Wolneykien 2017-09-08 12:31:13 UTC
Created attachment 134083 [details] [review]
A patch to fix the slot list caching problem

# Current behavior

1. load p11-kit-proxy.so as PKCS#11 module;
2. get the list of slots along with their descriptions (slot info);
3. insert a token or a smart card;
4. repeat step 2: no new tokens are found.

# Expected behavior

1.2.3. (same as above)
4. repeat step 2: the inserted token is found, it's description is available.

# Explanation

In order to make token insert and remove operations observable, it's
necessary to call C_GetSlotList() with NULL pointer argument. The
latter is a signal for each underlying PKCS#11 module to update the
slot and token status information.

The following is stated in the PKCS #11 Cryptographic Token Interface
Base Specification Version 2.40, 5.5 Slot and token management

"The set of slots accessible through a Cryptoki library is checked at
the time that C_GetSlotList, for list length prediction (NULL
pSlotList argument) is called. If an application calls C_GetSlotList
with a non-NULL pSlotList, and *then* the user adds or removes a
hardware device, the changed slot list will only be visible and
effective if C_GetSlotList is called again with NULL."


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.