Encrypting/signing message with non-smartcard key fails with empty error message
OpenPGP addon for Mozilla Thunderbird
Brought to you by:
pbrunschwig
I have two keys in use: One is located on a smartcard, the other is located on hard disk. Both are correctly known to gpg (appearing in gpg2 --list-secret-keys).
Using the smartcard key is possible without any limitation in enigmail, however, using the "normal" key fails with an empty error message ("Error - encryption failed") where no reason is given. A debug log file is attachet, let me know if you need further information.
My smardcard reader is a Cherry KC 1000 SC keyboard with built-in smartcard slot. For smartcard operations, the PIN is read directly from the keyboard. Using the "normal" key in a terminal also works well so it seems to be related to Enigmail, and not to gpg2.
Example of the graphical error message.
Your problem is that GnuPG tries to use pinentry-curses. But that's a command-line tool that cannot be used via Thunderbird - you need to configure pinentry-gtk or pinentry-qt.
Edit the file
$HOME/.gnupg/gpg-agent.conf. Make sure that there is a configuration entry pinentry-program containing the full path to a graphical version of pinentry as above. E.g.:Thank you for the quick reply.
Adding
pinentry-program /usr/bin/pinentry-qt5to the ~/.gnupg/gpg-agent.conf and reloading the agent viaecho RELOADAGENT | gpg-connect-agentsolved the problem.