mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
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.
This commit is contained in:
parent
233b5fedab
commit
f126ca6156
@ -125,7 +125,9 @@ enum
|
|||||||
STATUS_PINENTRY_LAUNCHED,
|
STATUS_PINENTRY_LAUNCHED,
|
||||||
|
|
||||||
STATUS_ERROR,
|
STATUS_ERROR,
|
||||||
STATUS_SUCCESS
|
STATUS_SUCCESS,
|
||||||
|
|
||||||
|
STATUS_INQUIRE_MAXLEN,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -177,11 +177,15 @@ default_inq_cb (void *opaque, const char *line)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *pw;
|
char *pw;
|
||||||
|
char buf[32];
|
||||||
|
|
||||||
if (parm->keyinfo.keyid)
|
if (parm->keyinfo.keyid)
|
||||||
emit_status_need_passphrase (parm->keyinfo.keyid,
|
emit_status_need_passphrase (parm->keyinfo.keyid,
|
||||||
parm->keyinfo.mainkeyid,
|
parm->keyinfo.mainkeyid,
|
||||||
parm->keyinfo.pubkey_algo);
|
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: "));
|
pw = cpr_get_hidden ("passphrase.enter", _("Enter passphrase: "));
|
||||||
cpr_kill_prompt ();
|
cpr_kill_prompt ();
|
||||||
if (*pw == CONTROL_D && !pw[1])
|
if (*pw == CONTROL_D && !pw[1])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user