(defvar epg-pending-status-list nil)
(defvar epg-key-id nil)
(defvar epg-context nil)
-(defvar epg-debug nil)
(defvar epg-debug-buffer nil)
;; from gnupg/include/cipher.h
(string-match "\\`passphrase\\." string))
(let (inhibit-quit
passphrase
- passphrase-with-new-line)
+ passphrase-with-new-line
+ encoded-passphrase-with-new-line)
(unwind-protect
(condition-case nil
(progn
(cdr (epg-context-passphrase-callback context)))))
(when passphrase
(setq passphrase-with-new-line (concat passphrase "\n"))
- (fillarray passphrase 0)
+ (epg--clear-string passphrase)
(setq passphrase nil)
+ (if epg-locale-coding-system
+ (progn
+ (setq encoded-passphrase-with-new-line
+ (encode-coding-string
+ passphrase-with-new-line
+ epg-locale-coding-system))
+ (epg--clear-string passphrase-with-new-line)
+ (setq passphrase-with-new-line nil))
+ (setq encoded-passphrase-with-new-line
+ passphrase-with-new-line
+ passphrase-with-new-line nil))
(process-send-string (epg-context-process context)
- passphrase-with-new-line)))
+ encoded-passphrase-with-new-line)))
(quit
(epg-context-set-result-for
context 'error
(epg-context-result-for context 'error)))
(delete-process (epg-context-process context))))
(if passphrase
- (fillarray passphrase 0))
+ (epg--clear-string passphrase))
(if passphrase-with-new-line
- (fillarray passphrase-with-new-line 0))))))
+ (epg--clear-string passphrase-with-new-line))
+ (if encoded-passphrase-with-new-line
+ (epg--clear-string encoded-passphrase-with-new-line))))))
(defun epg--status-GET_BOOL (context string)
(let ((entry (assoc string epg-prompt-alist))
(message "%s: %d%%/%d%%" what current total))
(defun epg--list-keys-1 (context name mode)
- (let ((args (append (list "--with-colons" "--no-greeting" "--batch"
+ (let ((args (append (if epg-gpg-home-directory
+ (list "--homedir" epg-gpg-home-directory))
+ (list "--with-colons" "--no-greeting" "--batch"
"--with-fingerprint"
"--with-fingerprint"
(if (memq mode '(t secret))
(file-directory-p tempdir)
(delete-directory tempdir))))))
+(if (fboundp 'clear-string)
+ (defalias 'epg--clear-string 'clear-string)
+ (defun epg--clear-string (string)
+ (fillarray string 0)))
+
;;;###autoload
(defun epg-cancel (context)
(if (buffer-live-p (process-buffer (epg-context-process context)))