From 777cf7f2d17331cfe127129c750121970fcad58f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Fri, 28 Jul 2023 14:18:05 +0200 Subject: [PATCH] core: Return bad data error instead of general error on unexpected data * src/verify.c (_gpgme_verify_status_handler): Return GPG_ERR_BAD_DATA instead of GPG_ERR_GENERAL. -- This gives users trying to decrypt and/or verify for example a public key block a more useful error. GnuPG-bug-id: 6617 --- src/verify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/verify.c b/src/verify.c index a8467156..3ae94c65 100644 --- a/src/verify.c +++ b/src/verify.c @@ -979,7 +979,7 @@ _gpgme_verify_status_handler (void *priv, gpgme_status_code_t code, char *args) case GPGME_STATUS_UNEXPECTED: opd->only_newsig_seen = 0; if (!sig) - return gpg_error (GPG_ERR_GENERAL); + return gpg_error (GPG_ERR_BAD_DATA); sig->status = gpg_error (GPG_ERR_NO_DATA); break;