-(defun epg-status-GET_HIDDEN (process string)
- (if (and epg-key-id
- (string-match "\\`passphrase\\." string))
- (let (inhibit-quit
- passphrase
- passphrase-with-new-line)
- (unwind-protect
- (condition-case nil
- (progn
- (setq passphrase
- (funcall
- (if (consp (epg-context-passphrase-callback
- epg-context))
- (car (epg-context-passphrase-callback
- epg-context))
- (epg-context-passphrase-callback epg-context))
- epg-context
- epg-key-id
- (if (consp (epg-context-passphrase-callback
- epg-context))
- (cdr (epg-context-passphrase-callback
- epg-context)))))
- (when passphrase
- (setq passphrase-with-new-line (concat passphrase "\n"))
- (fillarray passphrase 0)
- (setq passphrase nil)
- (process-send-string process passphrase-with-new-line)))
- (quit
- (epg-context-set-result-for
- epg-context 'error
- (cons '(quit)
- (epg-context-result-for epg-context 'error)))
- (delete-process process)))
- (if passphrase
- (fillarray passphrase 0))
- (if passphrase-with-new-line
- (fillarray passphrase-with-new-line 0))))))
-
-(defun epg-status-GET_BOOL (process string)
+(defun epg--status-GET_HIDDEN (context string)
+ (when (and epg-key-id
+ (string-match "\\`passphrase\\." string))
+ (unless (epg-context-passphrase-callback context)
+ (error "passphrase-callback not set"))
+ (let (inhibit-quit
+ passphrase
+ passphrase-with-new-line
+ encoded-passphrase-with-new-line)
+ (unwind-protect
+ (condition-case nil
+ (progn
+ (setq passphrase
+ (funcall
+ (if (consp (epg-context-passphrase-callback context))
+ (car (epg-context-passphrase-callback context))
+ (epg-context-passphrase-callback context))
+ context
+ epg-key-id
+ (if (consp (epg-context-passphrase-callback context))
+ (cdr (epg-context-passphrase-callback context)))))
+ (when passphrase
+ (setq passphrase-with-new-line (concat passphrase "\n"))
+ (epg--clear-string passphrase)
+ (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
+ (epg-context-set-result-for
+ context 'error
+ (cons '(quit)
+ (epg-context-result-for context 'error)))
+ (delete-process (epg-context-process context))))
+ (if passphrase
+ (epg--clear-string passphrase))
+ (if passphrase-with-new-line
+ (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)