Page MenuHome GnuPG

More informative error message for unusable keys
Open, NormalPublic

Description

When a key's signature has expired, gpg produces the useless error message
"unusable public/secret key", as in:

gpg: ####: skipped: unusable public key
gpg: [stdin]: encryption failed: unusable public key

This is unhelpful and annoying because it does not tell the user what is wrong
or what could be done to fix it. Yes, I know --verbose exists, but given the
general chattiness of gpg's output it shouldn't be necessary to turn on extra
output just to get an informative error message.

Related, I found:

https://bugs.launchpad.net/ubuntu/+source/gnupg/+bug/50675

where they decide that this problem should be fixed upstream. So I'm reporting
it upstream.

Details

Version
all

Event Timeline

wiml set Version to 1.4.10.
wiml added a subscriber: wiml.
werner changed Version from 1.4.10 to all.
werner added a subscriber: werner.

We won't do this for 1.4.

Still no better message with gpg 2.1.21:

$ echo foo | gpg2 --status-fd 2 -u "Dummy Tester" --faked-system-time 1999999999 --clearsign
gpg: WARNING: running with faked system time: 2033-05-18 03:33:19
[GNUPG:] KEYEXPIRED 1561818236
[GNUPG:] KEY_CONSIDERED 5769CC454D695E0D0F2B7C8B3645CF0C3AE28EC6 3
gpg: skipped "Dummy Tester": Unusable secret key
[GNUPG:] INV_SGNR 9 Dummy Tester
[GNUPG:] FAILURE sign 54
gpg: [stdin]: clear-sign failed: Unusable secret key