mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
gpgsm: New option --no-pretty-dn
* sm/gpgsm.c (oNoPrettyDN): New. (opts): Add --no-pretty-dn. (main): Implement. * sm/gpgsm.h (opt): Add no_pretty_dn. * sm/certdump.c (gpgsm_es_print_name): Act upon.
This commit is contained in:
parent
e5066f2d1c
commit
e4ac3e7dec
@ -629,6 +629,15 @@ always listed in @option{--with-colons} mode.
|
|||||||
Include info about the presence of a secret key in public key listings
|
Include info about the presence of a secret key in public key listings
|
||||||
done with @code{--with-colons}.
|
done with @code{--with-colons}.
|
||||||
|
|
||||||
|
@item --no-pretty-dn
|
||||||
|
@opindex no-pretty-dn
|
||||||
|
By default gpgsm prints distinguished names (DNs) like the Issuer or
|
||||||
|
Subject in a more readable format (e.g. using a well defined order of
|
||||||
|
the parts). However, this format can't be used as input strings.
|
||||||
|
This option reverts printing to standard RFC-2253 format and thus
|
||||||
|
avoids the need to use --dump-cert or --with-colons to get the
|
||||||
|
``real'' name.
|
||||||
|
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@c *******************************************
|
@c *******************************************
|
||||||
|
@ -728,7 +728,14 @@ gpgsm_es_print_name2 (estream_t fp, const char *name, int translate)
|
|||||||
void
|
void
|
||||||
gpgsm_es_print_name (estream_t fp, const char *name)
|
gpgsm_es_print_name (estream_t fp, const char *name)
|
||||||
{
|
{
|
||||||
gpgsm_es_print_name2 (fp, name, 1);
|
if (opt.no_pretty_dn)
|
||||||
|
{
|
||||||
|
if (!name)
|
||||||
|
name = "[error]";
|
||||||
|
es_write_sanitized (fp, name, strlen (name), NULL, NULL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
gpgsm_es_print_name2 (fp, name, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -170,6 +170,7 @@ enum cmd_and_opt_values {
|
|||||||
oWithKeyScreening,
|
oWithKeyScreening,
|
||||||
oAnswerYes,
|
oAnswerYes,
|
||||||
oAnswerNo,
|
oAnswerNo,
|
||||||
|
oNoPrettyDN,
|
||||||
oKeyring,
|
oKeyring,
|
||||||
oDefaultKey,
|
oDefaultKey,
|
||||||
oDefRecipient,
|
oDefRecipient,
|
||||||
@ -385,7 +386,7 @@ static gpgrt_opt_t opts[] = {
|
|||||||
ARGPARSE_s_n (oWithKeygrip, "with-keygrip", "@"),
|
ARGPARSE_s_n (oWithKeygrip, "with-keygrip", "@"),
|
||||||
ARGPARSE_s_n (oWithSecret, "with-secret", "@"),
|
ARGPARSE_s_n (oWithSecret, "with-secret", "@"),
|
||||||
ARGPARSE_s_n (oWithKeyScreening,"with-key-screening", "@"),
|
ARGPARSE_s_n (oWithKeyScreening,"with-key-screening", "@"),
|
||||||
|
ARGPARSE_s_n (oNoPrettyDN, "no-pretty-dn", "@"),
|
||||||
|
|
||||||
|
|
||||||
ARGPARSE_header ("Security", N_("Options controlling the security")),
|
ARGPARSE_header ("Security", N_("Options controlling the security")),
|
||||||
@ -1318,6 +1319,10 @@ main ( int argc, char **argv)
|
|||||||
opt.with_key_screening = 1;
|
opt.with_key_screening = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case oNoPrettyDN:
|
||||||
|
opt.no_pretty_dn = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
case oHomedir: gnupg_set_homedir (pargs.r.ret_str); break;
|
case oHomedir: gnupg_set_homedir (pargs.r.ret_str); break;
|
||||||
case oChUid: break; /* Command line only (see above). */
|
case oChUid: break; /* Command line only (see above). */
|
||||||
case oAgentProgram: opt.agent_program = pargs.r.ret_str; break;
|
case oAgentProgram: opt.agent_program = pargs.r.ret_str; break;
|
||||||
|
@ -85,6 +85,8 @@ struct
|
|||||||
|
|
||||||
int with_key_screening; /* Option --with-key-screening active. */
|
int with_key_screening; /* Option --with-key-screening active. */
|
||||||
|
|
||||||
|
int no_pretty_dn; /* Option --no-pretty-dn */
|
||||||
|
|
||||||
int pinentry_mode;
|
int pinentry_mode;
|
||||||
int request_origin;
|
int request_origin;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user