1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-08 12:44:23 +01:00

(agent_get_passphrase): Fixed detection of canceled

error state as send by current gpg-agents.
This commit is contained in:
Werner Koch 2004-08-18 10:12:39 +00:00
parent 3cecfe2496
commit 2639033890
2 changed files with 13 additions and 2 deletions

@ -1,3 +1,8 @@
2004-08-18 Werner Koch <wk@g10code.de>
* passphrase.c (agent_get_passphrase): Fixed detection of canceled
error state as send by current gpg-agents.
2004-08-16 Werner Koch <wk@g10code.de>
* gpgv.c: Removed stray semicolon.

@ -867,9 +867,15 @@ 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 > 7 && !memcmp (pw, "ERR 111", 7)
&& (pw[7] == ' ' || pw[7] == '\n'))
|| ((nread > 4 && !memcmp (pw, "ERR ", 4)
&& (strtoul (pw+4, NULL, 0) & 0xffff) == 99)) )
{
/* 111 is the old Assuan code for canceled which might still
be in use by old installations. 99 is GPG_ERR_CANCELED as
used by modern gpg-agents; 0xfff is used to mask out the
error source. */
log_info (_("cancelled by user\n") );
if (canceled)
*canceled = 1;