diff options
author | Ben Kibbey <[email protected]> | 2015-04-17 01:00:30 +0000 |
---|---|---|
committer | Ben Kibbey <[email protected]> | 2015-08-15 21:14:13 +0000 |
commit | f126ca61565922b3b938c3486614b9bd7e6e454c (patch) | |
tree | 8f1b8360088eddb163d81b591a1717e68a07837a /g10/call-agent.c | |
parent | Allow --gen-key to inquire a passphrase. (diff) | |
download | gnupg-f126ca61565922b3b938c3486614b9bd7e6e454c.tar.gz gnupg-f126ca61565922b3b938c3486614b9bd7e6e454c.zip |
Inform a user about inquire length limit.
* common/status.h (INQUIRE_MAXLEN): New.
* g10/call-agent.c (default_inquire_cb): Send STATUS_INQUIRE_MAXLEN.
client when inquiring a passphrase over pinentry-loopback.
--
This is to inform a user about the maximum length of a passphrase. The
limit is the same that gpg-agent uses.
Diffstat (limited to 'g10/call-agent.c')
-rw-r--r-- | g10/call-agent.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/g10/call-agent.c b/g10/call-agent.c index 0df572a62..326eb822c 100644 --- a/g10/call-agent.c +++ b/g10/call-agent.c @@ -177,11 +177,15 @@ default_inq_cb (void *opaque, const char *line) else { char *pw; + char buf[32]; if (parm->keyinfo.keyid) emit_status_need_passphrase (parm->keyinfo.keyid, parm->keyinfo.mainkeyid, parm->keyinfo.pubkey_algo); + + snprintf (buf, sizeof (buf), "%u", 100); + write_status_text (STATUS_INQUIRE_MAXLEN, buf); pw = cpr_get_hidden ("passphrase.enter", _("Enter passphrase: ")); cpr_kill_prompt (); if (*pw == CONTROL_D && !pw[1]) |