Use default field separator.
authorDr. Stephen Henson <steve@openssl.org>
Fri, 11 Sep 2015 15:13:52 +0000 (16:13 +0100)
committerDr. Stephen Henson <steve@openssl.org>
Fri, 11 Sep 2015 19:50:48 +0000 (20:50 +0100)
If the field separator isn't specified through -nameopt then use
XN_FLAG_SEP_CPLUS_SPC instead of printing nothing and returing an error.

PR#2397

Reviewed-by: Tim Hudson <tjh@openssl.org>
apps/apps.c
doc/apps/x509.pod

index 5c36a374f5031b96e293768a240fbf53fd6e10ef..5b6a605dfdff221f52519e3b6b51c47fc2499195 100644 (file)
@@ -1074,7 +1074,11 @@ int set_name_ex(unsigned long *flags, const char *arg)
         {"ca_default", XN_FLAG_MULTILINE, 0xffffffffL},
         {NULL, 0, 0}
     };
         {"ca_default", XN_FLAG_MULTILINE, 0xffffffffL},
         {NULL, 0, 0}
     };
-    return set_multi_opts(flags, arg, ex_tbl);
+    if (set_multi_opts(flags, arg, ex_tbl) == 0)
+        return 0;
+    if ((*flags & XN_FLAG_SEP_MASK) == 0)
+        *flags |= XN_FLAG_SEP_CPLUS_SPC;
+    return 1;
 }
 
 int set_ext_copy(int *copy_type, const char *arg)
 }
 
 int set_ext_copy(int *copy_type, const char *arg)
index a06393defbadf4fb21bad067bb879990ed0e4a66..d4790605b48172617dfd3d010da3c8fbaa129475 100644 (file)
@@ -542,7 +542,8 @@ very rare and their use is discouraged). The options ending in
 "space" additionally place a space after the separator to make it
 more readable. The B<sep_multiline> uses a linefeed character for
 the RDN separator and a spaced B<+> for the AVA separator. It also
 "space" additionally place a space after the separator to make it
 more readable. The B<sep_multiline> uses a linefeed character for
 the RDN separator and a spaced B<+> for the AVA separator. It also
-indents the fields by four characters.
+indents the fields by four characters. If no field separator is specified
+then B<sep_comma_plus_space> is used by default.
 
 =item B<dn_rev>
 
 
 =item B<dn_rev>