From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/47076 Path: main.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.gnus.general Subject: Re: pgg doesn't seem to like me Date: Thu, 10 Oct 2002 02:32:27 +0200 Sender: owner-ding@hpc.uh.edu Message-ID: References: <20021001172713.05F1E3B8CE@athene.jamux.com> <87d6quugw5.fsf@athene.jamux.com> <87adly6kck.fsf@mail.paradoxical.net> <874rc5vs16.fsf@athene.jamux.com> <874rc57u6e.fsf@mail.paradoxical.net> <873croy9g1.fsf@athene.jamux.com> <87elb5qyrx.fsf@athene.jamux.com> <87adlskjh3.fsf@athene.jamux.com> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1034209986 22806 127.0.0.1 (10 Oct 2002 00:33:06 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 10 Oct 2002 00:33:06 +0000 (UTC) Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17zRGD-0005vi-00 for ; Thu, 10 Oct 2002 02:33:05 +0200 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 17zRFx-0001MM-00; Wed, 09 Oct 2002 19:32:49 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Wed, 09 Oct 2002 19:33:31 -0500 (CDT) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id TAA17884 for ; Wed, 9 Oct 2002 19:33:16 -0500 (CDT) Original-Received: (qmail 8555 invoked by alias); 10 Oct 2002 00:32:29 -0000 Original-Received: (qmail 8550 invoked from network); 10 Oct 2002 00:32:29 -0000 Original-Received: from 178.230.13.217.in-addr.dgcsystems.net (HELO yxa.extundo.com) (217.13.230.178) by gnus.org with SMTP; 10 Oct 2002 00:32:29 -0000 Original-Received: from latte.josefsson.org (yxa.extundo.com [217.13.230.178]) by yxa.extundo.com (8.12.6/8.12.6) with ESMTP id g9A0WSFt012775 for ; Thu, 10 Oct 2002 02:32:28 +0200 Original-To: ding@gnus.org Mail-Copies-To: nobody X-Hashcash: 0:021010:ding@gnus.org:0670fa71207ccbcf In-Reply-To: (Andreas Fuchs's message of "Mon, 07 Oct 2002 18:23:10 +0200") User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-debian-linux-gnu) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:47076 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:47076 Andreas Fuchs writes: > On 2002-10-06, Simon Josefsson wrote: >> Uhm, are there any other outstanding PGG problems? I may have missed >> them. Or PGP/MIME and S/MIME problems in general? > > Reading a mail encrypted for another key-id than the default one > doesn't DTRT: pgg tries to decrypt the mail for the default key-id, > which fails and then just displays the message to me. > > Is it possible to divine the key-id to which a message was encrypted > From the mail? I have seen pgg ask me if I want to download public > keys, could it also ask for the right key-id's password? I think it does this now. 2002-10-10 Simon Josefsson * pgg.el (pgg-decrypt-region): Bind pgg-default-user-id to key-identifier in packet. Is this a good idea? Index: pgg.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/pgg.el,v retrieving revision 6.4 retrieving revision 6.5 diff -u -p -r6.4 -r6.5 --- pgg.el 2002/10/09 23:45:01 6.4 +++ pgg.el 2002/10/10 01:22:42 6.5 @@ -172,10 +172,20 @@ If optional argument SIGN is non-nil, do (defun pgg-decrypt-region (start end) "Decrypt the current region between START and END." (interactive "r") - (let ((status - (pgg-save-coding-system start end - (pgg-invoke "decrypt-region" (or pgg-scheme pgg-default-scheme) - (point-min) (point-max))))) + (let* ((buf (current-buffer)) + (packet (cdr (assq 1 (with-temp-buffer + (insert-buffer buf) + (pgg-decode-armor-region + (point-min) (point-max)))))) + (key (cdr (assq 'key-identifier packet))) + (pgg-default-user-id + (if key + (concat "0x" (pgg-truncate-key-identifier key)) + pgg-default-user-id)) + (status + (pgg-save-coding-system start end + (pgg-invoke "decrypt-region" (or pgg-scheme pgg-default-scheme) + (point-min) (point-max))))) (when (interactive-p) (pgg-display-output-buffer start end status)) status))