aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Kibbey <[email protected]>2012-01-18 00:49:10 +0000
committerBen Kibbey <[email protected]>2012-01-18 00:49:10 +0000
commitae981dd8f454e2a8bbc6429bed5abc5e87cc83d5 (patch)
treecbd62b87a14866dd094c310d390d95aca1189e45
parentyat2m: don't dereference pointer to freed memory (diff)
downloadgnupg-ae981dd8f454e2a8bbc6429bed5abc5e87cc83d5.tar.gz
gnupg-ae981dd8f454e2a8bbc6429bed5abc5e87cc83d5.zip
Add the INQUIRE_MAXLEN status message.
This status message is used to inform the client of the maximum length of an inquired passphrase and is used in pinentry-mode=loopback. * agent/command.c (pinentry_loopback): Send the INQUIRE_MAXLEN status message before doing the inquire.
-rw-r--r--agent/command.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/agent/command.c b/agent/command.c
index ad86a3575..5fa8bceaf 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -2791,6 +2791,12 @@ pinentry_loopback(ctrl_t ctrl, const char *keyword,
{
gpg_error_t rc;
assuan_context_t ctx = ctrl->server_local->assuan_ctx;
+ char buf[50];
+
+ snprintf (buf, sizeof (buf), "%u", max_length);
+ rc = assuan_write_status (ctx, "INQUIRE_MAXLEN", buf);
+ if (rc)
+ return rc;
assuan_begin_confidential (ctx);
rc = assuan_inquire (ctx, keyword, buffer, size, max_length);