argument of passphrase-callback.
(epg-status-PROGRESS): Ditto.
2006-04-26 Daiki Ueno <ueno@unixuser.org>
2006-04-26 Daiki Ueno <ueno@unixuser.org>
+ * epg.el (epg-status-GET_HIDDEN): Pass epg-context as the first
+ argument of passphrase-callback.
+ (epg-status-PROGRESS): Ditto.
+
+2006-04-26 Daiki Ueno <ueno@unixuser.org>
+
* epa.el (epa-select-keys): Don't set inhibit-quit when
recursive-edit is called.
(epg-cancel): New function.
* epa.el (epa-select-keys): Don't set inhibit-quit when
recursive-edit is called.
(epg-cancel): New function.
(defvar epa-file-passphrase-alist nil)
(defvar epa-file-passphrase-alist nil)
-(defun epa-file-passphrase-callback-function (key-id file)
+(defun epa-file-passphrase-callback-function (context key-id file)
(if (eq key-id 'SYM)
(let ((entry (assoc file epa-file-passphrase-alist))
passphrase)
(if (eq key-id 'SYM)
(let ((entry (assoc file epa-file-passphrase-alist))
passphrase)
(setq entry (list file)
epa-file-passphrase-alist (cons entry
epa-file-passphrase-alist)))
(setq entry (list file)
epa-file-passphrase-alist (cons entry
epa-file-passphrase-alist)))
- (setq passphrase (epg-passphrase-callback-function key-id nil))
+ (setq passphrase (epg-passphrase-callback-function context
+ key-id nil))
(setcdr entry (copy-sequence passphrase))
passphrase)))
(setcdr entry (copy-sequence passphrase))
passphrase)))
- (epg-passphrase-callback-function key-id nil)))
+ (epg-passphrase-callback-function context key-id nil)))
(defun epa-file-handler (operation &rest args)
(save-match-data
(defun epa-file-handler (operation &rest args)
(save-match-data
(progn
(setq passphrase
(funcall
(progn
(setq passphrase
(funcall
(if (consp (epg-context-passphrase-callback
epg-context))
(car (epg-context-passphrase-callback
(if (consp (epg-context-passphrase-callback
epg-context))
(car (epg-context-passphrase-callback
(defun epg-status-PROGRESS (process string)
(if (string-match "\\`\\([^ ]+\\) \\([^ ]\\) \\([0-9]+\\) \\([0-9]+\\)"
string)
(defun epg-status-PROGRESS (process string)
(if (string-match "\\`\\([^ ]+\\) \\([^ ]\\) \\([0-9]+\\) \\([0-9]+\\)"
string)
- (funcall (if (consp (epg-context-progress-callback epg-context))
+ (funcall epg-context
+ (if (consp (epg-context-progress-callback epg-context))
(car (epg-context-progress-callback epg-context))
(epg-context-progress-callback epg-context))
(match-string 1 string)
(car (epg-context-progress-callback epg-context))
(epg-context-progress-callback epg-context))
(match-string 1 string)
(cons 'fingerprint (substring string (match-end 0))))
(epg-context-result-for epg-context 'sign)))))
(cons 'fingerprint (substring string (match-end 0))))
(epg-context-result-for epg-context 'sign)))))
-(defun epg-passphrase-callback-function (key-id handback)
+(defun epg-passphrase-callback-function (context key-id handback)
(read-passwd
(if (eq key-id 'SYM)
"Passphrase for symmetric encryption: "
(read-passwd
(if (eq key-id 'SYM)
"Passphrase for symmetric encryption: "
(format "Passphrase for %s %s: " key-id (cdr entry))
(format "Passphrase for %s: " key-id)))))))
(format "Passphrase for %s %s: " key-id (cdr entry))
(format "Passphrase for %s: " key-id)))))))
-(defun epg-progress-callback-function (what char current total handback)
+(defun epg-progress-callback-function (context what char current total
+ handback)
(message "%s: %d%%/%d%%" what current total))
(defun epg-configuration ()
(message "%s: %d%%/%d%%" what current total))
(defun epg-configuration ()
(defvar pgg-epg-secret-key-id-list nil)
(defvar pgg-epg-secret-key-id-list nil)
-(defun pgg-epg-passphrase-callback (key-id ignore)
+(defun pgg-epg-passphrase-callback (context key-id ignore)
- (epg-passphrase-callback-function key-id nil)
+ (epg-passphrase-callback-function context key-id nil)
(let* ((entry (assoc key-id epg-user-id-alist))
(passphrase
(pgg-read-passphrase
(let* ((entry (assoc key-id epg-user-id-alist))
(passphrase
(pgg-read-passphrase