Bug 191495

Summary: Kmail + GnuPG bad passphrase
Product: [Applications] kmail Reporter: Krisztián Kádár-Németh <krisztian.kad>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: NOR    
Version: 1.11.2   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description Krisztián Kádár-Németh 2009-05-03 18:52:35 UTC
Version:           1.11.2 (using 4.2.2 (KDE 4.2.2), Mandriva Linux release 2009.1 (Cooker) for i586)
Compiler:          gcc
OS:                Linux (i686) release 2.6.29.1-desktop-4mnb

When I try to sign a letter electronically with Kmail, it ALWAYS gives the error message: "Could not sign: Bad passphrase", but never asks the passphrase itself neither before, nor after this error message!

When I open Kleopatra and try to change the passphrase or edit my key somehow, I get this error message (without asking any passphrase at all):

An error occurred while trying to change the passphrase.
The output from /usr/bin/gpg was: Secret key available. pub 1024D/57D8BA4F created: 2008-03-20 expires: never usage: SCA trust: ultimate validity: ultimate sub 2048g/E22E3D6E created: 2008-03-20 expires: never usage: E [ultimate] (1). Kádár-Németh Krisztián The key is protected. gpg: can't query passphrase in batch mode I cannot edit this key: bad passphrase. The key was not changed, there is no need for a refresh. 

I tried to use the workaround (defining a gpg-agent with pinentry-qt or pinentry-gtk2) described in this forum (http://forum.kde.org/kmail-and-gpg-t-33189.html), but I got the following error message:

An error occurred while trying to change the passphrase.
The output from /usr/bin/gpg was: gpg: WARNING: unsafe enclosing directory permissions on configuration file `/home/username/.gnupg/gpg.conf' Secret key available. pub 1024D/57D8BA4F created: 2008-03-20 expires: never usage: SCA trust: ultimate validity: ultimate sub 2048g/E22E3D6E created: 2008-03-20 expires: never usage: E [ultimate] (1). Kádár-Németh Krisztián The key is protected. gpg: no gpg agent is avilable in this process. gpg: can't query passphrase in batch mode gpg: bad passphrase. Try again... gpg: can't query passphrase in batch mode gpg: bad passphrase. Try again... gpg: can't query passphrase in batch mode I cannot edit this key: bad passphrase. The key was not changed, there is no need for a refresh.

The same problem is described in the Debian bug tracking system:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=523354

Installed GnuPG elements:
GnuPG 1.4.9
gpg-agent 2.0.11
Comment 1 Jaime Torres 2009-05-04 16:18:50 UTC
Also look at bug 167960, bug 190158 and bug 190144.
Comment 2 Krisztián Kádár-Németh 2009-05-06 14:39:30 UTC
Sorry, I should have searched the bugs more carefully.

*** This bug has been marked as a duplicate of bug 167960 ***