Bug 66515 - encrypted offline messages can't be decrypted: passphrase isn't accepted.
Summary: encrypted offline messages can't be decrypted: passphrase isn't accepted.
Status: RESOLVED INTENTIONAL
Alias: None
Product: kopete
Classification: Applications
Component: Cryptography Plugin (show other bugs)
Version: 0.7.3
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-24 20:37 UTC by Gilles Schintgen
Modified: 2003-11-14 22:41 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 Gilles Schintgen 2003-10-24 20:37:34 UTC
Version:           0.7.3 (using KDE KDE 3.1.3)
Installed from:    Compiled From Sources
Compiler:          gcc 3.2.3 
OS:          Linux

If I receive an encrypted *offline* message from an icq contact (I haven't yet tested with other protocols) I can't decrypt it. Kopete asks for the passphrase but rejects it. I typed it correctly, of course. After the third time it shows a dialog where I hit cancel and it proceeds to show the message... in its encrypted form!
However sending and receiving encrypted messages with this particular contact works perfectly when we are both online for some time and then start to chat. The problem only affects messages which wait for me on the server until I log in the next time. Every such offline message is affected, so it's perfectly reproducible. (At least for me).
The same problem also arises on my Mandrake system with kopete 0.7.2.
Comment 1 Olivier Goffart 2003-10-28 19:27:17 UTC
Then it's an ICQ bug.

ICQ seems to modify the message.  (adding a line break is enough to make the message undecryptable)
Comment 2 Stefan Gehn 2003-11-11 21:06:07 UTC
Without more information this bug will stay in the bugs db forever :(
Comment 3 Olivier Goffart 2003-11-11 21:28:55 UTC
Could you check if the message is exactly the same as the one which has been send while offline messaging.
It could be an error at the Kopete level, or even an error on the server.
in the case of an error on the server, i doubt we can do anything.
Comment 4 Gilles Schintgen 2003-11-14 16:07:48 UTC
In fact, later I also got the message when I was already online and someone started a conversation with an encrypted message (yet, not always). Unfortunately I don't recall exactly in what cases and with which protocols what happened. I know, I should have taken note and be more precise. An additional complication was that some buddies use psi and some kopete.
The dialog box kopete showed me was always the same. However, I can't give you the exact message, because, well, at the moment I'm using licq...
The dialog always gave me 3 tries to enter my passphrase. After the third try (as I said, it always rejected the passphrase) Kopete just showed the encrypted message.
Hmm, I'm not so sure that the dialog always indicated my key-id or if it sometimes indicated [unknown key] or something similar.
Another strange thing that I should have mentioned is that when I copied the encrypted message to the kgpg editor to decrypt it manually kgpg always complained that it couldn't detect the correct key to decrypt the message. I haven't tried with gnupg at the command line to see whether I could indicate the key manually. I always asked my correspondent to resend the message. I'll have a look at my message history to see if I can decrypt these messages at all.
I'm wondering if no one else is having trouble with gnupg-encryption?
Comment 5 Gilles Schintgen 2003-11-14 16:23:31 UTC
I just checked some of the messages in my history. There were some messages where a misconfigured client at the other side was the problem... Command line gpg told me my correspondent had encrypted the message with his own key. Doh.
Those were transmitted with Jabber but I don't think this matters any longer.
And then there were others where kgpg and gpg detected the correct gpg-key, but they couldn't be decrypted because they were truncated. There was no
-----END PGP MESSAGE-----
line.
These messages were sent by kopete over the icq network. Perhaps this could be the root of the problem. Isn't there a limit on the length of a message in the icq protocol? At least licq splits longer messages (for technical reasons I think).
Most of the messages are however on another computer to which I don't have access just now. Later (today or tomorrow) I'll also have a look at those messages.
Hopefully I can track this problem down. I'd really like to use kopete as my only IM client.
Comment 6 Olivier Goffart 2003-11-14 16:48:34 UTC
Maybe the ICQ server does not accept too big messages... (encrypted message are big)

In that case, i can't do anything, and the bug will never been fixed.
Comment 7 Jason Keirstead 2003-11-14 18:21:08 UTC
Subject: Re: [Kopete-devel]  encrypted offline messages can't be decrypted: passphrase isn't accepted.

On November 14, 2003 11:48 am, Olivier Goffart wrote:
> -------
 Maybe the ICQ server does not accept too big messages..

Yes,  OSCAR has a message limit size. That is why licq breaks long messages up 
into several smaller ones (weather or not this is a good solution is another 
question ).

There is actually already a bug on this, can't find it though.

Comment 8 Gilles Schintgen 2003-11-14 21:29:57 UTC
Ok, here's the cause of the problem:
ICQ - Exchange messages - privately, securely, instantly! Messages to your online friends can be any length, while messages to offline users can be a maximum of 450 characters.
(http://www.icq.com/features/)

This makes it clear why offline messages tend to be the ones to be crippled. In my history, the other messages I couldn't read were the ones where a misconfiguration was the cause.
Comment 9 Olivier Goffart 2003-11-14 22:41:01 UTC
Then i can't do anything.

What i will do is to say to the crypto plugin that it does not need to try to decrypt the message if the ----END PGP MESSAGE-- is not there
 
Comment 10 Olivier Goffart 2003-11-14 23:01:32 UTC
Subject: kdenetwork/kopete/plugins/cryptography

CVS commit by ogoffart: 

Do not try to decrypt a Crypted message if we don't have the whole message.

CCMAIL: 66515@bugs.kde.org


  M +6 -5      cryptographyplugin.cpp   1.40


--- kdenetwork/kopete/plugins/cryptography/cryptographyplugin.cpp  #1.39:1.40
@@ -133,5 +133,6 @@ void CryptographyPlugin::slotIncomingMes
 {
         QString body = msg.plainBody();
-        if( !body.startsWith( QString::fromLatin1("-----BEGIN PGP MESSAGE----") ) )
+        if( !body.startsWith( QString::fromLatin1("-----BEGIN PGP MESSAGE----") )
+                 || !body.contains( QString::fromLatin1("-----END PGP MESSAGE----") ) )
                 return;