Bug 136676 - Kmail doesn't ask for passphrase for GPG signed message
Summary: Kmail doesn't ask for passphrase for GPG signed message
Status: RESOLVED DUPLICATE of bug 92619
Alias: None
Product: kmail
Classification: Applications
Component: encryption (show other bugs)
Version: 1.9.1
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-02 00:51 UTC by Lukas Polacek
Modified: 2007-09-14 12:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Polacek 2006-11-02 00:51:17 UTC
Version:           1.9.1 (using KDE KDE 3.5.2)
Installed from:    Gentoo Packages
Compiler:          gcc 3.3.6 
OS:                Linux

I have imported my friend's GPG key and signed it with my own key. When the passphrase for my key is empty, the message from my friend is encrypted correctly. But when I change the password for my key to some non-empty string, the message is unencrypted. I think there should appear some pop-up window asking for passphrase.

Kmail displays this:
Encrypted message (decryption not possible)
Reason: Crypto plug-in "openpgp" could not decrypt the data.
Error: Bad passphrase

It says "Bad passphrase", but it didn't ask for any passhprase.
Comment 1 Lukas Polacek 2006-11-02 00:54:40 UTC
Oh, I should have written decrypted instead of encrypted.
Comment 2 Lukas Polacek 2006-12-31 15:51:30 UTC
I have made this work according to this page: http://gentoo-wiki.com/HOWTO_KMail_gpg-agent_kde. I have created directories .kde/env and .kde/shutdown with files that start gpg-agent --daemon. And finally pinentry asks for passphrase.

Why doesn't KMail handle this? Why do I have to start gpg-agent by myself?
Comment 3 Andreas Schallenberg 2007-01-09 19:57:41 UTC
Currently I get the same message as shown in the
initial comment.
I wonder why KMail tells me that the passphrase is
wrong when it doesn't display any dialog to ask for one?
Shouldn't it at least tell me something like
"gpg agent is not running" / "can't ask you for passphrase"?
Comment 4 Andreas Schallenberg 2007-01-09 19:59:08 UTC
BTW: the agent seems to run:

# ps -Aef | grep agent
andreas   4085     1  0 18:19 ?        00:00:00 gpg-agent --daemon
...

Comment 5 Andreas Schallenberg 2007-01-09 23:25:51 UTC
The problem here was an old "pinentry-program" entry in
gpg-agent.conf.

What does KMail get from gpg-agent when the passphrase
dialog was not displayed? Does gpg-agent report the situation
correctly (something like "I couldn't ask for passphrase")
or does gpg-agent tell KMail that the phrase was wrong?
In the second case it would be an gpg-agent bug, not a KMail
one...
Comment 6 Henrik Pauli 2007-03-24 00:24:28 UTC
The funny thing is, it works on one user on my computer (without gpg-agent) and not for the other!  Same settings for KMail, a working 1024D/2048g key-pair for each, and it just doesn't ask for passphrase on encrypted messages, only at signing.  And there're no problems with the other account...  What the...
Comment 7 Andy Neitzke 2007-05-22 05:06:09 UTC
I'm getting this problem too.  In my case it is a newly-installed system (Gentoo):  I started kgpg for the first time, imported some public and secret keys (copied from another machine), then tried to sign and encrypt a mail.  I got a dialog box saying "Signing failed: Bad passphrase", not preceded by any passphrase prompt.
Comment 8 Daniel Hahler 2007-05-22 21:09:57 UTC
Henrik, do your two users have different ~/.gnupg directories - I mean significant changes?
Comment 9 Daniel Hahler 2007-06-07 02:37:45 UTC
1. You need pinentry (e.g. pinentry-qt)
2. You need gpg-agent running
I see two bugs here:
1. The "wrong passphrase" error displayed in the header of the mail is wrong and misleading.
2. KMail should not depend on gpg-agent. It should rather fall back to the same dialog, that gets used when encrypting a mail:
  "Passphrase Dialog - KMail"
  You need a passphrase to unlock the secret key for user:
  KEYID User Name

  This dialog will reappear every time the passphrase is needed.
  ...
  For information on how to set up gpg-agent, see
  http://kmail.kde.org/kmail-pgpmime-howto.html
2a: There seem to be two different pinentry objects used internally: one for encrypting and one for decrypting. I've noticed this, because I had to re-type the password when encrypting while I just had typed it for decryption. After it had been entered for "both use cases", it was not required again.


If you have further problems, please report what gets displayed on the konsole, when you start kmail from there and then access an encrypted mail.
This might be "gpgme_op_decrypt_verify() returned this error code:  117440523" - that's what I was getting when I removed pinentry/gpg-agent.

I suggest using e.g. "keychain", see http://www.gentoo.org/proj/en/keychain/.
Please try keeping this bug item about (fixing) the bug - there should be enough workarounds posted now already.
Comment 10 Thomas McGuire 2007-06-30 14:51:49 UTC

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