summaryrefslogtreecommitdiffstats
path: root/agent/call-pinentry.c
diff options
context:
space:
mode:
authorBen Kibbey <bjk@luxsci.net>2023-03-06 02:14:07 +0100
committerBen Kibbey <bjk@luxsci.net>2023-03-10 05:12:07 +0100
commitbe77a7ab8a8bdbde6f40a233a1a60f7924a21d4a (patch)
treeaa21fd4040bf39a08d2ea7c6ef42682ebc307bd4 /agent/call-pinentry.c
parentdirmngr: Distinguish between "no crl" and "crl not trusted". (diff)
downloadgnupg2-be77a7ab8a8bdbde6f40a233a1a60f7924a21d4a.tar.xz
gnupg2-be77a7ab8a8bdbde6f40a233a1a60f7924a21d4a.zip
agent: Try to SETREPEATOK if the pinentry supports it.
* agent/call-pinentry.c (agent_get_passphrase): Do SETREPEATOK. (agent_askpin): Ditto. Signed-off-by: Ben Kibbey <bjk@luxsci.net>
Diffstat (limited to '')
-rw-r--r--agent/call-pinentry.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/agent/call-pinentry.c b/agent/call-pinentry.c
index c6c52be74..656d5f623 100644
--- a/agent/call-pinentry.c
+++ b/agent/call-pinentry.c
@@ -1543,6 +1543,17 @@ agent_askpin (ctrl_t ctrl,
NULL, NULL, NULL, NULL, NULL, NULL);
if (rc)
pininfo->with_repeat = 0; /* Pinentry does not support it. */
+
+ if (pininfo->with_repeat)
+ {
+ snprintf (line, DIM(line), "SETREPEATOK %s",
+ L_("Passphrases match."));
+ rc = assuan_transact (entry_ctx, line,
+ NULL, NULL, NULL, NULL, NULL, NULL);
+ if (rc)
+ rc = 0; /* Pinentry does not support it. */
+ }
+
}
pininfo->repeat_okay = 0;
pininfo->status = 0;
@@ -1802,6 +1813,16 @@ agent_get_passphrase (ctrl_t ctrl,
if (rc)
pininfo->with_repeat = 0; /* Pinentry does not support it. */
+ if (pininfo->with_repeat)
+ {
+ snprintf (line, DIM(line), "SETREPEATOK %s",
+ L_("Passphrases match."));
+ rc = assuan_transact (entry_ctx, line,
+ NULL, NULL, NULL, NULL, NULL, NULL);
+ if (rc)
+ rc = 0; /* Pinentry does not support it. */
+ }
+
(void)setup_genpin (ctrl);
rc = setup_enforced_constraints (ctrl);