From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/64354 Path: news.gmane.org!not-for-mail From: Michael Piotrowski Newsgroups: gmane.emacs.gnus.general Subject: Re: epg and expired recipient keys Date: Tue, 27 Feb 2007 12:23:23 +0100 Organization: dynalabs Network Research Unit Message-ID: References: <87649ro899.fsf@wheatstone.g10code.de> <87y7mlgl9f.fsf@wheatstone.g10code.de> <56d409a7-d8c0-4e74-be44-824f942fd4e5@well-done.deisui.org> <87zm71f0sl.fsf@wheatstone.g10code.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1172575520 20858 80.91.229.12 (27 Feb 2007 11:25:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 27 Feb 2007 11:25:20 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M12878@lists.math.uh.edu Tue Feb 27 12:25:13 2007 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1HM0SH-00039c-Ek for ding-account@gmane.org; Tue, 27 Feb 2007 12:25:13 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1HM0RP-0000ph-Sj; Tue, 27 Feb 2007 05:24:19 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1HM0RM-0000pN-Qc for ding@lists.math.uh.edu; Tue, 27 Feb 2007 05:24:16 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.63) (envelope-from ) id 1HM0RF-0006KR-FP for ding@lists.math.uh.edu; Tue, 27 Feb 2007 05:24:16 -0600 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1HM0RE-0006Qh-00 for ; Tue, 27 Feb 2007 12:24:08 +0100 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1HM0R1-00078u-Ah for ding@gnus.org; Tue, 27 Feb 2007 12:23:55 +0100 Original-Received: from dslb-088-072-033-041.pools.arcor-ip.net ([88.72.33.41]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 27 Feb 2007 12:23:55 +0100 Original-Received: from mxp by dslb-088-072-033-041.pools.arcor-ip.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 27 Feb 2007 12:23:55 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 81 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: dslb-088-072-033-041.pools.arcor-ip.net User-Agent: Gnus/5.110006 (No Gnus v0.6) XEmacs/21.4.19 (berkeley-unix) X-Face: %OvAx]kKl`N,i?yQ+$^p9w2oy)Yg|O}a_~6wtRQ@UTZ*(jSPubbonT]m++M>YBtJqkZZa!W"y5`aI.FoKO%$JHz=ws|i?y^o2bds(+pcp>gcX]H}?-tCzL^ABzJUWYzS{"!_hFg:JD)`kxRKLsNp X-Operating-System: NetBSD Content-Language: en X-Now-Playing: - SCRATCH MASSIVEShining in my vein ( ( ) Cancel-Lock: sha1:e6MwTaqPykjaMxDd4Z1+AFa+UqY= X-Spam-Score: -2.6 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:64354 Archived-At: --=-=-= On 2007-02-26, Werner Koch wrote: >> I'm now wondering whether to exclude unusable keys from the key list > > Yes, please do this when encrypting. I'm using the attached patch to epg.el to filter unusable keys. I'm checking for keys marked d, i, r, or e in `epg--list-keys-1'. If you want to browse unusable keys in `epa-list-keys' the filtering would have to be implemented somewhere else, so maybe this is not the final solution. But it works for me and allows me to send encrypted messages to people for whom there also expired keys in my keyring. So, maybe it can be used as an example for a more comprehensive implementation. Greetings -- Michael Piotrowski, M.A. Public key at --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=epg.el.patch Content-Description: Filter unusable keys Index: epg.el =================================================================== RCS file: /cvs/root/epg/epg.el,v retrieving revision 1.188 diff -C2 -r1.188 epg.el *** epg.el 31 Jan 2007 03:27:46 -0000 1.188 --- epg.el 27 Feb 2007 11:14:01 -0000 *************** *** 1656,1660 **** '("--fixed-list-mode")) (if name (list name)))) ! keys string field index) (with-temp-buffer (apply #'call-process --- 1656,1660 ---- '("--fixed-list-mode")) (if name (list name)))) ! keys) (with-temp-buffer (apply #'call-process *************** *** 1664,1677 **** nil (list t nil) nil args) (goto-char (point-min)) ! (while (re-search-forward "^[a-z][a-z][a-z]:.*" nil t) ! (setq keys (cons (make-vector 15 nil) keys) ! string (match-string 0) ! index 0 ! field 0) ! (while (eq index ! (string-match "\\([^:]+\\)?:" string index)) ! (setq index (match-end 0)) ! (aset (car keys) field (match-string 1 string)) ! (setq field (1+ field)))) (nreverse keys)))) --- 1664,1676 ---- nil (list t nil) nil args) (goto-char (point-min)) ! (let ((line 0)) ! (while (not (eobp)) ! (goto-line (incf line)) ! (let ((fields (split-string (buffer-substring (point) ! (point-at-eol)) ! ":" nil))) ! (when (cddr fields) ! (unless (string-match "[dire]" (second fields)) ! (push (apply 'vector fields) keys)))))) (nreverse keys)))) --=-=-=--