From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mikhail Kryshen Newsgroups: gmane.emacs.bugs Subject: bug#14232: 24.3; PGP signatures in base64 encoded mail are incompatible with some MUAs. Date: Fri, 19 Apr 2013 07:14:09 +0400 Message-ID: <874nf3dxfi.fsf@kryshen.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1366343736 1644 80.91.229.3 (19 Apr 2013 03:55:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 19 Apr 2013 03:55:36 +0000 (UTC) To: 14232@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Apr 19 05:55:40 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UT2QG-00017s-0U for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Apr 2013 05:55:40 +0200 Original-Received: from localhost ([::1]:38619 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UT2QF-0003EY-Ey for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Apr 2013 23:55:39 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UT2QA-0003CO-0e for bug-gnu-emacs@gnu.org; Thu, 18 Apr 2013 23:55:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UT2Q7-0002je-JG for bug-gnu-emacs@gnu.org; Thu, 18 Apr 2013 23:55:33 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55421) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UT2Q7-0002ja-Fs for bug-gnu-emacs@gnu.org; Thu, 18 Apr 2013 23:55:31 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UT2UU-0000tD-Oi for bug-gnu-emacs@gnu.org; Fri, 19 Apr 2013 00:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mikhail Kryshen Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 19 Apr 2013 04:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 14232 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13663439653315 (code B ref -1); Fri, 19 Apr 2013 04:00:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Apr 2013 03:59:25 +0000 Original-Received: from localhost ([127.0.0.1]:59530 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UT2Ts-0000rQ-GJ for submit@debbugs.gnu.org; Thu, 18 Apr 2013 23:59:25 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57657) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UT1qu-0007oQ-GF for submit@debbugs.gnu.org; Thu, 18 Apr 2013 23:19:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UT1mS-0006ra-0V for submit@debbugs.gnu.org; Thu, 18 Apr 2013 23:14:36 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:35533) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UT1mR-0006rT-Tv for submit@debbugs.gnu.org; Thu, 18 Apr 2013 23:14:31 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UT1mO-0001IN-Mc for bug-gnu-emacs@gnu.org; Thu, 18 Apr 2013 23:14:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UT1mL-0006qE-Sz for bug-gnu-emacs@gnu.org; Thu, 18 Apr 2013 23:14:28 -0400 Original-Received: from mail.cs.karelia.ru ([194.85.173.9]:58197) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UT1mL-0006oV-Fr for bug-gnu-emacs@gnu.org; Thu, 18 Apr 2013 23:14:25 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.cs.karelia.ru (Postfix) with ESMTP id 85DD8A360E; Fri, 19 Apr 2013 07:14:12 +0400 (MSK) X-Virus-Scanned: amavisd-new at cs.karelia.ru Original-Received: from mail.cs.karelia.ru ([127.0.0.1]) by localhost (mail.cs.karelia.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SAc7NVCssYuE; Fri, 19 Apr 2013 07:14:10 +0400 (MSK) Original-Received: from localhost (epsilon.cs.prv [192.168.112.5]) by mail.cs.karelia.ru (Postfix) with ESMTP id 1E8C2A3608; Fri, 19 Apr 2013 07:14:10 +0400 (MSK) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Thu, 18 Apr 2013 23:59:23 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:73495 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable I use compose-mail and mml-secure-message-sign to send signed email. For messages that contain cyrillic characters Emacs by default uses utf-8 charset and base64 encoding. For such messages some MUAs (Mutt, Notmuch) report good signature and some (Sylpheed, Evolution) show bad signature for the same message. When quoted-printable encoding is used all MUAs show good signature (workaround: add (utf-8 . quoted-printable) to mm-body-charset-encoding-alist). When base64 encoding is used, the encoded data is separated from part boundary delimiter by a single (which is part of the delimiter) missing an additional to terminate the last line of the encoded data. I verified by manually editing raw email files and appropriately updating signatures that mentioned MUAs handle messages with a single between signed data and delimiter differently. This seems to be the cause of the problem. From=20RFC 2015 "MIME Security with PGP", page 4: When the PGP digital signature is generated: [skip] (2) An appropriate Content-Transfer-Encoding is then applied. Each line of the encoded data MUST end with the canonical sequence. From=20RFC 3156 "MIME Security with OpenPGP", page 5: When the OpenPGP digital signature is generated: [skip] (2) An appropriate Content-Transfer-Encoding is then applied; see section 3. In particular, line endings in the encoded data MUST use the canonical sequence where appropriate (note that the canonical line ending may or may not be present on the last line of encoded data and MUST NOT be included in the signature if absent). [skip] Note: The accepted OpenPGP convention is for signed data to end with a sequence. Note that the sequence immediately preceding a MIME boundary delimiter line is considered to be part of the delimiter in [3], 5.1. Thus, it is not part of the signed data preceding the delimiter line. An implementation which elects to adhere to the OpenPGP convention has to make sure it inserts a pair on the last line of the data to be signed and transmitted (signed message and transmitted message MUST be identical). So it seems to be correct and better for compatibility with other email clients to terminate the last line of base64 encoded data with . =2D- Mikhail In GNU Emacs 24.3.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.6.4) of 2013-04-19 on home Windowing system distributor `Fedora Project', version 11.0.11303000 Configured using: `configure '--host=3Dx86_64-redhat-linux-gnu' '--build=3Dx86_64-redhat-linux-gnu' '--program-prefix=3D' '--disable-dependency-tracking' '--prefix=3D/usr' '--exec-prefix=3D/usr' '--bindir=3D/usr/bin' '--sbindir=3D/usr/sbin' '--sysconfdir=3D/etc' '--datadir=3D/usr/share' '--includedir=3D/usr/include' '--libdir=3D/usr/lib64' '--libexecdir=3D/usr/libexec' '--localstatedir=3D/var' '--sharedstatedir=3D/var/lib' '--mandir=3D/usr/share/man' '--infodir=3D/usr/share/info' '--with-dbus' '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff' '--with-xft' '--with-xpm' '--with-x-toolkit=3Dgtk3' '--with-gpm=3Dno' 'build_alias=3Dx86_64-redhat-linux-gnu' 'host_alias=3Dx86_64-redhat-linux-gnu' 'CFLAGS=3D-DMAIL_USE_LOCKF -O2 -g'' Important settings: value of $LANG: ru_RU.utf8 value of $XMODIFIERS: @im=3Dibus locale-coding-system: utf-8-unix default enable-multibyte-characters: t --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) iEYEARECAAYFAlFwtoEACgkQlfZPsJRTN+OvBQCglipOt00ZQBGlneOBXGLAX/06 /1sAmQEgb27FrZl7nWkQaZZSFWbRDbKS =zr5/ -----END PGP SIGNATURE----- --=-=-=--