Bug 134907 - No longer able to decrypt GPG IMs
Summary: No longer able to decrypt GPG IMs
Status: RESOLVED FIXED
Alias: None
Product: kopete
Classification: Unclassified
Component: Cryptography Plugin (show other bugs)
Version: unspecified
Platform: Ubuntu Packages Linux
: NOR normal with 110 votes (vote)
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords:
: 140955 141171 141857 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-09-30 17:39 UTC by doc.evans
Modified: 2008-03-12 12:52 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
console ouput from Kopete (48.57 KB, text/plain)
2007-02-18 12:57 UTC, dr.iq
Details
Decrypt sent and incoming messages in aboutToDisplay slot (2.51 KB, patch)
2007-04-08 10:39 UTC, Ayran
Details
Dirty hack to make history viewer decrypt and display logged messages (4.81 KB, patch)
2007-04-08 14:12 UTC, Ayran
Details

Note You need to log in before you can comment on or make changes to this bug.
Description doc.evans 2006-09-30 17:39:23 UTC
Version:           0.12.1 (using KDE KDE 3.5.4)
Installed from:    Ubuntu Packages
OS:                Linux

Kubuntu updated kopete a few days ago, and now incoming GPG IM messages are no longer properly decrypted.

I have tested by firing up Psi and using the same key, and messages coming in to Psi are decrypted properly. Then when I close Psi and start kopete and have someone send me an encrypted message, all I see is something like this:
 -----BEGIN PGP MESSAGE-----

hQIOA3GKls6EdHUCEAf/WMBKNvewC8owZl8mTqkFQbXfynpzYsoOYEv4Gmv3hsrz
nsjeCfGOmjzUn2x1kLWImUX/0z2mSX9a59+n25AujGnAlD7FM9RmhqRNMM8sVmfc
w05OaURNTmoCD620tiGe/762Irnu/arG20Ga9nb4d9gJ2XSFJiS3xX8ik5lpT8pr
QvSoYJxhNtuOuWeEQsYO/KfQWMDwonXFT53SajHFdYFt+racOva2WRm2HUVUa38N
fsebU79hX6TPqYo4lkmA9ydSw3uuC6R6HyH1W6EQ/fc+BUf5s2P4eBac7/bsomY5
dxTknSfOJQNrtBUlX59RrTnBcPSf3SRhSvvxueTEJAf/bvwwqH6DGHwTSnJnLLiP
jB8YISYY8nB0rAeyLIG1P9i2ATqks11T6oHxgoQnOkQARtV1AhSp4U3rYG2pYoIk
Rx+nCkPHSdTnRnYniuJXH1Xinjooo7hJBZqKGvseSePosakhBDGdiS7eWPFZQwSn
Jis6diAS3GAAy0bZ9mUFbaUhnQiZ/Lh3GPY3GPPBllLe5Qm10qWSXBCDB6T4iFpp
C7LbO4HJWwZUyXyJzyA+G7T40kLnqw+o6Nz3o3KAenhonWTBPpSwFNMxKtQklZQt
L53KnE5BN7i0fqM0rOx6q+DFFoj91sgUoToGqlFhyfYyvtaJdx/zaDJm8ZiVWSGX
dMkZmWLT7/3wawaQqWpuaUuETSxkd2IM6GJ3bQ==
=+Z/+
-----END PGP MESSAGE-----

instead of the decrypted message.

This all worked fine until a few days ago.
Comment 1 Helmut Pozimski 2007-01-26 21:31:45 UTC
I have a similiar problem on Debian Sarge with Kopete 0.12.3 and KDE 3.5.5, I get the following on commandline from gpg: "gpg: Sorry, no terminal at all requested - can't get input" 
Comment 2 Helmut Pozimski 2007-01-26 21:57:33 UTC
I recently found a similiar bugreport in the debian bugtrackung system: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=137317#5 it's not about kopete but the hint in the report does is also a possible workaround for kopete. So I changed my settings in kopete from "save until kopete gets terminated" to "save for 15 minutes" and yeah, it works. If you set the time to a higher value it will have nearly the same effect and will work until the bug gets fixed.
Comment 3 uran238 2007-01-27 19:13:58 UTC
I upgraded to KDE-3.5.6 (Gentoo split ebuilds) and i cannot decrypt encrypted messages anymore. I still can encrypt messages, they are written in cyphertext to the message Window (and log), not in plaintext as before. 
Only tested the jabber transport. After a downgrade to the old version of kopete, but still with new kdelibs, it worked again.
Comment 4 Torben Keßler 2007-01-28 21:42:39 UTC
The same thing happens with Kopete 0.12.4, KDE-3.5.6 "release 19.1" and OpenSuSE.
The mentioned workaround doesn't help me.
Comment 5 kde 2007-01-29 00:30:19 UTC
*** This bug has been confirmed by popular vote. ***
Comment 6 Bram Schoenmakers 2007-02-04 17:44:42 UTC
*** Bug 141171 has been marked as a duplicate of this bug. ***
Comment 7 dr.iq 2007-02-18 12:57:43 UTC
Created attachment 19727 [details]
console ouput from Kopete

