aboutsummaryrefslogtreecommitdiffstats
path: root/agent/command.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2011-03-03 17:35:08 +0000
committerWerner Koch <[email protected]>2011-03-03 17:35:08 +0000
commitb786f0e12b93d8d61eea18c934f5731fe86402d3 (patch)
tree2286e2a32cdc573b9cf2ac482fea66150238d0c4 /agent/command.c
parentPrint the secret keyinfo stuff with --card-status again. (diff)
downloadgnupg-b786f0e12b93d8d61eea18c934f5731fe86402d3.tar.gz
gnupg-b786f0e12b93d8d61eea18c934f5731fe86402d3.zip
New agent option pinentry-mode.
This provides the framework and implements the ask, cancel and error. loopback will be implemented later.
Diffstat (limited to 'agent/command.c')
-rw-r--r--agent/command.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/agent/command.c b/agent/command.c
index 79b9b9731..b4b9b9e4c 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -2402,6 +2402,24 @@ option_handler (assuan_context_t ctx, const char *key, const char *value)
ctrl->server_local->use_cache_for_signing = *value? atoi (value) : 0;
else if (!strcmp (key, "allow-pinentry-notify"))
ctrl->server_local->allow_pinentry_notify = 1;
+ else if (!strcmp (key, "pinentry-mode"))
+ {
+ if (!strcmp (value, "ask") || !strcmp (value, "default"))
+ ctrl->pinentry_mode = PINENTRY_MODE_ASK;
+ else if (!strcmp (value, "cancel"))
+ ctrl->pinentry_mode = PINENTRY_MODE_CANCEL;
+ else if (!strcmp (value, "error"))
+ ctrl->pinentry_mode = PINENTRY_MODE_ERROR;
+ else if (!strcmp (value, "loopback"))
+ {
+ if (opt.allow_loopback_pinentry)
+ ctrl->pinentry_mode = PINENTRY_MODE_LOOPBACK;
+ else
+ err = gpg_error (GPG_ERR_NOT_SUPPORTED);
+ }
+ else
+ err = gpg_error (GPG_ERR_INV_VALUE);
+ }
else
err = gpg_error (GPG_ERR_UNKNOWN_OPTION);