diff options
author | Werner Koch <wk@gnupg.org> | 2023-11-14 15:08:20 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2023-11-14 15:09:27 +0100 |
commit | def8f5f3d28bd5b19fd68e9fbd2eeb1d04c08db1 (patch) | |
tree | 6f4d85c392511644f13f518504bad1ec09a23b2b /g10 | |
parent | gpgsm: Re-introduce the bad passphrase hint for pkcs#12. (diff) | |
download | gnupg2-def8f5f3d28bd5b19fd68e9fbd2eeb1d04c08db1.tar.xz gnupg2-def8f5f3d28bd5b19fd68e9fbd2eeb1d04c08db1.zip |
gpg,gpgsm: Hide password in debug output also for asked passwords.
* g10/call-agent.c (agent_get_passphrase): Call
assuan_begin_confidential and assuan_end_confidential.
* sm/call-agent.c (gpgsm_agent_ask_passphrase): Ditto.
--
GnuPG-bug-id: 6654
The drawback of this solution is that we don't see any IPC lines from
the assuan_transact. Everything else would require larger changes to
libassuan.
Diffstat (limited to 'g10')
-rw-r--r-- | g10/call-agent.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/g10/call-agent.c b/g10/call-agent.c index 4defa7990..c90cdfda5 100644 --- a/g10/call-agent.c +++ b/g10/call-agent.c @@ -1995,7 +1995,7 @@ agent_get_passphrase (const char *cache_id, char *arg4 = NULL; membuf_t data; struct default_inq_parm_s dfltparm; - int have_newsymkey; + int have_newsymkey, wasconf; memset (&dfltparm, 0, sizeof dfltparm); @@ -2047,10 +2047,14 @@ agent_get_passphrase (const char *cache_id, xfree (arg4); init_membuf_secure (&data, 64); + wasconf = assuan_get_flag (agent_ctx, ASSUAN_CONFIDENTIAL); + assuan_begin_confidential (agent_ctx); rc = assuan_transact (agent_ctx, line, put_membuf_cb, &data, default_inq_cb, &dfltparm, NULL, NULL); + if (!wasconf) + assuan_end_confidential (agent_ctx); if (rc) xfree (get_membuf (&data, NULL)); |