From 691dae270b3b741178912599724d69adabdb48b9 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Tue, 9 Jun 2015 21:07:00 +0900 Subject: agent: Add option --allow-emacs-pinentry * agent/agent.h (opt): Add field allow_emacs_pinentry. * agent/call-pinentry.c (start_pinentry): Act upon new var. * agent/gpg-agent.c (oAllowEmacsPinentry): New. (opts): Add option --allow-emacs-pinentry. (parse_rereadable_options): Set this option. * tools/gpgconf-comp.c (gc_options_gpg_agent): Add new option. -- gpgconf-comp and manual entry added by wk. Signed-off-by: Werner Koch --- agent/call-pinentry.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'agent/call-pinentry.c') diff --git a/agent/call-pinentry.c b/agent/call-pinentry.c index 018a609a3..ba40f4dc1 100644 --- a/agent/call-pinentry.c +++ b/agent/call-pinentry.c @@ -423,6 +423,16 @@ start_pinentry (ctrl_t ctrl) return unlock_pinentry (rc); } + if (opt.allow_emacs_pinentry) + { + /* Indicate to the pinentry that it may read passphrase through + Emacs minibuffer, if possible. */ + rc = assuan_transact (entry_ctx, "OPTION allow-emacs-prompt", + NULL, NULL, NULL, NULL, NULL, NULL); + if (rc && gpg_err_code (rc) != GPG_ERR_UNKNOWN_OPTION) + return unlock_pinentry (rc); + } + { /* Provide a few default strings for use by the pinentries. This -- cgit v1.2.3