gpg 2.1: no error message if gpg-agent or pinentry fail

Patrick Brunschwig patrick at enigmail.net
Sun Apr 5 17:33:51 CEST 2015


On 11.03.15 16:45, Werner Koch wrote:
> Trying to decrypt something gives these messages:
> 
> [...] gpg: public key decryption failed: Tribute to D. A. [GNUPG:]
> ERROR pkdecrypt_failed 67108906 [GNUPG:] BEGIN_DECRYPTION [GNUPG:]
> DECRYPTION_FAILED gpg: decryption failed: No secret key [GNUPG:]
> END_DECRYPTION
> 
> Right you can't see the source of the error.  Thus we need to look
> at the ERROR status line:
> 
> $ gpg-error 67108906 67108906 = (4, 42) = (GPG_ERR_SOURCE_GPGAGENT,
> GPG_ERR_TRIBUTE_TO_D_A) = (GPG Agent, Tribute to D. A.)

As it looks like, gpg-error is not always installed. I think I can
live with it, if I know the source of the error.

Is the following interpretation of the error number correct: ?
- bits 1-24: used for the error code
- bits 25-31: used for the source of the error as defined in
gpg_err_source_t. The error sources are guaranteed to be the same
across all versions of GnuPG.

Thanks
-Patrick



More information about the Gnupg-devel mailing list