diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog index 16b2d87a..5eb47663 100644 --- a/gpgme/ChangeLog +++ b/gpgme/ChangeLog @@ -1,5 +1,8 @@ 2004-04-05 Werner Koch + * verify.c (parse_error): Compare only the last part of the where + token. + * engine-gpgsm.c (gpgsm_keylist_ext): Send with-validation option. Fixed pattern construction. diff --git a/gpgme/conversion.c b/gpgme/conversion.c index 8faf8522..12a58229 100644 --- a/gpgme/conversion.c +++ b/gpgme/conversion.c @@ -396,7 +396,7 @@ _gpgme_map_gnupg_error (char *err) /* Future version of GnuPG might return the error code directly, so we first test for a a numerical value and use that verbatim. Note that this numerical value might be followed by an - udnerschore and the textual representation of the error code. */ + underschore and the textual representation of the error code. */ if (*err >= '0' && *err <= '9') return strtoul (err, NULL, 10); diff --git a/gpgme/verify.c b/gpgme/verify.c index b3287bda..05ea5209 100644 --- a/gpgme/verify.c +++ b/gpgme/verify.c @@ -430,6 +430,7 @@ parse_error (gpgme_signature_t sig, char *args) gpgme_error_t err; char *where = strchr (args, ' '); char *which; + char *where_last; if (where) { @@ -445,11 +446,16 @@ parse_error (gpgme_signature_t sig, char *args) else return gpg_error (GPG_ERR_INV_ENGINE); + /* It is often useful to compare only the last part of the where token. */ + where_last = strrchr (where, '.'); + if (!where_last) + where_last = where; + err = _gpgme_map_gnupg_error (which); - if (!strcmp (where, "verify.findkey")) + if (!strcmp (where_last, ".findkey")) sig->status = err; - else if (!strcmp (where, "verify.keyusage") + else if (!strcmp (where_last, ".keyusage") && gpg_err_code (err) == GPG_ERR_WRONG_KEY_USAGE) sig->wrong_key_usage = 1;