aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2013-02-21 19:27:20 +0000
committerWerner Koch <[email protected]>2013-02-22 08:30:02 +0000
commitbaee681d2406530c45fd6d4bde77193ba23ac263 (patch)
treeb0d8498d5c28d15a1a9afd600b560a0c1a8106b7
parentcommon: Add func has_leading_keyword. (diff)
downloadgnupg-baee681d2406530c45fd6d4bde77193ba23ac263.tar.gz
gnupg-baee681d2406530c45fd6d4bde77193ba23ac263.zip
gpg: Handle the agent's NEW_PASSPHRASE inquiry.
* g10/call-agent.c (default_inq_cb): Take care of NEW_PASSPHRASE.
-rw-r--r--g10/call-agent.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/g10/call-agent.c b/g10/call-agent.c
index e3250fe46..908d2761c 100644
--- a/g10/call-agent.c
+++ b/g10/call-agent.c
@@ -336,7 +336,7 @@ default_inq_cb (void *opaque, const char *line)
gpg_error_t err = 0;
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);
if (err)
@@ -344,7 +344,8 @@ default_inq_cb (void *opaque, const char *line)
"PINENTRY_LAUNCHED");
/* 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)
{
if (have_static_passphrase ())