1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-18 00:49:50 +02:00

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.
This commit is contained in:
Ben Kibbey 2012-01-17 19:49:10 -05:00
parent 4402dc3f0a
commit ae981dd8f4

View File

@ -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);