aboutsummaryrefslogtreecommitdiffstats
path: root/g10/passphrase.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/passphrase.c')
-rw-r--r--g10/passphrase.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/g10/passphrase.c b/g10/passphrase.c
index a04874fe8..546394832 100644
--- a/g10/passphrase.c
+++ b/g10/passphrase.c
@@ -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;