1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-09 23:39:51 +02:00
gnupg/agent
Daniel Kahn Gillmor 28aa689058 agent: Send pinentry the uid of connecting process where possible.
* agent/agent.h (server_control_s): Add field 'client_uid'.
* agent/call-pinentry.c (start_pinentry): Add uid field to assuan
option "owner" sent to pinentry.
* agent/command-ssh.c (peer_info_s): New static struct.
(get_client_pid): Rename to...
(get_client_info): Here, and extract uid in addition to pid.
(start_command_handler_ssh): Use get_client_info() instead of
get_client_pid().
* agent/command.c (start_command_handler): Try assuan_get_peercred,
and only fall back to assuan_get_pid when assuan_get_peercred fails.

--

This also requires an update to pinentry to handle the new uid field.
Distributing the uid as well as the pid makes it harder for a
different user on the same machine to take advantage of any race
conditions between when a requesting process might ask for something
that needs pinentry, and when pinentry gets around to inspecting the
state of that process.

We put the uid before the nodename because the uid is guaranteed to be
a integer (represented in decimal), which makes it much simpler to
parse past than the potentially arbitrarily structured nodename.

Use a / instead of whitespace to delimit pid/uid at Werner's request.

If we were willing to depend on the nodename being
whitespace-delimited (as the current, unreleased pinentry code does),
then we could add the uid after the nodename.  But since no released
pinentry depends on this option anyway, i think we should make the
more conservative, easily-parseable choice and put the user ID first.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2017-10-19 03:09:44 -04:00
..
agent.h agent: Send pinentry the uid of connecting process where possible. 2017-10-19 03:09:44 -04:00
all-tests.scm tests: Make it possible to run all tests using our infrastructure. 2017-05-11 18:12:37 +02:00
cache.c agent: Serialize access to passphrase cache. 2017-04-07 08:39:26 +09:00
call-pinentry.c agent: Send pinentry the uid of connecting process where possible. 2017-10-19 03:09:44 -04:00
call-scd.c agent: Fix cancellation handling for scdaemon. 2017-09-20 10:42:28 +09:00
ChangeLog-2011 Fix typos 2015-10-28 10:20:17 +01:00
command-ssh.c agent: Send pinentry the uid of connecting process where possible. 2017-10-19 03:09:44 -04:00
command.c agent: Send pinentry the uid of connecting process where possible. 2017-10-19 03:09:44 -04:00
cvt-openpgp.c agent: Resolve conflict of util.h. 2017-03-07 19:22:48 +09:00
cvt-openpgp.h Change all http://www.gnu.org in license notices to https:// 2016-11-05 12:02:19 +01:00
divert-scd.c agent: Fix memory leaks. 2017-05-30 13:56:20 +09:00
findkey.c agent: Minor cleanup (mostly for documentation). 2017-07-28 10:38:57 +02:00
genkey.c agent: Use MAX_PASSPHRASE_LEN (255) also for the loopback. 2017-07-05 11:54:45 +02:00
gpg-agent-w32info.rc w32: Add icons and version information. 2013-05-07 21:35:48 +02:00
gpg-agent.c Simple typo fix. 2017-08-07 01:03:52 -04:00
keyformat.txt Clean up word replication. 2017-02-21 13:11:46 -05:00
learncard.c agent,g10: Remove redundant SERIALNO request. 2017-03-16 14:32:51 +09:00
Makefile.am tests: Make it possible to run all tests using our infrastructure. 2017-05-11 18:12:37 +02:00
pkdecrypt.c Spelling fixes in docs and comments. 2017-04-28 10:06:33 +09:00
pksign.c agent: Minor cleanup (mostly for documentation). 2017-07-28 10:38:57 +02:00
preset-passphrase.c Fix usage of ARGPARSE_OPTS. 2017-07-19 13:41:18 +09:00
protect-tool.c agent: Resolve conflict of util.h. 2017-03-07 19:22:48 +09:00
protect.c agent: compile-time configuration of s2k calibration. 2017-09-08 17:08:57 -04:00
t-protect.c Change all http://www.gnu.org in license notices to https:// 2016-11-05 12:02:19 +01:00
trans.c Change all http://www.gnu.org in license notices to https:// 2016-11-05 12:02:19 +01:00
trustlist.c Spelling fixes in docs and comments. 2017-04-28 10:06:33 +09:00
w32main.c agent: Resolve conflict of util.h. 2017-03-07 19:22:48 +09:00
w32main.h Change all http://www.gnu.org in license notices to https:// 2016-11-05 12:02:19 +01:00