If one gives a wrong Admin PIN when moving a key to a smartcard the error message states "invalid secret key"
Expected: wrong PIN
Expected: wrong PIN
rG GnuPG | |||
rGf2a81e374501 gpg: Fix wrong error message for keytocard. | |||
rG189102ac17dc gpg: Fix wrong error message for keytocard. |
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