New version of libccid: 1.8.1

I just released version 1.8.1 of libccid the Free Software CCID class smart card reader driver.

This version fixes an issue with multi-slots readers.

Changes:

1.8.1 - 10 June 2026, Ludovic Rousseau

  • Correctly close the slots of a multi-slots reader

  • Fix 3 minor issues "Found by AISLE in partnership with Red Hat"

  • Some other minor improvements

New version of pcsc-lite: 2.5.1

I have just released a new version of pcsc-lite 2.5.1.

pcsc-lite is a Free Software implementation of the PC/SC (also known as WinSCard) API for Unix systems. It provides an API for using smart cards and smart card readers.

This version contains a bug fix for multi-slots readers. The bug was introduced in the previous version 2.5.0 released 2 weeks ago.

Changes:

2.5.1: Ludovic Rousseau

10 June 2026

  • Fix a bug (introduced in 2.5.0) with multi-slots readers

  • Add support of Haiku Operating System

New version of pcsc-tools: 1.7.5

I just released a new version of pcsc-tools, a suite of tools for PC/SC.

Changes:

1.7.5 - 3 June 2026, Ludovic ROUSSEAU

  • 102 new ATRs

  • pcsc_scan:

    • fix an infinite loop

    • do not crash if SCardEstablishContext() fails

    • do not wait for an non-started thread

    • handle the case of an error during SCardGetStatusChange

  • meson: use -DATRparser="" to disable the ATR parser

  • gscriptor: Add Georgian translation

  • minor fixes and improvements

No more limited to 16 readers

pcsc-lite and my CCID driver are no longer limited to 16 readers. See New version of pcsc-lite: 2.5.0 and New version of libccid: 1.8.0.

History

Since the first version of pcsc-lite (in 2002 according to git history) the maximum number of readers has been set to 16. This number is defined by the PCSCLITE_MAX_READERS_CONTEXTS constant.

Since pcsc-lite was limited to 16 readers it was obvious to also limit the number of devices supported by the CCID driver to 16.

This limitation is problematic for some use cases. While it is possible to change the value of PCSCLITE_MAX_READERS_CONTEXTS and rebuild both pcsc-lite and the driver, this has side effects. See Fedora, flatpak and pcsc-lite for more information.

Changes

The request has been around since at least 2018. See https://salsa.debian.org/rousseau/CCID/-/work_items/4 and https://salsa.debian.org/rousseau/PCSC/-/work_items/4.

I had already calculated the amount of RAM that could be saved by using a list instead of a fixed-size array:

You can now use as many readers as you want.

In fact, no. There is still a limit of 256 readers due to the naming scheme used by pcsc-lite for readers. Readers will go from 00 to FF. See What is in a PC/SC reader name?.

Backward compatibility

In version 2.4.1 of pcsc-lite I introduced the ability to mix different versions of the internal communication protocol between the PC/SC daemon (pcscd) and the PC/SC library (libpcsclite). See pcsc-lite backward & forward compatible with itself.

In order to remove the limitation of the reader number, I had to update this internal communication protocol again. However, I tried to make it smart so that an old libpcsclite can communicate with a recent pcscd or vice versa. The application will still only recognise up to 16 readers, but at least it should work.

Conclusion

I hope you will benefit from this change:

  • Less RAM consumed when only 1 reader is used.

  • The possibility of using more than 16 readers.

New version of pcsc-lite: 2.5.0

I have just released a new version of pcsc-lite 2.5.0.

pcsc-lite is a Free Software implementation of the PC/SC (also known as WinSCard) API for Unix systems. It provides an API for using smart cards and smart card readers.

The major change in this version is: no more limited to 16 smart card readers.

Changes:

2.5.0: Ludovic Rousseau

27 May 2026

  • Do not limit to 16 readers only

  • Remove support of autotools

  • Fix a crash when rescanning serial configs

  • Fix a memory leak in Polkit

  • tokenparser: avoid a crash with corrupted Info.plist files

  • Some other minor improvements

New version of libccid: 1.8.0

I just released version 1.8.0 of libccid the Free Software CCID class smart card reader driver.

The major changes in this version are:

  • no more limited to 16 smart card readers

  • ./configure script is no more provided. Only meson configuration is provided.

