Page MenuHome GnuPG

GnuPG: misleading error message keytocard
Closed, ResolvedPublic

Description


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

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 [...]
[GNUPG:] PINENTRY_LAUNCHED 24023 qt [...]
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:

[GNUPG:] PINENTRY_LAUNCHED 25739 [...]
[GNUPG:] SC_OP_FAILURE 2
gpg: KEYTOCARD failed: Bad PIN

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

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.