diff options
author | Werner Koch <[email protected]> | 2013-02-21 19:27:20 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2013-02-21 19:27:20 +0000 |
commit | 18a261b65fd77a9e434b13483ceaaaf2176f1197 (patch) | |
tree | aab0096eefbe58a23172fe20b0eba102dc04a790 | |
parent | common: Add func has_leading_keyword. (diff) | |
download | gnupg-18a261b65fd77a9e434b13483ceaaaf2176f1197.tar.gz gnupg-18a261b65fd77a9e434b13483ceaaaf2176f1197.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.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/g10/call-agent.c b/g10/call-agent.c index 85a3f2842..4828f9a3f 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 ()) |