diff -Naur gpgme-1.0.3/gpgme/verify.c gpgme-1.0.3.fw/gpgme/verify.c --- gpgme-1.0.3/gpgme/verify.c 2005-06-20 21:14:49.000000000 +0200 +++ gpgme-1.0.3.fw/gpgme/verify.c 2007-03-14 16:13:47.000000000 +0100 @@ -488,8 +488,11 @@ } +/* Parse an error status line and if SET_STATUS is true update the + result status as appropriate. With SET_STATUS being false, only + check for an error. */ static gpgme_error_t -parse_error (gpgme_signature_t sig, char *args) +parse_error (gpgme_signature_t sig, char *args, int set_status) { gpgme_error_t err; char *where = strchr (args, ' '); @@ -511,7 +514,16 @@ err = _gpgme_map_gnupg_error (which); - if (!strcmp (where, "verify.findkey")) + if (!strcmp (where, "proc_pkt.plaintext") + && gpg_err_code (err) == GPG_ERR_BAD_DATA) + { + /* This indicates a double plaintext. The only solid way to + handle this is by failing the oepration. */ + return gpg_error (GPG_ERR_BAD_DATA); + } + else if (!set_status) + ; + else if (!strcmp (where, "verify.findkey")) sig->status = err; else if (!strcmp (where, "verify.keyusage") && gpg_err_code (err) == GPG_ERR_WRONG_KEY_USAGE) @@ -594,9 +606,9 @@ case GPGME_STATUS_ERROR: opd->only_newsig_seen = 0; - /* The error status is informational, so we don't return an - error code if we are not ready to process this status. */ - return sig ? parse_error (sig, args) : 0; + /* Some error stati are informational, so we don't return an + error code if we are not ready to process this status. */ + return parse_error (sig, args, !!sig ); case GPGME_STATUS_EOF: if (sig && !opd->did_prepare_new_sig)