summaryrefslogtreecommitdiffstats
path: root/agent/agent.h
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2019-01-28 04:58:13 +0100
committerNIIBE Yutaka <gniibe@fsij.org>2019-01-28 04:58:13 +0100
commit02a2633a7f0b7d91aa48ea615fb3a0edfd6ed6bb (patch)
tree189869c915432fd364de4a2a957061be9255a188 /agent/agent.h
parentcard: Implement the bulk of OpenPGP stuff into gpg-card-tool. (diff)
downloadgnupg2-02a2633a7f0b7d91aa48ea615fb3a0edfd6ed6bb.tar.xz
gnupg2-02a2633a7f0b7d91aa48ea615fb3a0edfd6ed6bb.zip
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. -- GnuPG-bug-id: 4348 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'agent/agent.h')
-rw-r--r--agent/agent.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/agent/agent.h b/agent/agent.h
index 05080f1f2..ee5a31eef 100644
--- a/agent/agent.h
+++ b/agent/agent.h
@@ -266,6 +266,14 @@ struct server_control_s
};
+/* Status of pinentry. */
+enum
+ {
+ PINENTRY_STATUS_CLOSE_BUTTON = 1 << 0,
+ PINENTRY_STATUS_PIN_REPEATED = 1 << 8,
+ PINENTRY_STATUS_PASSWORD_FROM_CACHE = 1 << 9
+ };
+
/* Information pertaining to pinentry requests. */
struct pin_entry_info_s
{
@@ -275,7 +283,8 @@ struct pin_entry_info_s
int failed_tries; /* Number of tries so far failed. */
int with_qualitybar; /* Set if the quality bar should be displayed. */
int with_repeat; /* Request repetition of the passphrase. */
- int repeat_okay; /* Repetition worked. */
+ int repeat_okay; /* Repetition worked. */
+ unsigned int status; /* Status. */
gpg_error_t (*check_cb)(struct pin_entry_info_s *); /* CB used to check
the PIN */
void *check_cb_arg; /* optional argument which might be of use in the CB */