;;; epg.el --- the EasyPG Library
;; Copyright (C) 1999, 2000, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
;; Author: Daiki Ueno <ueno@unixuser.org>
;; Keywords: PGP, GnuPG
(defconst epg-digest-algorithm-alist
'((1 . "MD5")
(2 . "SHA1")
- (3 . "RMD160")
+ (3 . "RIPEMD160")
(8 . "SHA256")
(9 . "SHA384")
(10 . "SHA512")
car is a function and cdr is a callback data.
The function gets three arguments: the context, the key-id in
-question, and the callback data (if any)."
+question, and the callback data (if any).
+
+The callback may not be called if you use GnuPG 2.x, which relies
+on the external program called `gpg-agent' for passphrase query.
+If you really want to intercept passphrase query, consider
+installing GnuPG 1.x _along with_ GnuPG 2.x, which does passphrase
+query by itself and Emacs can intercept them."
(unless (eq (car-safe context) 'epg-context)
(signal 'wrong-type-argument (list 'epg-context-p context)))
(aset (cdr context) 7 (if (consp passphrase-callback)
(goto-char (point-max))
(insert input)))
(if (buffer-live-p (process-buffer process))
- (save-excursion
- (set-buffer (process-buffer process))
+ (with-current-buffer (process-buffer process)
(goto-char (point-max))
(insert input)
(unless epg-process-filter-running
(defun epg--status-KEYEXPIRED (context string)
(epg-context-set-result-for
- context 'error
+ context 'key
(cons (list 'key-expired (cons 'expiration-time
(epg--time-from-seconds string)))
(epg-context-result-for context 'error))))
(defun epg--status-KEYREVOKED (context string)
(epg-context-set-result-for
- context 'error
+ context 'key
(cons '(key-revoked)
(epg-context-result-for context 'error))))
(defun epg-cancel (context)
(if (buffer-live-p (process-buffer (epg-context-process context)))
- (save-excursion
- (set-buffer (process-buffer (epg-context-process context)))
+ (with-current-buffer (process-buffer (epg-context-process context))
(epg-context-set-result-for
epg-context 'error
(cons '(quit)