NOTE: This patch has been committed.
Hello,
This patch synchs easypg package to the latest upstream version.
xemacs-packages source patch:
Diff command: cvs -q diff -u
Files affected: xemacs-packages/easypg/epg.el
xemacs-packages/easypg/epg-package-info.el.in xemacs-packages/easypg/epg-config.el
xemacs-packages/easypg/epa.el xemacs-packages/easypg/epa-setup.el
xemacs-packages/easypg/epa-mail.el xemacs-packages/easypg/epa-file.el
xemacs-packages/easypg/epa-dired.el xemacs-packages/easypg/configure.ac
xemacs-packages/easypg/NEWS
Index: xemacs-packages/easypg/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/easypg/ChangeLog,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 ChangeLog
--- xemacs-packages/easypg/ChangeLog 16 Sep 2007 13:16:05 -0000 1.1.1.1
+++ xemacs-packages/easypg/ChangeLog 7 Feb 2008 02:54:30 -0000
@@ -1,3 +1,25 @@
+2008-02-07 Daiki Ueno <ueno(a)unixuser.org>
+
+ * EasyPG: Version 0.0.16 released.
+ * configure.ac: Bump up version.
+
+2008-02-06 Daiki Ueno <ueno(a)unixuser.org>
+
+ * epa-file.el (epa-file-passphrase-callback-function): Use
+ canonical file names as keys for cache.
+
+2008-01-22 Daiki Ueno <ueno(a)unixuser.org>
+
+ * epa-mail.el (epa-mail--find-usable-key): New function.
+ (epa-mail-encrypt): Use it.
+ Reported by intrigeri <intrigeri(a)boum.org>.
+
+2007-11-26 Daiki Ueno <ueno(a)unixuser.org>
+
+ * epg-package-info.el.in (epg-bug-report-address): New constant.
+
+ * configure.ac: Use modern AC_INIT.
+
2007-09-06 Norbert Koch <viteno(a)xemacs.org>
* Makefile (VERSION): XEmacs package 1.01 released.
Index: xemacs-packages/easypg/NEWS
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/easypg/NEWS,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 NEWS
--- xemacs-packages/easypg/NEWS 16 Sep 2007 13:16:06 -0000 1.1.1.1
+++ xemacs-packages/easypg/NEWS 7 Feb 2008 02:54:30 -0000
@@ -1,3 +1,12 @@
+* Major changes in 0.0.16
+
+** This will be the final version released under GPL2+. Subsequent
+ versions will be released under GPL3+.
+
+** epa-mail-encrypt now skips unusable keys.
+
+** epa-file now uses canonical file names as keys for passphrase cache.
+
* Major changes in 0.0.15
** Fixed a load-error of epa on XEmacs.
Index: xemacs-packages/easypg/configure.ac
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/easypg/configure.ac,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 configure.ac
--- xemacs-packages/easypg/configure.ac 16 Sep 2007 13:16:09 -0000 1.1.1.1
+++ xemacs-packages/easypg/configure.ac 7 Feb 2008 02:54:30 -0000
@@ -1,7 +1,7 @@
-AC_INIT
+AC_PREREQ(2.61)
+AC_INIT([epg], [0.0.16], [ueno(a)unixuser.org])
AC_CONFIG_SRCDIR([configure.ac])
-AC_PREREQ(2.59)
-AM_INIT_AUTOMAKE(epg, 0.0.15)
+AM_INIT_AUTOMAKE
AC_CHECK_EMACS
AC_PATH_LISPDIR
Index: xemacs-packages/easypg/epa-dired.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/easypg/epa-dired.el,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 epa-dired.el
--- xemacs-packages/easypg/epa-dired.el 16 Sep 2007 13:16:09 -0000 1.1.1.1
+++ xemacs-packages/easypg/epa-dired.el 7 Feb 2008 02:54:30 -0000
@@ -13,7 +13,7 @@
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
Index: xemacs-packages/easypg/epa-file.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/easypg/epa-file.el,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 epa-file.el
--- xemacs-packages/easypg/epa-file.el 16 Sep 2007 13:16:09 -0000 1.1.1.1
+++ xemacs-packages/easypg/epa-file.el 7 Feb 2008 02:54:30 -0000
@@ -13,7 +13,7 @@
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
@@ -105,18 +105,21 @@
(defun epa-file-passphrase-callback-function (context key-id file)
(if (and epa-file-cache-passphrase-for-symmetric-encryption
(eq key-id 'SYM))
- (let ((entry (assoc file epa-file-passphrase-alist))
- passphrase)
- (or (copy-sequence (cdr entry))
- (progn
- (unless entry
- (setq entry (list file)
- epa-file-passphrase-alist (cons entry
- epa-file-passphrase-alist)))
- (setq passphrase (epa-passphrase-callback-function context
- key-id nil))
- (setcdr entry (copy-sequence passphrase))
- passphrase)))
+ (progn
+ (setq file (file-truename file))
+ (let ((entry (assoc file epa-file-passphrase-alist))
+ passphrase)
+ (or (copy-sequence (cdr entry))
+ (progn
+ (unless entry
+ (setq entry (list file)
+ epa-file-passphrase-alist
+ (cons entry
+ epa-file-passphrase-alist)))
+ (setq passphrase (epa-passphrase-callback-function context
+ key-id nil))
+ (setcdr entry (copy-sequence passphrase))
+ passphrase))))
(epa-passphrase-callback-function context key-id nil)))
(defun epa-file-handler (operation &rest args)
Index: xemacs-packages/easypg/epa-mail.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/easypg/epa-mail.el,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 epa-mail.el
--- xemacs-packages/easypg/epa-mail.el 16 Sep 2007 13:16:09 -0000 1.1.1.1
+++ xemacs-packages/easypg/epa-mail.el 7 Feb 2008 02:54:30 -0000
@@ -13,7 +13,7 @@
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
@@ -44,6 +44,19 @@
"A minor-mode for composing encrypted/clearsigned mails."
nil " epa-mail" epa-mail-mode-map)
+(defun epa-mail--find-usable-key (keys usage)
+ "Find a usable key from KEYS for USAGE."
+ (catch 'found
+ (while keys
+ (let ((pointer (epg-key-sub-key-list (car keys))))
+ (while pointer
+ (if (and (memq usage (epg-sub-key-capability (car pointer)))
+ (not (memq (epg-sub-key-validity (car pointer))
+ '(revoked expired))))
+ (throw 'found (car keys)))
+ (setq pointer (cdr pointer))))
+ (setq keys (cdr keys)))))
+
;;;###autoload
(defun epa-mail-decrypt ()
"Decrypt OpenPGP armors in the current buffer.
@@ -98,7 +111,7 @@
(save-excursion
(let ((verbose current-prefix-arg)
(context (epg-make-context epa-protocol))
- recipients recipient-keys)
+ recipients recipient-key)
(goto-char (point-min))
(save-restriction
(narrow-to-region (point)
@@ -129,21 +142,22 @@
If no one is selected, symmetric encryption will be performed. "
recipients)
(if recipients
- (apply #'nconc
- (mapcar
- (lambda (recipient)
- (setq recipient-keys
- (epg-list-keys
- (epg-make-context epa-protocol)
- (concat "<" recipient ">")))
- (unless (or recipient-keys
- (y-or-n-p
- (format
- "No public key for %s; skip it? "
- recipient)))
- (error "No public key for %s" recipient))
- recipient-keys)
- recipients))))
+ (mapcar
+ (lambda (recipient)
+ (setq recipient-key
+ (epa-mail--find-usable-key
+ (epg-list-keys
+ (epg-make-context epa-protocol)
+ (concat "<" recipient ">"))
+ 'encrypt))
+ (unless (or recipient-key
+ (y-or-n-p
+ (format
+ "No public key for %s; skip it? "
+ recipient)))
+ (error "No public key for %s" recipient))
+ recipient-key)
+ recipients)))
(setq sign (if verbose (y-or-n-p "Sign? ")))
(if sign
(epa-select-keys context
Index: xemacs-packages/easypg/epa-setup.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/easypg/epa-setup.el,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 epa-setup.el
--- xemacs-packages/easypg/epa-setup.el 16 Sep 2007 13:16:09 -0000 1.1.1.1
+++ xemacs-packages/easypg/epa-setup.el 7 Feb 2008 02:54:30 -0000
@@ -1,3 +1,28 @@
+;;; epa-setup.el --- setup routine for the EasyPG Assistant.
+;; Copyright (C) 2006,2007,2008 Daiki Ueno
+
+;; Author: Daiki Ueno <ueno(a)unixuser.org>
+;; Keywords: PGP, GnuPG
+
+;; This file is part of EasyPG.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Code:
+
(autoload 'epa-list-keys "epa")
(autoload 'epa-dired-mode-hook "epa-dired")
Index: xemacs-packages/easypg/epa.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/easypg/epa.el,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 epa.el
--- xemacs-packages/easypg/epa.el 16 Sep 2007 13:16:10 -0000 1.1.1.1
+++ xemacs-packages/easypg/epa.el 7 Feb 2008 02:54:30 -0000
@@ -13,7 +13,7 @@
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
Index: xemacs-packages/easypg/epg-config.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/easypg/epg-config.el,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 epg-config.el
--- xemacs-packages/easypg/epg-config.el 16 Sep 2007 13:16:10 -0000 1.1.1.1
+++ xemacs-packages/easypg/epg-config.el 7 Feb 2008 02:54:30 -0000
@@ -13,7 +13,7 @@
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
Index: xemacs-packages/easypg/epg-package-info.el.in
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/easypg/epg-package-info.el.in,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 epg-package-info.el.in
--- xemacs-packages/easypg/epg-package-info.el.in 16 Sep 2007 13:16:10 -0000 1.1.1.1
+++ xemacs-packages/easypg/epg-package-info.el.in 7 Feb 2008 02:54:30 -0000
@@ -13,7 +13,7 @@
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
@@ -28,6 +28,9 @@
(defconst epg-version-number "@VERSION@"
"Version number of this package.")
+
+(defconst epg-bug-report-address "@PACKAGE_BUGREPORT@"
+ "Report bugs to this address.")
(provide 'epg-package-info)
Index: xemacs-packages/easypg/epg.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/easypg/epg.el,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 epg.el
--- xemacs-packages/easypg/epg.el 16 Sep 2007 13:16:11 -0000 1.1.1.1
+++ xemacs-packages/easypg/epg.el 7 Feb 2008 02:54:30 -0000
@@ -15,7 +15,7 @@
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
@@ -330,7 +330,7 @@
(defun epg-context-set-passphrase-callback (context passphrase-callback
&optional handback)
"Set the function used to query passphrase.
-If optional argument HANDBACK is specified, it is passed to CALLBACK."
+If optional argument HANDBACK is specified, it is passed to PASSPHRASE-CALLBACK."
(unless (eq (car-safe context) 'epg-context)
(signal 'wrong-type-argument (list 'epg-context-p context)))
(aset (cdr context) 7 (if handback
@@ -340,7 +340,7 @@
(defun epg-context-set-progress-callback (context progress-callback
&optional handback)
"Set the function which handles progress update.
-If optional argument HANDBACK is specified, it is passed to CALLBACK."
+If optional argument HANDBACK is specified, it is passed to PROGRESS-CALLBACK."
(unless (eq (car-safe context) 'epg-context)
(signal 'wrong-type-argument (list 'epg-context-p context)))
(aset (cdr context) 8 (if handback
@@ -2477,7 +2477,7 @@
;;;###autoload
(defun epg-start-sign-keys (context keys &optional local)
- "Initiate an sign keys operation.
+ "Initiate a sign keys operation.
If you use this function, you will need to wait for the completion of
`epg-gpg-program' by using `epg-wait-for-completion' and call
Regards,
--
Daiki Ueno
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches