After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 220624 - PGP/GPG inline signed messages incorrectly handled
PGP/GPG inline signed messages incorrectly handled
Status: RESOLVED DUPLICATE of bug 217540
Product: evolution
Classification: Applications
Component: Mailer
pre-1.5 (obsolete)
Other other
: Normal critical
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
Depends on: 218935
Blocks:
 
 
Reported: 2002-02-16 16:52 UTC by Tomas Cernaj
Modified: 2002-10-06 23:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch as mentioned above (2.49 KB, patch)
2002-02-17 21:36 UTC, Tomas Cernaj
none Details | Review
patch sent to evolution-patches (2.79 KB, patch)
2002-02-23 03:01 UTC, Tomas Cernaj
none Details | Review

Description Tomas Cernaj 2002-02-16 16:52:04 UTC
Description of Problem:
When evo wants to display/check a clearsigned pgp/gpg message, it splits up
the message internally into fake MIME parts (text and signature). The text
part needs to be transformed according to rfc2440, i.e. the line breaks
have to be converted to CRLF and the dash escaped text has to be restored. 

Citing rfc2440, p. 48:
    The message digest is computed using the
    cleartext itself, not the dash escaped form.

This is _not_ being done in evolution. This behavior breaks the signature
check of Debian Security Announcement mails, for example. 

Another obsacle in correctly verifying inline signed messages is the
incorrect header removal, as described in bug 218935. (I already have a fix
which I will attach soon there)


Steps to reproduce the problem:
1. See if you have a inline signed message containing lines beginning with
a dash.

Actual Results:
The signature doesn't get verified correctly.

Expected Results:
It should. Checking the message by feeding it manually as a whole into gpg
shows that the signature is correct.

How often does this happen? 
- When a line inside the message begins with a dash (see above)
- With versions 2.X of PGP (see bug 218935)

Additional Information:
I marked the bug critical for the same reasons as bug 216738 was.
Comment 1 Tomas Cernaj 2002-02-16 19:32:44 UTC
Proposed fix:

The dash escaped body has to be restored to its original (not dash
escaped) form inside the function try_inline_pgp_sig(...)
(mail/mail-format.c:1369) so that it also gets displayed properly.
Right now evo displays the message in dash escaped form to the user.

At the point where the fake MIME parts get created inside
try_inline_pgp_sig() the message text should be converted, so that it
gets displayed correctly and handle_multipart_signed(...) also gets
the right message text to verify.
Comment 2 Jeffrey Stedfast 2002-02-16 21:17:53 UTC
if you had looked at camel-pgp-mime.c, you'd have seen that the text
does indeed get converted to it's canonical EOLN format (CRLF).

this is not the problem.

There are other reports of problems so I'm not going to bother keeping
this one around.
Comment 3 Tomas Cernaj 2002-02-16 23:10:27 UTC
I'm sorry if you misunderstood me (sorry for my bad english...), but
the problem is (as I thought I've made clear) is the dash escaped
message, not the line breaks (they are all right). 

I've examined the data sent to gpg with a wrapper script. Evolutions
output is perfectly converted to CRLF, but lines starting with a '-'
were still escaped with a dash and a space ('- '), as described in
rfc2440. However, since evo uses this "inline-pgp-hack", this escape
must be reverted. 

I removed the leading dash and space in evolution's output and feeded
it manually to gpg, and the signature was correctly verified.

Concerning the above proposed fix:
I don't want to change how or where the line breaks get converted to
CRLF. I just wanted to point out that what gpg will compare with the
signature is the non-dash-escaped message, and the conversion could be
done right in try_inline_pgp_sig(...), so that (besides fixing the
bug) the user would see a clean message.

(This is definitely a bug, so I've reopend it.)
Comment 4 Jeffrey Stedfast 2002-02-16 23:50:21 UTC
okay, now I understand what you are saying.
Comment 5 Tomas Cernaj 2002-02-17 21:36:06 UTC
The following attachment contains a fix for this bug. It contains the
patch id=1427 from bug 218935.
Comment 6 Tomas Cernaj 2002-02-17 21:36:54 UTC
Created attachment 41055 [details] [review]
proposed patch as mentioned above
Comment 7 Tomas Cernaj 2002-02-23 03:01:51 UTC
Created attachment 41069 [details] [review]
patch sent to evolution-patches
Comment 8 Jeffrey Stedfast 2002-03-15 00:47:49 UTC

*** This bug has been marked as a duplicate of 217540 ***
Comment 9 Jeffrey Stedfast 2002-10-06 23:05:06 UTC
btw, this patch is wrong.

in some recent bug or maybe it was the gnupg mailing list, but anyways
 -I'v seen th following:


----- BEGIN PGP SIGNED MESSAGE -----


Hash: sha1

<content>
...



notice that there are multiple line breaks between the PGP boundary
and the hash header.

The only thing I can think of is to keep eating lines till we find a
Hash: header or until we get to the signature boundary. If we get to
the signature boundary, then we need to start with the line following
the BEGIN pgp boundary.