Page MenuHome GnuPG

GnuPG: misleading error message keytocard
Closed, ResolvedPublic


If one gives a wrong Admin PIN when moving a key to a smartcard the error message states "invalid secret key"

Expected: wrong PIN

Related Objects

Event Timeline

werner triaged this task as Normal priority.Aug 4 2022, 12:07 PM
werner added projects: gnupg (gpg22), Bug Report.

The problem seems to be that we don't return a status code with the
actual error via the --command-fd interface:

gpg: pinentry launched [...]
gpg: KEYTOCARD failed: Bad PIN

On the command line the correct code is returned. (tested with master)

With my patch I see the expected status message:

gpg: KEYTOCARD failed: Bad PIN

We need to check whether GPGME/kleopatra sees this too.

werner added a project: Restricted Project.Aug 4 2022, 12:46 PM

Looks good. After entering a wrong passphrase three times Kleopatra now reports

Moving the key to the card failed: Bad passphrase
werner claimed this task.
werner removed a project: Restricted Project.