This is Kopete's output from sending and receiving one encrypted message. The
other client is Gajim.
Comment 8 Matt Rogers 2007-02-18 17:06:56 UTC
*** Bug 141857 has been marked as a duplicate of this bug. ***
Comment 9 bauerfichtner 2007-02-19 15:34:58 UTC
To me, it seems as if the last change in plugins/cryptography/cryptographyplugin.cpp causes the trouble. I replaced this file because I wanted to test the patch from http://www.kde-apps.org/content/show.php?content=40844 with Kopete 0.12.4 
This resulted in having a working cryptography-plugin with Kopete's latest svn.

Could someone please check this?
Comment 10 Jörg Hermsdorf 2007-02-26 15:27:37 UTC
Subscribing to this thread...
Same problem here with Kopete 12.4 (KDE 3.5.6 "release 31.2" openSUSE 10.2).
Comment 11 Simon Braunstein 2007-02-27 17:51:47 UTC
Just a me too, Kopete 0.12.4 (KDE 3.5.6, x86 gentoo), chat-window neither decrypt own writen text nor decrypt incomming messages.
Comment 12 Hanns-Martin Kreie 2007-02-28 16:47:19 UTC
See http://bugs.kde.org/show_bug.cgi?id=134907 ... this should be the same issue.
Comment 13 Hanns-Martin Kreie 2007-02-28 16:49:18 UTC
Ok... sorry for the spam. http://bugs.kde.org/show_bug.cgi?id=140955 of course. 
Comment 14 Philip Rodrigues 2007-03-01 23:45:57 UTC
*** Bug 140955 has been marked as a duplicate of this bug. ***
Comment 15 Gehold Bertin 2007-03-22 20:20:44 UTC
Some problem!

But: I can send encrypt messages... There are okay, but I see only encrypted text!

And the preview (the yellow info popup) does show the decrypted text...

So I would say, it is only a bug in chat window...

Please fix it fast.

Thanks a lot!
Comment 16 Gehold Bertin 2007-03-22 20:23:20 UTC
Information from http://bugs.kde.org/show_bug.cgi?id=140955

------- Additional Comment #2 From Ralf Hildebrandt 2007-01-31 15:44 -------
I manually reverted to kopete 3.5.5+kopete0.12.3-0ubuntu1 and voila, crypto works like a charm again. Make of that what you want :)

------- Additional Comment #3 From Hanns-Martin Kreie 2007-02-01 16:22 -------
I guess the following diff (taken from gentoo work directories) could explain why...
--- kopete-3.5.5-r2/work/kopete-3.5.5/kopete/plugins/cryptography/cryptographyp$
+++ kopete-3.5.6/work/kopete-3.5.6/kopete/plugins/cryptography/cryptographyplug$
@@ -58,8 +58,9 @@
        if( !pluginStatic_ )
                pluginStatic_=this;
