From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/63459 Path: news.gmane.org!not-for-mail From: Daiki Ueno Newsgroups: gmane.emacs.gnus.general Subject: Re: EasyPG support for mml2015.el Date: Mon, 10 Jul 2006 19:36:21 +0900 Message-ID: <3634bd45-288d-4222-bd28-4477704242b8@well-done.deisui.org> References: <0a485279-4c9d-4249-bb88-c2fbf73c6171@well-done.deisui.org> <717683f1-48a8-4e2f-8ad4-0b4127172417@well-done.deisui.org> <8764i5ydq0.fsf@latte.josefsson.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Mon_Jul_10_19:36:21_2006-1" X-Trace: sea.gmane.org 1152527883 24220 80.91.229.2 (10 Jul 2006 10:38:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 10 Jul 2006 10:38:03 +0000 (UTC) Original-X-From: ding-owner+m11986@lists.math.uh.edu Mon Jul 10 12:38:00 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 1Fzt9I-00080s-6l for ding-account@gmane.org; Mon, 10 Jul 2006 12:37:57 +0200 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 1Fzt99-0003l3-00; Mon, 10 Jul 2006 05:37:47 -0500 Original-Received: from nas02.math.uh.edu ([129.7.128.40]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1Fzt7w-0003ky-00 for ding@lists.math.uh.edu; Mon, 10 Jul 2006 05:36:32 -0500 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas02.math.uh.edu with esmtp (Exim 4.52) id 1Fzt7t-0005Em-An for ding@lists.math.uh.edu; Mon, 10 Jul 2006 05:36:32 -0500 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 1Fzt7r-0007P1-00 for ; Mon, 10 Jul 2006 12:36:28 +0200 Original-Received: from [150.82.173.221] (helo=well-done.deisui.org) by well-done.deisui.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.62) (envelope-from ) id 1Fzt5l-00026t-3y for ding@gnus.org; Mon, 10 Jul 2006 19:34:17 +0900 Original-To: ding@gnus.org X-Attribution: DU In-Reply-To: <8764i5ydq0.fsf@latte.josefsson.org> (Simon Josefsson's message of "Mon, 10 Jul 2006 12:08:07 +0200") User-Agent: T-gnus/6.17.2 (based on No Gnus v0.2) EMIKO/1.14.1 (Choanoflagellata) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 EasyPG/0.0.3 MULE XEmacs/21.4 (patch 17) (Jumbo Shrimp) (i686-pc-linux) X-Spam-Score: -1.6 (-) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:63459 Archived-At: --Multipart_Mon_Jul_10_19:36:21_2006-1 Content-Type: text/plain; charset=US-ASCII >>>>> In <8764i5ydq0.fsf@latte.josefsson.org> >>>>> Simon Josefsson wrote: > > I just wrote a patch to mml1991.el attached below. > I installed the patch against mml1991.el. There was a patch against > mml2015.el there too, slightly different than your last patch, but I > couldn't apply it on top of the old patch. Any problem here? Sorry, this is because I created the diff from my up-to-date working copy. > One minor issue here too: > > +(defvar mml1991-cache-passphrase t > > + "If t, cache passphrase.") > This variable isn't used. Fixed in the attached patch. > And maybe there shouldn't be this many variables that control password > caching -- now there is at least in mml1991, mml2015 and in pgg, if I > recall correctly. Should these functions be unified in in mml-sec.el? --Multipart_Mon_Jul_10_19:36:21_2006-1 Content-Type: application/octet-stream; type=patch Content-Disposition: attachment; filename="mml-epg.el.diff" Content-Transfer-Encoding: 7bit Index: lisp/mml1991.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/mml1991.el,v retrieving revision 7.11 diff -u -r7.11 mml1991.el --- lisp/mml1991.el 10 Jul 2006 10:05:00 -0000 7.11 +++ lisp/mml1991.el 10 Jul 2006 10:35:34 -0000 @@ -32,6 +32,8 @@ (require 'cl) (require 'mm-util)) +(require 'password) + (defvar mc-pgp-always-sign) (autoload 'quoted-printable-decode-region "qp") @@ -358,9 +360,10 @@ (epg-context-set-armor context t) (epg-context-set-textmode context t) (epg-context-set-signers context signers) - (epg-context-set-passphrase-callback - context - #'mml1991-epg-passphrase-callback) + (if mml1991-cache-passphrase + (epg-context-set-passphrase-callback + context + #'mml1991-epg-passphrase-callback)) ;; Don't sign headers. (goto-char (point-min)) (when (re-search-forward "^$" nil t) @@ -426,9 +429,10 @@ "[ \f\t\n\r\v,]+")))) (epg-context-set-armor context t) (epg-context-set-textmode context t) - (epg-context-set-passphrase-callback - context - #'mml1991-epg-passphrase-callback) + (if mml1991-cache-passphrase + (epg-context-set-passphrase-callback + context + #'mml1991-epg-passphrase-callback)) (condition-case error (setq cipher (epg-encrypt-string context (buffer-string) recipients sign) Index: lisp/mml2015.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/mml2015.el,v retrieving revision 7.16 diff -u -r7.16 mml2015.el --- lisp/mml2015.el 10 Jul 2006 10:03:11 -0000 7.16 +++ lisp/mml2015.el 10 Jul 2006 10:35:35 -0000 @@ -902,8 +902,7 @@ ;;; epg wrapper (eval-and-compile - (autoload 'epg-make-context "epg") - (autoload 'epa-select-keys "epa")) + (autoload 'epg-make-context "epg")) (eval-when-compile (defvar epg-user-id-alist) @@ -956,9 +955,10 @@ mm-security-handle 'gnus-info "Corrupted") (throw 'error handle)) (setq context (epg-make-context)) - (epg-context-set-passphrase-callback - context - #'mml2015-epg-passphrase-callback) + (if mml2015-cache-passphrase + (epg-context-set-passphrase-callback + context + #'mml2015-epg-passphrase-callback)) (condition-case error (setq plain (epg-decrypt-string context (mm-get-part child)) mml2015-epg-secret-key-id-list nil) @@ -1002,9 +1002,10 @@ (let ((inhibit-redisplay t) (context (epg-make-context)) plain) - (epg-context-set-passphrase-callback - context - #'mml2015-epg-passphrase-callback) + (if mml2015-cache-passphrase + (epg-context-set-passphrase-callback + context + #'mml2015-epg-passphrase-callback)) (condition-case error (setq plain (epg-decrypt-string context (buffer-string)) mml2015-epg-secret-key-id-list nil) @@ -1106,9 +1107,10 @@ (epg-context-set-armor context t) (epg-context-set-textmode context t) (epg-context-set-signers context signers) - (epg-context-set-passphrase-callback - context - #'mml2015-epg-passphrase-callback) + (if mml2015-cache-passphrase + (epg-context-set-passphrase-callback + context + #'mml2015-epg-passphrase-callback)) (condition-case error (setq signature (epg-sign-string context (buffer-string) t) mml2015-epg-secret-key-id-list nil) @@ -1154,15 +1156,17 @@ (message-options-get 'message-recipients) "[ \f\t\n\r\v,]+")))) (setq recipients - (epg-list-keys context - (split-string - (message-options-get 'message-recipients) - "[ \f\t\n\r\v,]+")))) + (mapcar (lambda (name) + (car (epg-list-keys context name))) + (split-string + (message-options-get 'message-recipients) + "[ \f\t\n\r\v,]+")))) (epg-context-set-armor context t) (epg-context-set-textmode context t) - (epg-context-set-passphrase-callback - context - #'mml2015-epg-passphrase-callback) + (if mml2015-cache-passphrase + (epg-context-set-passphrase-callback + context + #'mml2015-epg-passphrase-callback)) (condition-case error (setq cipher (epg-encrypt-string context (buffer-string) recipients sign) --Multipart_Mon_Jul_10_19:36:21_2006-1 Content-Type: text/plain; charset=US-ASCII Regards, -- Daiki Ueno --Multipart_Mon_Jul_10_19:36:21_2006-1--