agent: Make the request origin a part of the cache items.
authorWerner Koch <wk@gnupg.org>
Tue, 27 Mar 2018 06:40:58 +0000 (08:40 +0200)
committerWerner Koch <wk@gnupg.org>
Tue, 27 Mar 2018 06:40:58 +0000 (08:40 +0200)
commit02dce8c0cc57deb2095a9b06aeb8f4dea34eef7e
tree87bd5eb853bc750761788900a67b602817ebcbfd
parenteb68c2d3d1b03a18cd24406fa46d4c30cb13d9f7
agent: Make the request origin a part of the cache items.

* agent/cache.c (agent_put_cache): Add arg 'ctrl' and change all
callers to pass it.
(agent_get_cache): Ditto.

* agent/cache.c (struct cache_items_s): Add field 'restricted'.
(housekeeping): Adjust debug output.
(agent_flush_cache): Ditto.
(agent_put_cache): Ditto.  Take RESTRICTED into account.
(agent_get_cache): Ditto.
--

If requests are coming from different sources they should not share the
same cache.  This way we make sure that a Pinentry pops up for a
remote request to a key we have already used locally.

GnuPG-bug-id: 3858
Signed-off-by: Werner Koch <wk@gnupg.org>
agent/agent.h
agent/cache.c
agent/command-ssh.c
agent/command.c
agent/cvt-openpgp.c
agent/findkey.c
agent/genkey.c
agent/protect-tool.c