From: ueno Date: Mon, 4 Sep 2006 06:09:23 +0000 (+0000) Subject: * epg-config.el (epg-passphrase-coding-system): New user option. X-Git-Tag: epg-0_0_5~5 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=1f3d4aa31fa27b7e7be85aabe9eac976067c046c;p=elisp%2Fepg.git * epg-config.el (epg-passphrase-coding-system): New user option. --- diff --git a/ChangeLog b/ChangeLog index 76619e5..e9c8adc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2006-09-04 Daiki Ueno + * epg-config.el (epg-passphrase-coding-system): New user option. + * epg.el (epg--list-keys-1): Respect epg-gpg-home-directory. (epg--clear-string): New function. (epg--status-GET_HIDDEN): Encode passphrase with diff --git a/epg-config.el b/epg-config.el index d28fcce..3f15d90 100644 --- a/epg-config.el +++ b/epg-config.el @@ -42,6 +42,11 @@ :group 'epg :type '(choice (const :tag "Default" nil) directory)) +(defcustom epg-passphrase-coding-system nil + "The coding-system used to type passphrases." + :group 'epg + :type 'symbol) + (defconst epg-version-number "0.0.4") (defconst epg-gpg-minimum-version "1.4.3") diff --git a/epg.el b/epg.el index 6000dc5..13fd55b 100644 --- a/epg.el +++ b/epg.el @@ -950,11 +950,18 @@ This function is for internal use only." (when passphrase (setq passphrase-with-new-line (concat passphrase "\n")) (epg--clear-string passphrase) - (setq passphrase nil - encoded-passphrase-with-new-line - (encode-coding-string passphrase-with-new-line - (terminal-coding-system))) - + (setq passphrase nil) + (if epg-passphrase-coding-system + (progn + (setq encoded-passphrase-with-new-line + (encode-coding-string + passphrase-with-new-line + epg-passphrase-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) encoded-passphrase-with-new-line))) (quit