From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/54746 Path: main.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.gnus.general Subject: Re: PGG with multiple GnuPG keys Date: Sun, 09 Nov 2003 22:45:37 +0100 Sender: ding-owner@lists.math.uh.edu Message-ID: References: <13408.1068408992@chicory.stanford.edu> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1068414391 2730 80.91.224.253 (9 Nov 2003 21:46:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 9 Nov 2003 21:46:31 +0000 (UTC) Cc: ding Original-X-From: ding-owner+M3287@lists.math.uh.edu Sun Nov 09 22:46:29 2003 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AIxO9-00007Z-00 for ; Sun, 09 Nov 2003 22:46:29 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1AIxNa-00079X-00; Sun, 09 Nov 2003 15:45:55 -0600 Original-Received: from justine.libertine.org ([66.139.78.221]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1AIxNW-00079S-00 for ding@lists.math.uh.edu; Sun, 09 Nov 2003 15:45:50 -0600 Original-Received: from yxa.extundo.com (178.230.13.217.in-addr.dgcsystems.net [217.13.230.178]) by justine.libertine.org (Postfix) with ESMTP id 2767B3A0073 for ; Sun, 9 Nov 2003 15:45:49 -0600 (CST) Original-Received: from latte (yxa.extundo.com [217.13.230.178]) (authenticated bits=0) by yxa.extundo.com (8.12.10/8.12.10) with ESMTP id hA9Ljk1L025275 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Sun, 9 Nov 2003 22:45:47 +0100 Original-To: "Satyaki Das" Mail-Copies-To: nobody X-Payment: hashcash 1.2 0:031109:satyakid@stanford.edu:69fdc7b114f1fdfd X-Hashcash: 0:031109:satyakid@stanford.edu:69fdc7b114f1fdfd X-Payment: hashcash 1.2 0:031109:ding@gnus.org:3ba686d7f882a5b0 X-Hashcash: 0:031109:ding@gnus.org:3ba686d7f882a5b0 In-Reply-To: <13408.1068408992@chicory.stanford.edu> (Satyaki Das's message of "Sun, 09 Nov 2003 12:16:32 -0800") User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:54746 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:54746 "Satyaki Das" writes: > I have discovered another minor problem. With current CVS and no > customization, pgg asks for the passphrase of "satyaki" when I > try to sign a message. Then when I receive encrypted mail, it > asks me for the passphrase of 7C06BDD9, which is the same key as > "satyaki". Right. The problem is that pgg-gpg.el doesn't know, during decryption, that 7C06BDD9 is the same key as the key that eventually gets used by the OpenPGP implementation when you request the "satyaki" key when signing a message. So it can't use the cached passphrase for "satyaki" that it knows for the 7C06BDD9 key. I think the best solution would be to change `pgg-gpg-sign-region' to parse gpg's output (GOOD_PASSPHRASE) and find out what the key id was, and then cache your passphrase under that hex key id (and under the "satyaki" name). Then the cache will work if you receive a message for the 7C06BDD9 key id. I have installed the patch below. Does it work? > So I have now customized pgg-default-user-id to 7C06BDD9 and that > avoids the repeated queries for my passphrase. Is this the right > solution? It is "right" in the sense that it may work for you. My goal is that only very few people will need to configure PGG; the default behaviour should be Right. 2003-11-09 Simon Josefsson * pgg-gpg.el (pgg-gpg-encrypt-region): Cache passphrase under hex key id too (for decryption). (pgg-gpg-sign-region): Likewise. Index: pgg-gpg.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/pgg-gpg.el,v retrieving revision 6.20 retrieving revision 6.21 diff -u -p -r6.20 -r6.21 --- pgg-gpg.el 9 Nov 2003 04:02:36 -0000 6.20 +++ pgg-gpg.el 9 Nov 2003 21:40:30 -0000 6.21 @@ -162,7 +162,10 @@ If optional argument SIGN is non-nil, do (pgg-gpg-process-region start end passphrase pgg-gpg-program args)) (when sign (with-current-buffer pgg-errors-buffer - (pgg-gpg-possibly-cache-passphrase passphrase pgg-gpg-user-id))) + ;; Possibly cache passphrase under, e.g. "jas", for future sign. + (pgg-gpg-possibly-cache-passphrase passphrase pgg-gpg-user-id) + ;; Possibly cache passphrase under, e.g. B565716F, for future decrypt. + (pgg-gpg-possibly-cache-passphrase passphrase))) (pgg-process-when-success))) (defun pgg-gpg-decrypt-region (start end) @@ -209,7 +212,10 @@ If optional argument SIGN is non-nil, do (pgg-as-lbt start end 'CRLF (pgg-gpg-process-region start end passphrase pgg-gpg-program args)) (with-current-buffer pgg-errors-buffer - (pgg-gpg-possibly-cache-passphrase passphrase pgg-gpg-user-id)) + ;; Possibly cache passphrase under, e.g. "jas", for future sign. + (pgg-gpg-possibly-cache-passphrase passphrase pgg-gpg-user-id) + ;; Possibly cache passphrase under, e.g. B565716F, for future decrypt. + (pgg-gpg-possibly-cache-passphrase passphrase)) (pgg-process-when-success))) (defun pgg-gpg-verify-region (start end &optional signature)