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
This commit is contained in:
Ingo Klöcker 2023-07-28 14:18:05 +02:00
parent 0518ed32e2
commit 777cf7f2d1
No known key found for this signature in database
GPG Key ID: F5A5D1692277A1E9

View File

@ -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;