summaryrefslogtreecommitdiffstats
path: root/g10/passphrase.c
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 /g10/passphrase.c
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/passphrase.c8
1 files changed, 5 insertions, 3 deletions
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;