Changes:

1.8.0 - 27 May 2026, Ludovic Rousseau

  • Add support of

    • GLSolutions NM61 PC/SC

    • Identiv uTrust FIDO2 Security Key

    • Kensington VeriMark NFC+ USB-C Security Key

    • MARX CryptoTech LP Tokey 3 FIDO

    • mCore Contact-Reader

    • mCore Contactless-Reader

    • mCore DualSlot-Reader

    • Pol Henarejos Pico Fido

    • Pol Henarejos Pico HSM

    • Pol Henarejos Pico OpenPGP

    • Richmond Technologies CO. LLC AEGIS PRO4 Smart Card Reader

    • SCR Prime

  • Remove the limitation to 16 readers

  • udev: Update rules file to comply with systemd documentation (and fix permissions issue)

  • meson: install serial config file in correct dir

  • Remove support of autotools

  • Fix crash in multi slots readers code

  • Fix some race conditions

  • Some other minor improvements

Laptops and smart card readers

Which smart card reader is present in a particular laptop model? It can be difficult to find out the exact model of smart card reader included in a laptop before buying it.

However, thanks to the Hardware for Linux project, you can submit your own hardware configuration and also consult the configurations of many laptops and desktops to find out what hardware is included.

The website also provides aggregated results for a specific categories such as CPU Vendors.

One interesting result is the Chipcard Vendor aggregation.

Chipard Vendors market shares

The results do not represent exact market shares. They only include systems that:

However, they should reflect reality.

