Auto-reconnect after connection failures to gpg-agent.
authorWerner Koch <wk@gnupg.org>
Mon, 25 Feb 2019 17:15:47 +0000 (18:15 +0100)
committerWerner Koch <wk@gnupg.org>
Mon, 25 Feb 2019 17:15:47 +0000 (18:15 +0100)
commitc6fb7d7f4352dc6c2610f4c4af9119369084e812
tree5a1d7dc46e6826b9ad1392776dddef3e8105c870
parent8671efe71a9519c863449666666a58612a1452c4
Auto-reconnect after connection failures to gpg-agent.

* src/get-path.c (gnupg_version_string): New.
(read_first_line): New.
(extract_version_string): New.  Taken from gpgme.
(get_gpgconf_path): Retrieve GnuPG version.
(get_gnupg_version): New.
(is_gnupg_older_than): New.
(get_bindir): Re-implement using read_first_line.
* src/support.h: Include gpg-error.h
* src/agent.c (agent_version_major, agent_version_minor): Remove.
(agent_connect): Implement using read_first_line.  Use combined launch
command with fallback to tow command for GnuPG < 2.2.14.
(read_version_cb): Remove.
(agent_configure): Don't send GETINFO.
(scute_agent_get_agent_version): Remove.  Change callers to use the
new get_gnupg_version.
(check_broken_pipe): New.
(ensure_agent_connection): New.
(scute_agent_learn): Ensure that an agent has been started and detect
a broekn pipe.
(scute_agent_check_status): Ditto.
(scute_agent_sign): Ditto.
(scute_agent_decrypt): Ditto.
(scute_agent_is_trusted): Ditto.
(scute_agent_get_cert): Ditto.
(scute_agent_get_random): Ditto.

Signed-off-by: Werner Koch <wk@gnupg.org>
src/agent.c
src/agent.h
src/get-path.c
src/p11-getslotinfo.c
src/support.h