Page MenuHome GnuPG

Multiple smartcard (reader) / app support in Kleopatra
Closed, ResolvedPublic

Description

Kleopatra currently only supports one smartcard.
This is basically just the smartcard that you get with "gpg --card-edit"

GnuPG supports multiple smartcards / readers at once and I think that this is also a use case that Kleopatra should support.

So the smartcard management should have support for different smartcards with different apps.

Caution for testing: I recently noticed that GnuPG stable did not support more then four smartcard readers at once. For that 0e721b635d6105e1a5b443684116fb9edfe77f92 is needed.

Revisions and Commits

rKLEOPATRA Kleopatra
rM GPGME

Event Timeline

ikloecker changed the task status from Open to Testing.Oct 13 2020, 10:09 AM

Kleopatra does now support using multiple smartcards with multiple apps concurrently (at least as far as the backend scdaemon supports this). Only tested with master of everything so far.

I am running in a setup where my GnuPG 2.3 is connected to a gpg-agent / scdaemon running at GnuPG 2.2.12.

Sadly, this can happen in the real world because the gpg-agent socket can be forwarded. This may break in that case but for me Kleopatra now runs in an endless start / poll loop:

14:00:32.241 org.kde.pim.kleopatra: Kleo::DeviceInfoWatcher::Worker::start DeviceInfoWatcher::Worker::start: Assuan transaction for SCD DEVINFO --watch started
14:00:32.241 org.kde.pim.kleopatra: Kleo::DeviceInfoWatcher::Worker::poll DeviceInfoWatcher::Worker::poll: context finished with Success (code: 0, source: Unspecified source)
14:00:32.241 org.kde.pim.kleopatra: Kleo::DeviceInfoWatcher::Worker::start DeviceInfoWatcher::Worker::start: Assuan transaction for SCD DEVINFO --watch started
14:00:32.241 org.kde.pim.kleopatra: Kleo::DeviceInfoWatcher::Worker::poll DeviceInfoWatcher::Worker::poll: context finished with Success (code: 0, source: Unspecified source)

The problem here is that:

> getinfo version
D 2.2.12
OK
> scd getinfo version
D 2.2.12
OK
> SCD DEVINFO --watch
ERR 100663571 Unknown IPC command <SCD>

I think the unknown IPC command error is somehow lost in our layers.

Looking at the code I think that either the gpgme_wait in Context::poll should return this error or the Context::startAssuanTransaction should return this error. I'm not sure where it is lost. I don't think we need to support this setup but we should at least figure out where the error is lost.

I'm currently working with Kleopatra and 2.3 and it works nicely.