agent: Fix passphrase cache lookups.
authorJustus Winter <justus@g10code.com>
Mon, 18 Jul 2016 10:51:38 +0000 (12:51 +0200)
committerJustus Winter <justus@g10code.com>
Mon, 18 Jul 2016 10:51:38 +0000 (12:51 +0200)
commitf474249366e8e143c8e6eb7f7b1a74056e46fa1f
treec0c74ceda31546bcd8f2797ca8b77350fb8c1551
parent7f4dd24b880323a5b772719dafae829c288303a8
agent: Fix passphrase cache lookups.

CACHE_MODE_ANY is supposed to match any cache mode except
CACHE_MODE_IGNORE, but the code used '==' to compare cache modes.

* agent/cache.c (cache_mode_equal): New function.
(agent_set_cache): Use the new function to compare cache modes.
(agent_get_cache): Likewise.
* tests/openpgp/Makefile.am (TESTS): Add new test.
* tests/openpgp/issue2015.scm: New file.

GnuPG-bug-id: 2015
Signed-off-by: Justus Winter <justus@g10code.com>
agent/cache.c
tests/openpgp/Makefile.am
tests/openpgp/issue2015.scm [new file with mode: 0755]