From 9f75889f9cd3c009bce7699cc0b4c2d53aad1131 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sun, 29 May 2016 20:16:39 +0300 Subject: Remove redundant comma escaping in certificate authentication prompt --- bpkg/auth.cxx | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'bpkg/auth.cxx') diff --git a/bpkg/auth.cxx b/bpkg/auth.cxx index 591c6a5..c2a84dc 100644 --- a/bpkg/auth.cxx +++ b/bpkg/auth.cxx @@ -233,7 +233,36 @@ namespace bpkg "-subject", "-dates", "-email", - "-nameopt", "RFC2253,sep_multiline" + + // Previously we have used "RFC2253,sep_multiline" format to display + // the requested fields, but that resulted in some undesirable + // behavior like escaping commas (\,) while dispaying only one field + // per line. The reason for that is RFC2253 specifier which get + // expanded into: + // + // esc_2253,esc_ctrl,esc_msb,utf8,dump_nostr,dump_unknown,dump_der, + // sep_comma_plus,dn_rev,sname. + // + // Now we filtered them and leave just those specifiers that we + // really need: + // + // utf8 - use UTF8 encoding for strings; + // + // esc_ctrl - display control characters in \XX notation (we + // don't expect them in properly created + // certificates, but it's better to print this way if + // they appear); + // + // sname - use short form for field names (like + // "O=Code Synthesis" vs + // "organizationName=Code Synthesis"); + // + // dump_nostr - do not print any binary data in the binary form; + // dump_der + // + // sep_multiline - display field per line. + // + "-nameopt", "utf8,esc_ctrl,dump_nostr,dump_der,sname,sep_multiline" }, true, true)); -- cgit v1.1