mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
agent: New option --pinentry-invisible-char.
* agent/gpg-agent.c (oPinentryInvisibleChar): New. (opts): Add option. (parse_rereadable_options): Set option. * agent/agent.h (opt): Add field pinentry_invisible_char. * agent/call-pinentry.c (start_pinentry): Pass option to pinentry. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
9e65bbd255
commit
93d257c819
@ -86,10 +86,14 @@ struct
|
|||||||
|
|
||||||
int no_grab; /* Don't let the pinentry grab the keyboard */
|
int no_grab; /* Don't let the pinentry grab the keyboard */
|
||||||
|
|
||||||
/* The name of the file pinentry shall tocuh before exiting. If
|
/* The name of the file pinentry shall touch before exiting. If
|
||||||
this is not set the filoe name of the standard socket is used. */
|
this is not set the file name of the standard socket is used. */
|
||||||
const char *pinentry_touch_file;
|
const char *pinentry_touch_file;
|
||||||
|
|
||||||
|
/* A string where the first character is used by the pinentry as a
|
||||||
|
custom invisible character. */
|
||||||
|
char *pinentry_invisible_char;
|
||||||
|
|
||||||
/* The default and maximum TTL of cache entries. */
|
/* The default and maximum TTL of cache entries. */
|
||||||
unsigned long def_cache_ttl; /* Default. */
|
unsigned long def_cache_ttl; /* Default. */
|
||||||
unsigned long def_cache_ttl_ssh; /* for SSH. */
|
unsigned long def_cache_ttl_ssh; /* for SSH. */
|
||||||
|
@ -475,6 +475,21 @@ start_pinentry (ctrl_t ctrl)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Tell the pinentry that we would prefer that the given character
|
||||||
|
is used as the invisible character by the entry widget. */
|
||||||
|
if (opt.pinentry_invisible_char)
|
||||||
|
{
|
||||||
|
char *optstr;
|
||||||
|
if ((optstr = xtryasprintf ("OPTION invisible-char=%s",
|
||||||
|
opt.pinentry_invisible_char)))
|
||||||
|
{
|
||||||
|
assuan_transact (entry_ctx, optstr, NULL, NULL, NULL, NULL, NULL,
|
||||||
|
NULL);
|
||||||
|
/* We ignore errors because this is just a fancy thing and
|
||||||
|
older pinentries do not support this feature. */
|
||||||
|
xfree (optstr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Tell the pinentry the name of a file it shall touch after having
|
/* Tell the pinentry the name of a file it shall touch after having
|
||||||
messed with the tty. This is optional and only supported by
|
messed with the tty. This is optional and only supported by
|
||||||
|
@ -92,6 +92,7 @@ enum cmd_and_opt_values
|
|||||||
|
|
||||||
oPinentryProgram,
|
oPinentryProgram,
|
||||||
oPinentryTouchFile,
|
oPinentryTouchFile,
|
||||||
|
oPinentryInvisibleChar,
|
||||||
oDisplay,
|
oDisplay,
|
||||||
oTTYname,
|
oTTYname,
|
||||||
oTTYtype,
|
oTTYtype,
|
||||||
@ -166,6 +167,7 @@ static ARGPARSE_OPTS opts[] = {
|
|||||||
ARGPARSE_s_s (oPinentryProgram, "pinentry-program",
|
ARGPARSE_s_s (oPinentryProgram, "pinentry-program",
|
||||||
/* */ N_("|PGM|use PGM as the PIN-Entry program")),
|
/* */ N_("|PGM|use PGM as the PIN-Entry program")),
|
||||||
ARGPARSE_s_s (oPinentryTouchFile, "pinentry-touch-file", "@"),
|
ARGPARSE_s_s (oPinentryTouchFile, "pinentry-touch-file", "@"),
|
||||||
|
ARGPARSE_s_s (oPinentryInvisibleChar, "pinentry-invisible-char", "@"),
|
||||||
ARGPARSE_s_s (oScdaemonProgram, "scdaemon-program",
|
ARGPARSE_s_s (oScdaemonProgram, "scdaemon-program",
|
||||||
/* */ N_("|PGM|use PGM as the SCdaemon program") ),
|
/* */ N_("|PGM|use PGM as the SCdaemon program") ),
|
||||||
ARGPARSE_s_n (oDisableScdaemon, "disable-scdaemon",
|
ARGPARSE_s_n (oDisableScdaemon, "disable-scdaemon",
|
||||||
@ -576,6 +578,8 @@ parse_rereadable_options (ARGPARSE_ARGS *pargs, int reread)
|
|||||||
opt.debug_pinentry = 0;
|
opt.debug_pinentry = 0;
|
||||||
opt.pinentry_program = NULL;
|
opt.pinentry_program = NULL;
|
||||||
opt.pinentry_touch_file = NULL;
|
opt.pinentry_touch_file = NULL;
|
||||||
|
xfree (opt.pinentry_invisible_char);
|
||||||
|
opt.pinentry_invisible_char = NULL;
|
||||||
opt.scdaemon_program = NULL;
|
opt.scdaemon_program = NULL;
|
||||||
opt.def_cache_ttl = DEFAULT_CACHE_TTL;
|
opt.def_cache_ttl = DEFAULT_CACHE_TTL;
|
||||||
opt.def_cache_ttl_ssh = DEFAULT_CACHE_TTL_SSH;
|
opt.def_cache_ttl_ssh = DEFAULT_CACHE_TTL_SSH;
|
||||||
@ -624,6 +628,10 @@ parse_rereadable_options (ARGPARSE_ARGS *pargs, int reread)
|
|||||||
|
|
||||||
case oPinentryProgram: opt.pinentry_program = pargs->r.ret_str; break;
|
case oPinentryProgram: opt.pinentry_program = pargs->r.ret_str; break;
|
||||||
case oPinentryTouchFile: opt.pinentry_touch_file = pargs->r.ret_str; break;
|
case oPinentryTouchFile: opt.pinentry_touch_file = pargs->r.ret_str; break;
|
||||||
|
case oPinentryInvisibleChar:
|
||||||
|
xfree (opt.pinentry_invisible_char);
|
||||||
|
opt.pinentry_invisible_char = xtrystrdup (pargs->r.ret_str); break;
|
||||||
|
break;
|
||||||
case oScdaemonProgram: opt.scdaemon_program = pargs->r.ret_str; break;
|
case oScdaemonProgram: opt.scdaemon_program = pargs->r.ret_str; break;
|
||||||
case oDisableScdaemon: opt.disable_scdaemon = 1; break;
|
case oDisableScdaemon: opt.disable_scdaemon = 1; break;
|
||||||
case oDisableCheckOwnSocket: disable_check_own_socket = 1; break;
|
case oDisableCheckOwnSocket: disable_check_own_socket = 1; break;
|
||||||
|
@ -396,6 +396,12 @@ user may not bypass this check.
|
|||||||
@opindex enable-passphrase-history
|
@opindex enable-passphrase-history
|
||||||
This option does nothing yet.
|
This option does nothing yet.
|
||||||
|
|
||||||
|
@item --pinentry-invisible-char @var{char}
|
||||||
|
@opindex pinentry-invisible-char
|
||||||
|
This option asks the Pinentry to use @var{char} for displaying hidden
|
||||||
|
characters. @var{char} must be one character UTF-8 string. A
|
||||||
|
Pinentry may or may not honor this request.
|
||||||
|
|
||||||
@item --pinentry-program @var{filename}
|
@item --pinentry-program @var{filename}
|
||||||
@opindex pinentry-program
|
@opindex pinentry-program
|
||||||
Use program @var{filename} as the PIN entry. The default is
|
Use program @var{filename} as the PIN entry. The default is
|
||||||
@ -703,7 +709,10 @@ started with a configuration file, the configuration file is read
|
|||||||
again. Only certain options are honored: @code{quiet},
|
again. Only certain options are honored: @code{quiet},
|
||||||
@code{verbose}, @code{debug}, @code{debug-all}, @code{debug-level},
|
@code{verbose}, @code{debug}, @code{debug-all}, @code{debug-level},
|
||||||
@code{debug-pinentry},
|
@code{debug-pinentry},
|
||||||
@code{no-grab}, @code{pinentry-program}, @code{default-cache-ttl},
|
@code{no-grab},
|
||||||
|
@code{pinentry-program},
|
||||||
|
@code{pinentry-invisible-char},
|
||||||
|
@code{default-cache-ttl},
|
||||||
@code{max-cache-ttl}, @code{ignore-cache-for-signing},
|
@code{max-cache-ttl}, @code{ignore-cache-for-signing},
|
||||||
@code{no-allow-external-cache}, @code{allow-emacs-pinentry},
|
@code{no-allow-external-cache}, @code{allow-emacs-pinentry},
|
||||||
@code{no-allow-mark-trusted}, @code{disable-scdaemon}, and
|
@code{no-allow-mark-trusted}, @code{disable-scdaemon}, and
|
||||||
|
Loading…
x
Reference in New Issue
Block a user