summaryrefslogtreecommitdiffstats
path: root/sm/certdump.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2023-03-16 09:46:05 +0100
committerWerner Koch <wk@gnupg.org>2023-03-16 09:46:05 +0100
commite4ac3e7dec92acce32398f571959c7a33534f0c4 (patch)
treeefe905888d31623d76bae0e90da79978794cf94e /sm/certdump.c
parentgpgtar: Do not allow the use of stdout for --status-fd (diff)
downloadgnupg2-e4ac3e7dec92acce32398f571959c7a33534f0c4.tar.xz
gnupg2-e4ac3e7dec92acce32398f571959c7a33534f0c4.zip
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.
Diffstat (limited to 'sm/certdump.c')
-rw-r--r--sm/certdump.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sm/certdump.c b/sm/certdump.c
index 3ad0edbe3..03bfd4106 100644
--- a/sm/certdump.c
+++ b/sm/certdump.c
@@ -728,7 +728,14 @@ gpgsm_es_print_name2 (estream_t fp, const char *name, int translate)
void
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);
}