Bug 16362 - gpg: only latin1 messages can be signed correctly
Summary: gpg: only latin1 messages can be signed correctly
Status: CLOSED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: general (show other bugs)
Version: 1.2
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2000-12-01 17:33 UTC by Ingo H. Kl
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 Ingo H. Kl 2000-12-01 17:27:20 UTC
(*** This bug was imported into bugs.kde.org ***)

Package: kmail
Version: 1.2 (KDE 2.0)
Severity: normal
Compiler: gcc version 2.95.2 19991024 (release)
OS: Linux 2.2.14 i686 (compiled sources)

KMail version: current cvs

To reproduce this bug reply to the mail "Bug#16282: Encoding in composer" by Michael Haeckel (Nov 30 19:12:13).
This mail uses koi8-r as charset. If you reply to this mail (and quote its contents) and then send it (or save it in the drafts folder) with enabled "sign message" button you will observe that the sent/saved message is broken.
The problem seems to be that the message is passed to gpg via the following code line:

write(pin[1] input.data() input.length());

If you have a look at qstring.h you will see that (the undocumented) QString::data() returns QString::latin1().
But obviously koi8-r and latin1 are not compatible. Therefore all russian characters are converted to \0.
This has two effects:
1.) The signature is worth nothing because a latin1 version of the koi8-r message is signed.
2.) When the output of gpg (that is the signed message) is read it is truncated at the first \0.

Next week I will try to find a solution for this problem.

Regards
Ingo
Comment 1 Michael Haeckel 2000-12-03 10:08:56 UTC
On Saturday  2. December 2000 23:12 I wrote:
>
> There was a conflict with my question marks warning dialog. It just warned
> me for example as I tried to write my name with an umlaut which is not in
> koi8-r.
>
> Here is an updated version. It mainly should be taken sure that it doesn't
> break any PGP functionality for latin-1 since I really don't use PGP.
>
> BTW: I fixed in CVS a crash that appeared when the user tries to attach
> his public key and doesn't have one for the selected identity. Is it really
> correct that is takes the key for the e-mail address in the from field
> since signing for example seems to use the pgp identity specified in the
> configure dialog?

I just committed it to prevent further merging problems. If someone finds a 
problem with this change then please tell me.

Regards
Michael Häckel