2004-08-18 Marcus Brinkmann <marcus@g10code.de>

* passphrase.c (agent_get_passphrase):
This commit is contained in:
Marcus Brinkmann 2004-08-18 00:03:07 +00:00
parent e5a6d2b456
commit 9d864ebef7
2 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2004-08-18 Marcus Brinkmann <marcus@g10code.de>
* passphrase.c (agent_get_passphrase): Fix detection of gpg-agent
cancellation.
2004-07-01 Werner Koch <wk@gnupg.org>
* card-util.c (change_login): Kludge to allow reading data from a

View File

@ -862,9 +862,11 @@ agent_get_passphrase ( u32 *keyid, int mode, const char *tryagain_text,
xfree (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;