diff options
author | Marcus Brinkmann <[email protected]> | 2004-08-18 00:06:08 +0000 |
---|---|---|
committer | Marcus Brinkmann <[email protected]> | 2004-08-18 00:06:08 +0000 |
commit | 75ac082a76254e3b17383c9386033483b6cea0fe (patch) | |
tree | 6fe04ac9513819a1438feb58f99eb44e3b3bad9f | |
parent | * plaintext.c (handle_plaintext): Bigger buffer for extra safety. (diff) | |
download | gnupg-75ac082a76254e3b17383c9386033483b6cea0fe.tar.gz gnupg-75ac082a76254e3b17383c9386033483b6cea0fe.zip |
2004-08-18 Marcus Brinkmann <[email protected]>
* passphrase.c (agent_get_passphrase):
-rw-r--r-- | g10/ChangeLog | 5 | ||||
-rw-r--r-- | g10/passphrase.c | 8 |
2 files changed, 10 insertions, 3 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog index ebf62b7ba..8ee93128c 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,8 @@ +2004-08-18 Marcus Brinkmann <[email protected]> + + * passphrase.c (agent_get_passphrase): Fix detection of gpg-agent + cancellation. + 2004-08-08 David Shaw <[email protected]> * plaintext.c (handle_plaintext): Bigger buffer for extra safety. diff --git a/g10/passphrase.c b/g10/passphrase.c index 178cd23d0..e4546ee5a 100644 --- a/g10/passphrase.c +++ b/g10/passphrase.c @@ -868,9 +868,11 @@ agent_get_passphrase ( u32 *keyid, int mode, const char *tryagain_text, m_free (orig_codeset); return pw; } - else if (nread > 7 && !memcmp (pw, "ERR 111", 7) - && (pw[7] == ' ' || pw[7] == '\n') ) - { + else if (nread > 4 && !memcmp (pw, "ERR ", 4) + && (0xffff & strtoul (&pw[4], NULL, 0)) == 99) + { + /* 99 is GPG_ERR_CANCELED. FIXME: Check tail and overflow, + and use gpg-error. */ log_info (_("cancelled by user\n") ); if (canceled) *canceled = 1; |