[Second try. The attachment was left out by mistake.]

When using "-nameopt" with the x509/req/ca commands, OpenSSL will
currently "abort" the output if no sep_xxx option is provided. Examining
the certificate from https://rt.openssl.org with "openssl 509 -noout
-text -nameopt utf8" e.g. gives

Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            01:00:00:00:00:01:1c:57:8e:3a:eb
        Signature Algorithm: sha1WithRSAEncryption
        Issuer:

I propose the attached patch, which adds "sep_comma_plus_space" if no
other sep_xxx option is provided through the nameopt switch.

Index: crypto/asn1/a_strex.c
===================================================================
RCS file: /openssl/crypto/asn1/a_strex.c,v
retrieving revision 1.18
diff -p -u -r1.18 a_strex.c
--- crypto/asn1/a_strex.c       5 Nov 2008 18:38:52 -0000       1.18
+++ crypto/asn1/a_strex.c       17 Mar 2010 07:52:19 -0000
@@ -398,6 +398,7 @@ static int do_name_ex(char_io *io_ch, vo
        if(indent < 0) indent = 0;
        outlen = indent;
        if(!do_indent(io_ch, arg, indent)) return -1;
+       if(!(flags & XN_FLAG_SEP_MASK)) flags |= XN_FLAG_SEP_CPLUS_SPC;
        switch (flags & XN_FLAG_SEP_MASK)
        {
                case XN_FLAG_SEP_MULTILINE:

Reply via email to