Gnus development mailing list
 help / color / mirror / Atom feed
From: Simon Josefsson <jas@extundo.com>
Subject: Re: pgg doesn't seem to like me
Date: Thu, 10 Oct 2002 02:32:27 +0200	[thread overview]
Message-ID: <iluadln6smc.fsf@latte.josefsson.org> (raw)
In-Reply-To: <E17yaf0-0001qS-00@eris.void.at> (Andreas Fuchs's message of "Mon, 07 Oct 2002 18:23:10 +0200")

Andreas Fuchs <asf@void.at> writes:

> On 2002-10-06, Simon Josefsson <jas@extundo.com> 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  <jas@extundo.com>

	* 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))




  parent reply	other threads:[~2002-10-10  0:32 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-01 17:27 John A. Martin
2002-10-01 18:56 ` John A. Martin
2002-10-01 19:16   ` Josh Huber
2002-10-01 20:11     ` John A. Martin
2002-10-01 20:58       ` Josh Huber
2002-10-01 21:21         ` John A. Martin
2002-10-01 21:38           ` Josh Huber
2002-10-01 21:50             ` Jesper Harder
2002-10-01 23:32             ` John A. Martin
2002-10-02 18:36         ` John A. Martin
2002-10-02 19:20           ` John A. Martin
2002-10-03  0:22             ` Clemens Fischer
2002-10-03 23:00           ` Simon Josefsson
2002-10-03 23:04             ` Simon Josefsson
2002-10-05  4:45               ` John A. Martin
2002-10-05 11:24                 ` Simon Josefsson
2002-10-05 15:12                   ` John A. Martin
2002-10-05 21:22                     ` Raymond Scholz
2002-10-06  0:03                       ` Simon Josefsson
2002-10-06 10:14                         ` Raymond Scholz
2002-10-09 21:59                           ` Simon Josefsson
2002-10-10  0:15                             ` Simon Josefsson
2002-10-10 17:36                               ` Raymond Scholz
2002-10-06 19:46                         ` John A. Martin
2002-10-10  0:13                           ` Simon Josefsson
2002-10-10  4:55                             ` John A. Martin
2002-10-10 14:18                               ` Josh Huber
2002-10-10 15:18                               ` Simon Josefsson
2002-10-10 14:55                             ` John A. Martin
2002-10-10 15:54                               ` Simon Josefsson
2002-10-07 16:23                         ` Andreas Fuchs
2002-10-07 23:58                           ` Clemens Fischer
2002-10-10  0:34                             ` Simon Josefsson
2002-10-10  0:32                           ` Simon Josefsson [this message]
2002-10-10 10:42                             ` Andreas Fuchs
2002-10-10 15:00                               ` Simon Josefsson
2002-10-10 18:28                                 ` Andreas Fuchs
2002-10-10 23:24                                   ` Simon Josefsson
2002-10-08  2:11                         ` John A. Martin
2002-10-10  0:42                           ` Simon Josefsson
2002-10-08 13:37                         ` John A. Martin
2002-10-08 14:18                           ` Simon Josefsson
     [not found]             ` <gd.y1yr8f6yp8y.fsf@fly.verified.de>
     [not found]               ` <iluofa94z60.fsf@latte.josefsson.org>
2002-10-05 11:58                 ` Raymond Scholz
2002-10-05 14:17                   ` John A. Martin
2002-10-05 21:21                     ` Raymond Scholz
2002-10-01 22:54 ` Simon Josefsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=iluadln6smc.fsf@latte.josefsson.org \
    --to=jas@extundo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).