mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
gpg,sm: Set confidential in assuan communication for password.
* g10/call-agent.c (default_inq_cb): Call assuan_begin_confidential and assuan_end_confidential. * sm/call-agent.c (default_inq_cb): Likewise. -- GnuPG-bug-id: 6654 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
64f5f7b74e
commit
ec1446f944
@ -161,6 +161,7 @@ default_inq_cb (void *opaque, const char *line)
|
|||||||
|| has_leading_keyword (line, "NEW_PASSPHRASE"))
|
|| has_leading_keyword (line, "NEW_PASSPHRASE"))
|
||||||
&& opt.pinentry_mode == PINENTRY_MODE_LOOPBACK)
|
&& opt.pinentry_mode == PINENTRY_MODE_LOOPBACK)
|
||||||
{
|
{
|
||||||
|
assuan_begin_confidential (parm->ctx);
|
||||||
if (have_static_passphrase ())
|
if (have_static_passphrase ())
|
||||||
{
|
{
|
||||||
s = get_static_passphrase ();
|
s = get_static_passphrase ();
|
||||||
@ -187,6 +188,7 @@ default_inq_cb (void *opaque, const char *line)
|
|||||||
err = assuan_send_data (parm->ctx, pw, strlen (pw));
|
err = assuan_send_data (parm->ctx, pw, strlen (pw));
|
||||||
xfree (pw);
|
xfree (pw);
|
||||||
}
|
}
|
||||||
|
assuan_end_confidential (parm->ctx);
|
||||||
}
|
}
|
||||||
else if ((s = has_leading_keyword (line, "CONFIRM"))
|
else if ((s = has_leading_keyword (line, "CONFIRM"))
|
||||||
&& opt.pinentry_mode == PINENTRY_MODE_LOOPBACK
|
&& opt.pinentry_mode == PINENTRY_MODE_LOOPBACK
|
||||||
|
@ -222,7 +222,9 @@ default_inq_cb (void *opaque, const char *line)
|
|||||||
&& have_static_passphrase ())
|
&& have_static_passphrase ())
|
||||||
{
|
{
|
||||||
const char *s = get_static_passphrase ();
|
const char *s = get_static_passphrase ();
|
||||||
|
assuan_begin_confidential (parm->ctx);
|
||||||
err = assuan_send_data (parm->ctx, s, strlen (s));
|
err = assuan_send_data (parm->ctx, s, strlen (s));
|
||||||
|
assuan_end_confidential (parm->ctx);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
log_error ("ignoring gpg-agent inquiry '%s'\n", line);
|
log_error ("ignoring gpg-agent inquiry '%s'\n", line);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user