GnuPG and PC/SC conflicts, episode 2

Ubuntu 24.04 provides a new version of GnuPG (GNU Privacy Guard): 2.4.4, instead of version 2.2.27 in Ubuntu 22.04. This new version changed its way to access smart card readers.

A new bug has already been opened: Yubikey stopped working after noble upgrade

The problem

GnuPG2 (or in fact its scdaemon component) tries to directly access smart card readers using GnuPG2 own implementation of the USB CCID protocol.

This access conflicts with pcsc-lite also accessing the smart card readers.

The Solution

As already seen in GnuPG and PC/SC conflicts from 2019 the solution is to disable the CCID driver provided by GnuPG.

From scdaemon documentation https://www.gnupg.org/documentation/manuals/gnupg/Scdaemon-Options.html#index-disable_002dccid

--disable-ccid

The integrated CCID driver for CCID compliant devices can be available when libusb was detected at build time, and it is used to access the smartcard reader. If access via PC/SC driver is needed, please configure this option to disable CCID driver support (if any). In GnuPG 2.2, there was a fallback mechanism from CCID driver to PC/SC driver. The fallback mechanism worked, because scdaemon in GnuPG 2.2 only supported a single token/reader. To support of multiple tokens/readers at the same time, fallback mechanism was removed.

Since GnuPG v2.4 removed the fallback mechanism to use PC/SC it is even more important to use the disable-ccid configuration.

To be safe, edit your file ~/.gnupg/scdaemon.conf and add the line:

disable-ccid

Conclusion

If you use GnuPG and also one (or more) PC/SC application then you need this change.