From ae981dd8f454e2a8bbc6429bed5abc5e87cc83d5 Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Tue, 17 Jan 2012 19:49:10 -0500 Subject: 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. --- agent/command.c | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- cgit v1.2.3