1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-03 12:11:33 +01:00

gpg: Handle the agent's NEW_PASSPHRASE inquiry.

* g10/call-agent.c (default_inq_cb): Take care of NEW_PASSPHRASE.
This commit is contained in:
Werner Koch 2013-02-21 20:27:20 +01:00
parent 4af0c62b15
commit 18a261b65f

View File

@ -336,7 +336,7 @@ default_inq_cb (void *opaque, const char *line)
gpg_error_t err = 0; gpg_error_t err = 0;
struct default_inq_parm_s *parm = opaque; struct default_inq_parm_s *parm = opaque;
if (!strncmp (line, "PINENTRY_LAUNCHED", 17) && (line[17]==' '||!line[17])) if (has_leading_keyword (line, "PINENTRY_LAUNCHED"))
{ {
err = gpg_proxy_pinentry_notify (parm->ctrl, line); err = gpg_proxy_pinentry_notify (parm->ctrl, line);
if (err) if (err)
@ -344,7 +344,8 @@ default_inq_cb (void *opaque, const char *line)
"PINENTRY_LAUNCHED"); "PINENTRY_LAUNCHED");
/* We do not pass errors to avoid breaking other code. */ /* We do not pass errors to avoid breaking other code. */
} }
else if (!strncmp (line, "PASSPHRASE", 10) && (line[10]==' '||!line[10]) else if ((has_leading_keyword (line, "PASSPHRASE")
|| has_leading_keyword (line, "NEW_PASSPHRASE"))
&& opt.pinentry_mode == PINENTRY_MODE_LOOPBACK) && opt.pinentry_mode == PINENTRY_MODE_LOOPBACK)
{ {
if (have_static_passphrase ()) if (have_static_passphrase ())