summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Brinkmann <mb@g10code.com>2004-08-18 02:03:07 +0200
committerMarcus Brinkmann <mb@g10code.com>2004-08-18 02:03:07 +0200
commit9d864ebef7608faa69a314ad220c270bffd43834 (patch)
tree0b8634c3ea60af90ddc85aa968d9ccd9dbaa4eaf
parent2004-08-17 Marcus Brinkmann <marcus@g10code.de> (diff)
downloadgnupg2-9d864ebef7608faa69a314ad220c270bffd43834.tar.xz
gnupg2-9d864ebef7608faa69a314ad220c270bffd43834.zip
2004-08-18 Marcus Brinkmann <marcus@g10code.de>
* passphrase.c (agent_get_passphrase):
Diffstat (limited to '')
-rw-r--r--g10/ChangeLog5
-rw-r--r--g10/passphrase.c8
2 files changed, 10 insertions, 3 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 7a8ccd5c0..e472a626f 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -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
diff --git a/g10/passphrase.c b/g10/passphrase.c
index 986070a16..30149908e 100644
--- a/g10/passphrase.c
+++ b/g10/passphrase.c
@@ -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;