Chipcard Vendor Alcor Micro (26.2%) Broadcom (55.6%) O2 Micro (6.5%) Upek (4.7%) Lenovo (3.4%) Yubico.com (0.8%) Gemalto (was ... (0.6%) SCM Microsystems (0.5%) Advanced Card... (0.4%) Aktiv (0.2%) Others (1.0%)
Chipcard Vendors

#

Vendor

Percent

1

Broadcom

55.61%

2

Alcor Micro

26.17%

3

O2 Micro

6.53%

4

Upek

4.69%

5

Lenovo

3.45%

6

Yubico.com

0.83%

7

Gemalto (was Gemplus)

0.6%

8

SCM Microsystems

0.51%

9

Advanced Card Systems

0.37%

10

Activ

0.23%

An important point to note is that the first five on the list should be correct, as they correspond to the manufacturers of embedded smart card readers. However, the next five in the list are often (if not always) external smart card readers that are connected via a USB port and not integrated into the laptop. For instance, I am not aware of any Yubico readers that are embedded in laptops. These readers are listed on https://linux-hardware.org/ because they were plugged in when the user ran the hw-probe program to scan and report the hardware configuration.

Which laptop manufacturers use which smart card reader?

You can click on a specific slice of the Chipcard Vendor pie chart to see which laptop manuifacturers uses this smart card reader brand.

Broadcom

Notebook Vendors Dell (100.0%)

All Broadcom readers are used by Dell.

Alcor Micro

Notebook Vendors Lenovo (82.4%) Hewlett-Packard (8.6%) Fujitsu (6.5%) Acer (0.7%) ASUSTek (0.4%) Dell (0.4%) Durabook (0.2%) Getac (0.2%) Google (0.2%) Notebook (0.2%) Others (0.4%)

#

Vendor

Percent

1

Lenovo

82.4%

2

Hewlett-Packard

8.6%

3

Fujitsu

6.5%

4

Acer

0.7%

5

ASUSTek Computer

0.4%

O2 Micro

Notebook Vendors Fujitsu (37.3%) Toshiba (19.7%) Fujitsu Siemens (2.1%) Dell (40.8%)

#

Vendor

Percent

1

Dell

40.8%

2

Fujitsu

37.3%

3

Toshiba

19.7%

4

Fujitsu Siemens

2.1%

Upek

Notebook Vendors Lenovo (100.0%)

All of Upek readers are used by Lenovo.

It looks like the Upek devices are "TouchChip Fingerprint Coprocessor" and not an "Integrated Smart Card Reader". I don't know why they are listed as "Chipcard Vendor". Perhaps it is a bug or limitation of https://linux-hardware.org/.

Lenovo

Notebook Vendors Lenovo (100.0%)

Unsurprisingly, all of Lenovo readers are used by... Lenovo.

Corresponding CCID devices

It is possible to list the CCID devices of each manufacturer that I know of:

Conclusion

Only three main vendors of smart card readers are used in laptops: Broadcom, Alcor Micro and O2 Micro.

Do they produce good products? Are their products supported by my CCID driver? These are both very good questions, but for other blog articles. To be continued...

pcsc_scan improved user interface

Version 1.7.4 of pcsc-tools provides an enhanced version of the pcsc_scan tool.

Problem

The program waits for card and reader events and reports any smart card events. If no reader or card is inserted or removed, nothing happens.

Since version 1.6.0 (New version of pcsc-tools: 1.6.0) the program has included an animation (cycling \|/- characters) to indicate that it is waiting. However, this was not obvious to users who did not know how to stop the program or what to do.

Solution

Now when the program is waiting for an event it displays a message such as:

Waiting for the first reader...   \  (use Ctrl-C to exit)

or

Insert or remove a card or a reader... /  (use Ctrl-C to exit)

I hope this makes it clearer what the user is expected to do.

Demo

The animation was recorded and played using asciinema.

The sequence in the animation below correspons to:

  1. Connect a reader

  2. Insert a card

  3. Remove the card

  4. Disconnect the reader

  5. Exit pcsc_scan

Windows

The program is also available for Windows. You can download the Windows binary from the project page https://pcsc-tools.apdu.fr/#windows

https://pcsc-tools.apdu.fr/pcsc_scan_windows.gif

Conclusion

I hope you find pcsc_scan usefull for you. This tool is intended for initial debugging purposes. For example see Level 1 smart card support on GNU/Linux.

SCARD_CTL_CODE(3601): USB path of the reader

In version 1.7.1 of my CCID driver I added a new service with the Control Code SCARD_CTL_CODE(3601).

Problem

Some people use two (or more) readers. And each reader plays a specific role in their application. It is therefore important to identify each one.

While it is often possible to use the PC/SC reader name (see What is in a PC/SC reader name?), if you have two identical readers with no serial numbers, it becomes impossible to distinguish between them.

Solution

A USB device is connected to a USB bus with a specific topology. The lsusb --tree command, for example, can display the USB bus topology. The output looks like this:

$ lsusb -t
/:  Bus 001.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/16p, 480M
    |__ Port 003: Dev 039, If 0, Class=Chip/SmartCard, Driver=usbfs, 12M

The smart card reader is connected to USB Port 003 on Bus 001. These numbers are fixed and linked to the computer's physical USB port. Disconnecting and reconnecting the reader to the same USB port will result in the same topology.

On GNU/Linux, the device number will change. For example, if I disconnect and reconnect the device, the reader's device number (Dev) will change from 039 to 040.

SCARD_CTL_CODE(3601)

This code is specific to my CCID driver. It comes after SCARD_CTL_CODE(3600) that is also specific/proprietary and used for MEP (see CCID driver and Multiple Enabled Profiles (MEP)).

Ideally, we would use a code defined by the PC/SC Workgroup but this group is essentially defunct and Microsoft is no longer a member. Microsoft stopped following the PC/SC Workgroup Specification a long time ago. Therefore, even if a name is defined by the PC/SC Workgroup, it will not be available on Windows.

API documentation

Use SCardControl() to send the control code SCARD_CTL_CODE(3601) to the reader. This code will be intercepted by the CCID driver. On return, you get a NUL-terminated string in the format <bus>-<port[.port[.port]]>:<config>.<interface> (e.g., 1-1.3.2:1.0) as found in /sys/bus/usb/devices/.

Source code

This example code is also included in the CCID driver's source code, in the examples/get_usb_path.py file.

The code also displays the SCARD_ATTR_CHANNEL_ID of the reader (see SCARD_ATTR_CHANNEL_ID and USB devices). This is an official PC/SC feature. It can be used when topology information is obtained from another source.

#! /usr/bin/env python3

"""
get_usb_path.py: get USB path of readers
Copyright (C) 2026  Ludovic Rousseau
"""

#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 3 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License along
#   with this program; if not, see <http://www.gnu.org/licenses/>.

import struct
import smartcard
from smartcard.pcsc.PCSCPart10 import SCARD_CTL_CODE
from smartcard.scard import (
    SCARD_E_NOT_TRANSACTED,
    SCARD_E_INVALID_PARAMETER,
    SCARD_ATTR_CHANNEL_ID,
    SCARD_SHARE_DIRECT,
    SCARD_LEAVE_CARD,
)
from smartcard.util import toASCIIString


def get_usb_path(reader):
    """
    Display USB topology
    """
    print("Using:", reader)
    card_connection = reader.createConnection()
    card_connection.connect(mode=SCARD_SHARE_DIRECT, disposition=SCARD_LEAVE_CARD)

    # special control code
    ioctl_get_usb_path = SCARD_CTL_CODE(3601)
    try:
        res = card_connection.control(ioctl_get_usb_path)
    except smartcard.Exceptions.SmartcardException as ex:
        # SCARD_E_NOT_TRANSACTED returned by pcsc-lite
        # SCARD_E_INVALID_PARAMETER retruned by macOS
        if ex.hresult in [SCARD_E_NOT_TRANSACTED, SCARD_E_INVALID_PARAMETER]:
            print("Your driver does not (yet) support SCARD_CTL_CODE(3601)")
            return
        raise
    print("USB path:", toASCIIString(res))

    # get Channel ID
    attrib = card_connection.getAttrib(SCARD_ATTR_CHANNEL_ID)
    ddddcccc = struct.unpack("i", bytearray(attrib))[0]
    dddd = ddddcccc >> 16
    if dddd == 0x0020:
        bus = (ddddcccc & 0xFF00) >> 8
        addr = ddddcccc & 0xFF
        print(f" USB: bus: {bus}, addr: {addr}")
    print()


def main():
    """
    main
    """
    # for all the available readers
    for reader in smartcard.System.readers():
        get_usb_path(reader)


if __name__ == "__main__":
    main()

Output

The reader is connected directly to the computer

$ ./get_usb_path.py
Using: Gemalto PC Twin Reader (70D7E2EE) 01 00
USB path: 1-3:1.0
 USB: bus: 1, addr: 39

$ lsusb -t
/:  Bus 001.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/16p, 480M
    |__ Port 003: Dev 039, If 0, Class=Chip/SmartCard, Driver=usbfs, 12M

The USB path is 1-3:1.0.

This corresponds to bus 1, port 3, configuration 1 and interface 0. You can ignore the configuration and interface details for non-composite USB devices.

Connected to another USB port of the computer

$ ./get_usb_path.py
Using: Gemalto PC Twin Reader (70D7E2EE) 01 00
USB path: 1-6:1.0
 USB: bus: 1, addr: 40

$ lsusb -t
/:  Bus 001.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/16p, 480M
    |__ Port 006: Dev 040, If 0, Class=Chip/SmartCard, Driver=usbfs, 12M

Note:

  • the Port changed from 003 to 006

  • the Dev changed from 039 to 040

Connected to a hub

$ ./get_usb_path.py
Using: Gemalto PC Twin Reader (70D7E2EE) 01 00
USB path: 1-3.1:1.0
 USB: bus: 1, addr: 42

$ lsusb -t
/:  Bus 001.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/16p, 480M
    |__ Port 003: Dev 041, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 001: Dev 042, If 0, Class=Chip/SmartCard, Driver=usbfs, 12M

Note:

  • Port 003 is now used by the USB hub (Class=Hub)

  • the reader uses Port 001 of the hub

  • the USB path has one extra level 1-3.1:1.0

Connected to another port of the hub

$ ./get_usb_path.py
Using: Gemalto PC Twin Reader (70D7E2EE) 01 00
USB path: 1-3.4:1.0
 USB: bus: 1, addr: 43

$ lsusb -t
/:  Bus 001.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/16p, 480M
    |__ Port 003: Dev 041, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 004: Dev 043, If 0, Class=Chip/SmartCard, Driver=usbfs, 12M

Note:

  • the reader is connected to Port 004 of the hub

  • the hub is still connected to Port 003

Conclusion

Not everyone will need or use this feature. However, it can be very important if you have a large number of readers.

Many Thanks to Diego de los Santos for the idea and implementation.