Page MenuHome GnuPG

Wrong FAILURE message if gpg-agent cannot be started
Closed, ResolvedPublic

Description

If gpg-agent cannot be started (e.g. due to an error in gpg-agent.conf, but also
if gpg-agent cannot be found), then the parseable output by gpg is like this:

gpg2 --status-fd 2 --clearsign -u 0xDD5F693B

gpg: can't connect to the agent: IPC connect call failed
gpg: skipped "0xDD5F693B": No secret key
[GNUPG:] INV_SGNR 9 0xDD5F693B
[GNUPG:] FAILURE sign 17
gpg: [stdin]: clearsign failed: No secret key

"FAILURE sign 17" is "GPG_ERR_NO_SECKEY", which is not quite correct. I would
have expected something like GPG_ERR_NO_AGENT, GPG_ERR_AGENT or
GPG_ERR_ASSUAN_SERVER_FAULT.

Details

Version
2.1.10

Event Timeline

patrick set Version to 2.1.10.
patrick added a subscriber: patrick.
marcus claimed this task.
marcus added a subscriber: marcus.

With commit 9998b162b47931fb8a8ed961d53418d505358888:

$ g10/gpg --status-fd 2 --clearsign -u 57B62140 test.txt 
gpg: can't connect to the agent: IPC connect call failed
gpg: keydb_search failed: No agent running
gpg: skipped "57B62140": No agent running
[GNUPG:] INV_SGNR 0 57B62140
[GNUPG:] FAILURE sign 33554509
gpg: test.txt: clear-sign failed: No agent running
$ gpg-error 33554509
33554509 = (2, 77) = (GPG_ERR_SOURCE_GPG, GPG_ERR_NO_AGENT) = (GnuPG, No agent running)