From: ueno Date: Sun, 24 Sep 2006 00:19:26 +0000 (+0000) Subject: * epa.el (epa-passphrase-callback-function): Moved from epg.el. X-Git-Tag: epg-0_0_6~16 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=c6f6850984026906ab4215455e72d8889f6ad6c9;p=elisp%2Fepg.git * epa.el (epa-passphrase-callback-function): Moved from epg.el. (epa-progress-callback-function): Ditto. * epg.el (epg-passphrase-callback-function): Made it obsolete. (epg-progress-callback-function): Ditto. --- diff --git a/ChangeLog b/ChangeLog index bfa3c24..29d3bcb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-09-24 Daiki Ueno + + * epa.el (epa-passphrase-callback-function): Moved from epg.el. + (epa-progress-callback-function): Ditto. + * epg.el (epg-passphrase-callback-function): Made it obsolete. + (epg-progress-callback-function): Ditto. + 2006-09-23 Daiki Ueno * epg.el (epg-start-decrypt): Append "--" to the end of options. diff --git a/epa-file.el b/epa-file.el index 2b47373..6f58c8c 100644 --- a/epa-file.el +++ b/epa-file.el @@ -49,11 +49,11 @@ (setq entry (list file) epa-file-passphrase-alist (cons entry epa-file-passphrase-alist))) - (setq passphrase (epg-passphrase-callback-function context + (setq passphrase (epa-passphrase-callback-function context key-id nil)) (setcdr entry (copy-sequence passphrase)) passphrase))) - (epg-passphrase-callback-function context key-id nil))) + (epa-passphrase-callback-function context key-id nil))) (defun epa-file-handler (operation &rest args) (save-match-data diff --git a/epa.el b/epa.el index cb0cb3b..4b06f5e 100644 --- a/epa.el +++ b/epa.el @@ -819,6 +819,24 @@ If LOCAL is non-nil, the signature is marked as non exportable." (epg-sign-keys context keys local) (message "Signing keys...done"))) +(defun epa-passphrase-callback-function (context key-id handback) + (if (eq key-id 'SYM) + (read-passwd "Passphrase for symmetric encryption: " + (eq (epg-context-operation context) 'encrypt)) + (read-passwd + (if (eq key-id 'PIN) + "Passphrase for PIN: " + (let ((entry (assoc key-id epg-user-id-alist))) + (if entry + (format "Passphrase for %s %s: " key-id (cdr entry)) + (format "Passphrase for %s: " key-id))))))) + +(defun epa-progress-callback-function (context what char current total + handback) + (message "%s: %d%% (%d/%d)" what + (if (> total 0) (floor (* (/ current (float total)) 100)) 0) + current total)) + (provide 'epa) ;;; epa.el ends here diff --git a/epg.el b/epg.el index 85bb3fa..b405df8 100644 --- a/epg.el +++ b/epg.el @@ -1306,12 +1306,16 @@ This function is for internal use only." (format "Passphrase for %s %s: " key-id (cdr entry)) (format "Passphrase for %s: " key-id))))))) +(make-obsolete 'epg-passphrase-callback-function "Don't use") + (defun epg-progress-callback-function (context what char current total handback) (message "%s: %d%% (%d/%d)" what (if (> total 0) (floor (* (/ current (float total)) 100)) 0) current total)) +(make-obsolete 'epg-progress-callback-function "Don't use") + (defun epg--list-keys-1 (context name mode) (let ((args (append (if epg-gpg-home-directory (list "--homedir" epg-gpg-home-directory)) diff --git a/pgg-epg.el b/pgg-epg.el index 8d5cf8e..bd1a167 100644 --- a/pgg-epg.el +++ b/pgg-epg.el @@ -29,14 +29,14 @@ ;;; Code: -(require 'epg) +(require 'epa) (eval-when-compile (require 'pgg)) (defvar pgg-epg-secret-key-id-list nil) (defun pgg-epg-passphrase-callback (context key-id ignore) (if (eq key-id 'SYM) - (epg-passphrase-callback-function context key-id nil) + (epa-passphrase-callback-function context key-id nil) (let* ((entry (assoc key-id epg-user-id-alist)) (passphrase (pgg-read-passphrase