-       m_inboundHandler = new Kopete::SimpleMessageHandlerFactory( Kopete::Mes$
-               Kopete::MessageHandlerFactory::InStageToSent, this, SLOT( slotI$
+       m_inboundHandler = 0;
+/*     m_inboundHandler = new Kopete::SimpleMessageHandlerFactory( Kopete::Mes$
+               Kopete::MessageHandlerFactory::InStageToSent, this, SLOT( slotI$
        connect( Kopete::ChatSessionManager::self(),
                SIGNAL( aboutToSend( Kopete::Message & ) ),
                SLOT( slotOutgoingMessage( Kopete::Message & ) ) );
Is there a special reason for this? Another way of handling messages? Or is this just an erroneous change?

------- Additional Comment #4 From Hanns-Martin Kreie 2007-02-01 17:06 -------
Reversing this (putting the handler line in kopete/plugins/cryptography/cryptographyplugin.cpp back in) makes kopete handle encrypted messages correctly again, without anything blowing up immediately.
Comment 17 Gehold Bertin 2007-03-22 20:24:05 UTC
My system information

KDE Version 	0.12.4 (KDE 3.5.6, Kubuntu (edgy) 4:3.5.6-0ubuntu1~edgy1)
	Application 	Instant messaging client
	Operating System 	Linux (i686) release 2.6.17-11-generic
	Compiler 	Target: i486-linux-gnu
Comment 18 Ayran 2007-04-08 10:27:41 UTC
This is the SVN log. Does anybody understand this?

r605617 | wstephens | 2006-11-17 15:45:37 +0100 (Fri, 17 Nov 2006) | 1 line

Start sending keepalives as the upcoming SP2 requires them
Comment 19 Ayran 2007-04-08 10:39:19 UTC
Created attachment 20211 [details]
Decrypt sent and incoming messages in aboutToDisplay slot

This patch decrypts sent and incoming messages in the aboutToDisplay slot.
A further improvement is that an "encrypted"-icon is shown in front of
messages, if they are sent or received encrypted.
You should check the "Encrypt messages with this key" in the plugin's prefs to
be able to read what you sent.

One problem is that the history plugin only shows the encrypted messages.
Should a decrypted message be somehow given to the history logger or should the
history display decrypt these messages itself?
Further I would like to see some error message in the chat window instead of
the plain unencrypted message in case the message cannot be decrypted.
Comment 20 Gehold Bertin 2007-04-08 10:51:16 UTC
An icon would be very nice!

And if kopete could use penetry that would be great.

I would prefere an encrypted history, that could decrypt messages

Thanks a lot!
Comment 21 Ayran 2007-04-08 14:12:16 UTC
Created attachment 20213 [details]
Dirty hack to make history viewer decrypt and display logged messages

Hi again,

I quickly wrote a hack to allow decryption and display of encrypted history.
It's really dirty (linking against the crypto plugin and code duplication) and
stuff so I'd suggest someone refactors this before committing upstream.

Could some common parts be factorized out somehow? Can we use some already
existing crypto api for crypt/decrypt/password-caching? Calling gpg for each
message is really slow.

Adam
Comment 22 Gehold Bertin 2007-04-08 17:55:09 UTC
There is a password caching, but for encrypting and decrypting with gpg, you have to call gpg ;-)
Comment 23 Ayran 2007-04-09 12:39:41 UTC
Hm, after all I do not think it is a good idea to store your GPG passphrase inside a possibly quite insecure instant messenger. I'd port it to use gpg-agent if I had time... maybe we can borrow some code from kgpg.
Comment 24 Douglas E. Warner 2007-04-09 13:11:45 UTC
Bug 138476 is already about adding GPG-agent and pinentry support for Kopete; please let this bug just about getting the crypto plugin working like it had in the past.
Comment 25 Daniel Hahler 2007-04-21 22:23:23 UTC
Please consider this fix for KDE 3.5.7.
Comment 26 Olivier Goffart 2007-05-06 12:06:39 UTC
SVN commit 661656 by ogoffart:

Revert the commit that broke the cryptography plugin in the previous Kopete version

BUG: 134907






 M  +2 -3      cryptographyplugin.cpp  


--- branches/KDE/3.5/kdenetwork/kopete/plugins/cryptography/cryptographyplugin.cpp #661655:661656
@@ -58,9 +58,8 @@
 	if( !pluginStatic_ )
 		pluginStatic_=this;
 
-	m_inboundHandler = 0;
-/*	m_inboundHandler = new Kopete::SimpleMessageHandlerFactory( Kopete::Message::Inbound,
-		Kopete::MessageHandlerFactory::InStageToSent, this, SLOT( slotIncomingMessage( Kopete::Message& ) ) );*/
+	m_inboundHandler = new Kopete::SimpleMessageHandlerFactory( Kopete::Message::Inbound,
+		Kopete::MessageHandlerFactory::InStageToSent, this, SLOT( slotIncomingMessage( Kopete::Message& ) ) );
 	connect( Kopete::ChatSessionManager::self(),
 		SIGNAL( aboutToSend( Kopete::Message & ) ),
 		SLOT( slotOutgoingMessage( Kopete::Message & ) ) );
Comment 27 maisieandme7 2008-03-12 12:52:04 UTC
Using Kopete 0.12.6 with KDE 3.5.8 r21.2 on openSuse 10.3, and this problem still seems to exist.  Is reverting to an earlier version the only solution?