* epa.el (epa-passphrase-callback-function): Moved from epg.el.
authorueno <ueno>
Sun, 24 Sep 2006 00:19:26 +0000 (00:19 +0000)
committerueno <ueno>
Sun, 24 Sep 2006 00:19:26 +0000 (00:19 +0000)
(epa-progress-callback-function): Ditto.
* epg.el (epg-passphrase-callback-function): Made it obsolete.
(epg-progress-callback-function): Ditto.

ChangeLog
epa-file.el
epa.el
epg.el
pgg-epg.el

index bfa3c24..29d3bcb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-09-24  Daiki Ueno  <ueno@unixuser.org>
+
+       * 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  <ueno@unixuser.org>
 
        * epg.el (epg-start-decrypt): Append "--" to the end of options.
index 2b47373..6f58c8c 100644 (file)
                (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 (file)
--- 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 (file)
--- 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))
index 8d5cf8e..bd1a167 100644 (file)
 
 ;;; 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