aboutsummaryrefslogtreecommitdiffstats
path: root/agent/command.c
diff options
context:
space:
mode:
authorBen Kibbey <[email protected]>2011-09-11 20:55:34 +0000
committerWerner Koch <[email protected]>2011-09-12 07:54:16 +0000
commitfb1cdd7b0ebece16ffe60a30e4d01c5dbb1ca92b (patch)
tree3b5768e1b8efe24ac70e3797638347095cede82a /agent/command.c
parentMark component descriptions for translation. (diff)
downloadgnupg-fb1cdd7b0ebece16ffe60a30e4d01c5dbb1ca92b.tar.gz
gnupg-fb1cdd7b0ebece16ffe60a30e4d01c5dbb1ca92b.zip
Handle pinentry-mode=loopback.
When this mode is set an inquire will be sent to the client to retrieve the passphrase. This adds a new inquire keyword "NEW_PASSPHRASE" that the GENKEY and PASSWD commands use when generating a new key.
Diffstat (limited to 'agent/command.c')
-rw-r--r--agent/command.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/agent/command.c b/agent/command.c
index 6973e78e5..f310a980c 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -2731,3 +2731,18 @@ start_command_handler (ctrl_t ctrl, gnupg_fd_t listen_fd, gnupg_fd_t fd)
xfree (ctrl->server_local);
ctrl->server_local = NULL;
}
+
+
+gpg_error_t
+pinentry_loopback(ctrl_t ctrl, const char *keyword,
+ unsigned char **buffer, size_t *size,
+ size_t max_length)
+{
+ gpg_error_t rc;
+ assuan_context_t ctx = ctrl->server_local->assuan_ctx;
+
+ assuan_begin_confidential (ctx);
+ rc = assuan_inquire (ctx, keyword, buffer, size, max_length);
+ assuan_end_confidential (ctx);
+ return rc;
+}