Improve error message for expired subkeys

Werner Koch wk at
Wed May 18 10:01:24 CEST 2016

On Fri, 13 May 2016 12:06, steve at said:

> Is it possible to receive a more precise error message for such cases?
> Something like

With the current git master you get KEY_DISCOVERY status lines which can
be used to get improved errror messages.  To make things easier I have
implemented that in GPGME; GPGME will now give the the error code
GPG_ERR_SUBKEYS_EXP_OR_REV in the invalid_recipients reason field.  You
may use the new tool gpgme/tests/run-encrypt to test this.

To make use of the new error code you may add

#if GPG_ERROR_VERSION_NUMBER < 0x011700  /* 1.23 */

to your code and use that error code to show a more informative message
and a description what to do.  There is a little drawback here:
libgpg-error will print "Unknown error code" as long as you have not
uopdated to 1.23 (which has not yet been released).



Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.
    /* EFH in Erkrath: */

More information about the Gnupg-devel mailing list