From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/61920 Path: news.gmane.org!not-for-mail From: Daiki Ueno Newsgroups: gmane.emacs.gnus.general,gmane.mail.mh-e.devel Subject: Re: Gnus 5.10.6 problems with PGP/MIME (test cases) Date: Thu, 09 Feb 2006 14:29:04 +0900 Message-ID: <0aaad4b2-f405-40ed-8811-40d09e5772ab@well-done.deisui.org> References: <19643.1137028354@juniper.net> <73630.1137440939@juniper.net> <31430.1137488443@juniper.net> <85906.1137521874@juniper.net> <53032.1137578648@juniper.net> <8b63142a-b090-4783-a3a5-0832d7289f38@well-done.deisui.org> <26653.1139305204@juniper.net> <9bda6607-510b-468c-bd1e-ec9b8865cdd2@well-done.deisui.org> <15566.1139355525@juniper.net> <7334ab51-5c86-4d97-92cb-21f2e7debd8d@well-done.deisui.org> <086fafe1-6999-41f0-8a3d-cf042757aeef@well-done.deisui.org> <89375.1139412469@juniper.net> <82f83936-8fb8-44a4-bb15-949ca44b6e72@well-done.deisui.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Thu_Feb__9_14:29:04_2006-1" X-Trace: sea.gmane.org 1139462907 1847 80.91.229.2 (9 Feb 2006 05:28:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 9 Feb 2006 05:28:27 +0000 (UTC) Cc: ding@gnus.org, mh-e-devel@lists.sourceforge.net Original-X-From: ding-owner+m10449@lists.math.uh.edu Thu Feb 09 06:28:23 2006 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F74Lt-00051w-EN for ding-account@gmane.org; Thu, 09 Feb 2006 06:28:22 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1F74Lq-00037R-00; Wed, 08 Feb 2006 23:28:18 -0600 Original-Received: from nas01.math.uh.edu ([129.7.128.39]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1F74Lj-00037M-00 for ding@lists.math.uh.edu; Wed, 08 Feb 2006 23:28:11 -0600 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas01.math.uh.edu with esmtp (Exim 4.52) id 1F74Lh-0003u4-Ak for ding@lists.math.uh.edu; Wed, 08 Feb 2006 23:28:11 -0600 Original-Received: from g96069.scn-net.ne.jp ([210.231.96.69] helo=well-done.deisui.org) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1F74Lf-0006vY-00 for ; Thu, 09 Feb 2006 06:28:08 +0100 Original-Received: from localhost ([127.0.0.1] helo=well-done.deisui.org) by well-done.deisui.org with esmtp (Exim 4.60) (envelope-from ) id 1F74Le-0008TF-Fc; Thu, 09 Feb 2006 14:28:06 +0900 Original-To: "Mark D. BaTo: Mark D. Baushke" , Katsumi Yamaoka X-Attribution: DU In-Reply-To: <82f83936-8fb8-44a4-bb15-949ca44b6e72@well-done.deisui.org> (Daiki Ueno's message of "Thu, 09 Feb 2006 14:24:55 +0900") User-Agent: T-gnus/6.17.3 (based on No Gnus v0.3) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 XEmacs/21.4.17 (i386-debian-linux) MULE X-Spam-Score: -2.5 (--) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:61920 gmane.mail.mh-e.devel:11610 Archived-At: --Multipart_Thu_Feb__9_14:29:04_2006-1 Content-Type: text/plain; charset=US-ASCII >>>>> In <82f83936-8fb8-44a4-bb15-949ca44b6e72@well-done.deisui.org> >>>>> Daiki Ueno wrote: > I forgot this effect of --textmode. Then, no API compatibility issue > should arise as long as pgg-text-mode is set properly. The attached > patch should be sufficient for Gnus. Sorry I forgot to attatch the patch. --Multipart_Thu_Feb__9_14:29:04_2006-1 Content-Type: application/octet-stream; type=patch Content-Disposition: attachment; filename="pgg-text-mode.diff" Content-Transfer-Encoding: 7bit Index: lisp/ChangeLog =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/ChangeLog,v retrieving revision 7.988 diff -u -r7.988 ChangeLog --- lisp/ChangeLog 8 Feb 2006 12:05:31 -0000 7.988 +++ lisp/ChangeLog 8 Feb 2006 23:51:13 -0000 @@ -1,3 +1,18 @@ +2006-02-08 Daiki Ueno + + * pgg-gpg.el (pgg-gpg-encrypt-region): Don't convert line-endings + in elisp. + (pgg-gpg-encrypt-symmetric-region): Ditto. + (pgg-gpg-sign-region): Ditto. + + * pgg-def.el (pgg-text-mode): New variable. + + * mml2015.el (mml2015-pgg-sign): Enable pgg-text-mode. + (mml2015-pgg-encrypt): Ditto. + + * mml1991.el (mml1991-pgg-sign): Enable pgg-text-mode. + (mml1991-pgg-encrypt): Ditto. + 2006-02-08 Katsumi Yamaoka * rfc2231.el (rfc2231-parse-string): Sort segmented parameters; Index: lisp/mml1991.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/mml1991.el,v retrieving revision 7.7 diff -u -r7.7 mml1991.el --- lisp/mml1991.el 8 Feb 2006 04:17:15 -0000 7.7 +++ lisp/mml1991.el 8 Feb 2006 23:51:13 -0000 @@ -229,7 +229,8 @@ (defvar pgg-output-buffer)) (defun mml1991-pgg-sign (cont) - (let (headers cte) + (let ((pgg-text-mode t) + headers cte) ;; Don't sign headers. (goto-char (point-min)) (while (not (looking-at "^$")) @@ -261,7 +262,8 @@ t)) (defun mml1991-pgg-encrypt (cont &optional sign) - (let (cte) + (let ((pgg-text-mode t) + cte) ;; Strip MIME Content[^ ]: headers since it will be ASCII ARMOURED (goto-char (point-min)) (while (looking-at "^Content[^ ]+:") Index: lisp/mml2015.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/mml2015.el,v retrieving revision 7.13 diff -u -r7.13 mml2015.el --- lisp/mml2015.el 8 Feb 2006 04:17:15 -0000 7.13 +++ lisp/mml2015.el 8 Feb 2006 23:51:13 -0000 @@ -818,6 +818,7 @@ (boundary (mml-compute-boundary cont)) (pgg-default-user-id (or (message-options-get 'mml-sender) pgg-default-user-id)) + (pgg-text-mode t) entry) (unless (pgg-sign-region (point-min) (point-max)) (pop-to-buffer mml2015-result-buffer) @@ -845,6 +846,7 @@ (defun mml2015-pgg-encrypt (cont &optional sign) (let ((pgg-errors-buffer mml2015-result-buffer) + (pgg-text-mode t) (boundary (mml-compute-boundary cont))) (unless (pgg-encrypt-region (point-min) (point-max) (split-string Index: lisp/pgg-def.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/pgg-def.el,v retrieving revision 7.9 diff -u -r7.9 pgg-def.el --- lisp/pgg-def.el 8 Feb 2006 04:17:15 -0000 7.9 +++ lisp/pgg-def.el 8 Feb 2006 23:51:13 -0000 @@ -83,6 +83,9 @@ (defvar pgg-scheme nil "Current scheme of PGP implementation.") +(defvar pgg-text-mode nil + "If t, inform the recipient that the input is text.") + (defmacro pgg-truncate-key-identifier (key) `(if (> (length ,key) 8) (substring ,key 8) ,key)) Index: lisp/pgg-gpg.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/pgg-gpg.el,v retrieving revision 7.10 diff -u -r7.10 pgg-gpg.el --- lisp/pgg-gpg.el 19 Jan 2006 11:53:12 -0000 7.10 +++ lisp/pgg-gpg.el 8 Feb 2006 23:51:13 -0000 @@ -87,7 +87,9 @@ (buffer-disable-undo) (erase-buffer) (if (file-exists-p output-file-name) - (let ((coding-system-for-read 'raw-text-dos)) + (let ((coding-system-for-read (if pgg-text-mode + 'raw-text + 'binary))) (insert-file-contents output-file-name))) (set-buffer errors-buffer) (if (not (equal exit-status 0)) @@ -185,7 +187,8 @@ pgg-gpg-user-id)))) (args (append - (list "--batch" "--textmode" "--armor" "--always-trust" "--encrypt") + (list "--batch" "--armor" "--always-trust" "--encrypt") + (if pgg-text-mode (list "--textmode")) (if sign (list "--sign" "--local-user" pgg-gpg-user-id)) (if recipients (apply #'nconc @@ -194,8 +197,7 @@ (append recipients (if pgg-encrypt-for-me (list pgg-gpg-user-id))))))))) - (pgg-as-lbt start end 'CRLF - (pgg-gpg-process-region start end passphrase pgg-gpg-program args)) + (pgg-gpg-process-region start end passphrase pgg-gpg-program args) (when sign (with-current-buffer pgg-errors-buffer ;; Possibly cache passphrase under, e.g. "jas", for future sign. @@ -213,9 +215,9 @@ (pgg-read-passphrase "GnuPG passphrase for symmetric encryption: "))) (args - (append (list "--batch" "--textmode" "--armor" "--symmetric" )))) - (pgg-as-lbt start end 'CRLF - (pgg-gpg-process-region start end passphrase pgg-gpg-program args)) + (append (list "--batch" "--armor" "--symmetric" ) + (if pgg-text-mode (list "--textmode"))))) + (pgg-gpg-process-region start end passphrase pgg-gpg-program args) (pgg-process-when-success))) (defun pgg-gpg-decrypt-region (start end &optional passphrase) @@ -277,13 +279,13 @@ (format "GnuPG passphrase for %s: " pgg-gpg-user-id) pgg-gpg-user-id))) (args - (list (if cleartext "--clearsign" "--detach-sign") - "--armor" "--batch" "--verbose" - "--local-user" pgg-gpg-user-id)) + (append (list (if cleartext "--clearsign" "--detach-sign") + "--armor" "--batch" "--verbose" + "--local-user" pgg-gpg-user-id) + (if pgg-text-mode (list "--textmode")))) (inhibit-read-only t) buffer-read-only) - (pgg-as-lbt start end 'CRLF - (pgg-gpg-process-region start end passphrase pgg-gpg-program args)) + (pgg-gpg-process-region start end passphrase pgg-gpg-program args) (with-current-buffer pgg-errors-buffer ;; Possibly cache passphrase under, e.g. "jas", for future sign. (pgg-gpg-possibly-cache-passphrase passphrase pgg-gpg-user-id) --Multipart_Thu_Feb__9_14:29:04_2006-1--