Page MenuHome GnuPG

OpenPGP card factory-reset and Kleopatra
Closed, ResolvedPublic

Description

gpg-card and gpg --card-edit both allow to factory reset OpenPGP cards. This is on purpose a command line only feature. This does not always work if Kleopatra is also running.

Technically gpg sends a RESET to scdaemon followed by a "SERIALNO undefined". Now Kleo notices the reset and does a standard SERIALNO which conflicts with the "SERIALNO undefined" from gpg. The solution I see for this is a new LOCK command (with a timeout) to gext exclusive acccess to the card by the current client

Event Timeline

I forgot that we have LOCK and UNLOCK commands in scdaemon. This was implemented around 2005 but there are no more users in gpg meanwhile.

werner claimed this task.

This was fixed in 2.2.24 with commit rG7f765a98fd662