(simple_pwquery): Handle gpg-error style return

code for canceled.
This commit is contained in:
Werner Koch 2004-08-18 14:37:22 +00:00
parent 9c6da35ea2
commit 33310977ac
3 changed files with 17 additions and 2 deletions

4
TODO
View File

@ -22,6 +22,10 @@ might want to have an agent context for each service request
** figure out how to auto retrieve a key by serialno+issuer.
Dirmngr is currently not able to parse more than the CN.
* sm/certlist.c
** ocspSigning usage is not fully implemented
We should review the entire CRL and OCSP validation system.
* sm/decrypt.c
** replace leading zero in integer hack by a cleaner solution

View File

@ -1,3 +1,8 @@
2004-08-18 Werner Koch <wk@g10code.de>
* simple-pwquery.c (simple_pwquery): Handle gpg-error style return
code for canceled.
2004-07-20 Werner Koch <wk@g10code.de>
* maperror.c: Removed header ksba.h. Not required anymore.

View File

@ -466,9 +466,15 @@ simple_pwquery (const char *cacheid,
result = pw;
pw = NULL;
}
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; 0xffff is used to mask out the
error source. */
#ifdef SPWQ_USE_LOGGING
log_info (_("canceled by user\n") );
#endif