core: Return NO_SECKEY error code on decryption
authorWerner Koch <wk@gnupg.org>
Wed, 12 Jul 2017 16:30:49 +0000 (18:30 +0200)
committerWerner Koch <wk@gnupg.org>
Wed, 12 Jul 2017 16:30:49 +0000 (18:30 +0200)
commitad0c5ab4cd8d3a1b11b37dc137b75a67aa26da37
treea8ee1156e1672fae12a5f1136c76705cc2d7449a
parentd37bc7e025cdc6228da45b2b527e9f3bfef71c71
core: Return NO_SECKEY error code on decryption

* src/decrypt.c (op_data_t): Add flag any_no_seckey.
(_gpgme_decrypt_status_handler): Consult that flag.
(_gpgme_decrypt_status_handler): Set that flag.
--

The NO_SECKEY is emitted instead of an "S ERROR pkdecrypt_failed" if
gpg knowns that a key has been encrypted to that key (cf. "S ENC_TO").
it is not fool proffof but in the majority of cases we can provide a
better error message than just DECRYPTION_FAILED.

GnuPG-bug-id: 3270
Signed-off-by: Werner Koch <wk@gnupg.org>
doc/gpgme.texi
src/decrypt.c