agent: Clear bogus pinentry cache, when it causes an error.
authorNIIBE Yutaka <gniibe@fsij.org>
Mon, 28 Jan 2019 03:58:13 +0000 (12:58 +0900)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Fri, 1 Jul 2022 16:06:43 +0000 (17:06 +0100)
commit24b04654dc779df4db918f9d086d003133c9d99d
treeddeabb823eacb1b4f7a3c9b8e26cab7e50053de4
parentcbd15038b5796714e464dda251f93ce045e63cfa
agent: Clear bogus pinentry cache, when it causes an error.

* agent/agent.h (PINENTRY_STATUS_*): Expose to public.
(struct pin_entry_info_s): Add status.
* agent/call-pinentry.c (agent_askpin): Clearing the ->status
before the loop, let the assuan_transact set ->status.  When
failure with PINENTRY_STATUS_PASSWORD_FROM_CACHE, it returns
soon.
* agent/findkey.c (unprotect): Clear the pinentry cache,
when it causes an error.

--

Cherry-picked from master commit of:
      02a2633a7f0b7d91aa48ea615fb3a0edfd6ed6bb

Debian-bug-id: 919856
GnuPG-bug-id: 4348
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
(cherry picked from commit 9109bb9919f84d5472b7e62e84b961414a79d3c2)

Gbp-Pq: Topic from-2.2.13
Gbp-Pq: Name agent-Clear-bogus-pinentry-cache-when-it-causes-an-error.patch
agent/agent.h
agent/call-pinentry.c
agent/findkey.c