Home GnuPG
Diffusion GPGME ad0c5ab4cd8d

core: Return NO_SECKEY error code on decryption

Description

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: T3270
  • Signed-off-by: Werner Koch <wk@gnupg.org>