[openssl-commits] [openssl] master update

Richard Levitte levitte at openssl.org
Tue Jul 7 14:41:02 UTC 2015


The branch master has been updated
       via  9cf315ef90d0cfeb8bb7a38873eea07a8f0dffec (commit)
       via  f1cece554ddf282f1512b4da04664467746ffd24 (commit)
      from  5727582cf51e98e5e0faa435e7da2c8929533c0d (commit)


- Log -----------------------------------------------------------------
commit 9cf315ef90d0cfeb8bb7a38873eea07a8f0dffec
Author: Richard Levitte <levitte at openssl.org>
Date:   Tue Jul 7 14:50:10 2015 +0200

    Document the nameopt change
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

commit f1cece554ddf282f1512b4da04664467746ffd24
Author: Richard Levitte <levitte at openssl.org>
Date:   Tue Jul 7 11:13:20 2015 +0200

    Make "oneline" the default for nameopt
    
    There's no reason why we should default to a output format that is
    old, and confusing in some cases.
    
    This affects the commands "ca", "crl", "req" and "x509".
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

-----------------------------------------------------------------------

Summary of changes:
 CHANGES           | 4 ++++
 apps/ca.c         | 6 ++++--
 apps/crl.c        | 5 +++++
 apps/req.c        | 8 +++++++-
 apps/x509.c       | 5 +++++
 doc/apps/x509.pod | 4 ++--
 6 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/CHANGES b/CHANGES
index 88b3d67..057909e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,10 @@
  _______________
 
  Changes between 1.0.2 and 1.1.0  [xx XXX xxxx]
+  *) Changed the default name options in the "ca", "crl", "req" and "x509"
+     to be "oneline" instead of "compat".
+     [Richard Levitte]
+
   *) Remove SSL_OP_TLS_BLOCK_PADDING_BUG. This is SSLeay legacy, we're
      not aware of clients that still exhibit this bug, and the workaround
      hasn't been working properly for a while.
diff --git a/apps/ca.c b/apps/ca.c
index a0f9f79..0a8d7b7 100644
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -325,7 +325,7 @@ opthelp:
                 ret = 0;
                 goto end;
             case OPT_IN:
-		req = 1;
+                req = 1;
                 infile = opt_arg();
                 break;
             case OPT_OUT:
@@ -638,8 +638,10 @@ end_of_options:
             goto end;
         }
         default_op = 0;
-    } else
+    } else {
+        nameopt = XN_FLAG_ONELINE;
         ERR_clear_error();
+    }
 
     f = NCONF_get_string(conf, section, ENV_CERTOPT);
 
diff --git a/apps/crl.c b/apps/crl.c
index c897335..b4c9c75 100644
--- a/apps/crl.c
+++ b/apps/crl.c
@@ -114,6 +114,7 @@ int crl_main(int argc, char **argv)
     EVP_PKEY *pkey;
     const EVP_MD *digest = EVP_sha1();
     unsigned long nmflag = 0;
+    char nmflag_set = 0;
     char *infile = NULL, *outfile = NULL, *crldiff = NULL, *keyfile = NULL;
     char *CAfile = NULL, *CApath = NULL, *prog;
     OPTION_CHOICE o;
@@ -206,6 +207,7 @@ int crl_main(int argc, char **argv)
             badsig = 1;
             break;
         case OPT_NAMEOPT:
+            nmflag_set = 1;
             if (!set_name_ex(&nmflag, opt_arg()))
                 goto opthelp;
             break;
@@ -217,6 +219,9 @@ int crl_main(int argc, char **argv)
     argc = opt_num_rest();
     argv = opt_rest();
 
+    if (!nmflag_set)
+        nmflag = XN_FLAG_ONELINE;
+
     if (!app_load_modules(NULL))
         goto end;
 
diff --git a/apps/req.c b/apps/req.c
index 03736cc..b3220ba 100644
--- a/apps/req.c
+++ b/apps/req.c
@@ -211,6 +211,7 @@ int req_main(int argc, char **argv)
     int nodes = 0, kludge = 0, newhdr = 0, subject = 0, pubkey = 0;
     long newkey = -1;
     unsigned long chtype = MBSTRING_ASC, nmflag = 0, reqflag = 0;
+    char nmflag_set = 0;
 
 #ifndef OPENSSL_NO_DES
     cipher = EVP_des_ede3_cbc();
@@ -323,6 +324,7 @@ int req_main(int argc, char **argv)
             chtype = MBSTRING_UTF8;
             break;
         case OPT_NAMEOPT:
+            nmflag_set = 1;
             if (!set_name_ex(&nmflag, opt_arg()))
                 goto opthelp;
             break;
@@ -352,7 +354,7 @@ int req_main(int argc, char **argv)
                 goto opthelp;
             break;
         case OPT_SUBJECT:
-	    subject = 1;
+            subject = 1;
             break;
         case OPT_SUBJ:
             subj = opt_arg();
@@ -375,6 +377,10 @@ int req_main(int argc, char **argv)
     }
     argc = opt_num_rest();
     argv = opt_rest();
+
+    if (!nmflag_set)
+        nmflag = XN_FLAG_ONELINE;
+
     private = newreq && (pkey == NULL) ? 1 : 0;
 
     if (!app_passwd(passargin, passargout, &passin, &passout)) {
diff --git a/apps/x509.c b/apps/x509.c
index 8293a6e..18e13e7 100644
--- a/apps/x509.c
+++ b/apps/x509.c
@@ -227,6 +227,7 @@ int x509_main(int argc, char **argv)
     int text = 0, serial = 0, subject = 0, issuer = 0, startdate = 0;
     int checkoffset = 0, enddate = 0;
     unsigned long nmflag = 0, certflag = 0;
+    char nmflag_set = 0;
     OPTION_CHOICE o;
     ENGINE *e = NULL;
 #ifndef OPENSSL_NO_MD5
@@ -360,6 +361,7 @@ int x509_main(int argc, char **argv)
                 goto opthelp;
             break;
         case OPT_NAMEOPT:
+            nmflag_set = 1;
             if (!set_name_ex(&nmflag, opt_arg()))
                 goto opthelp;
             break;
@@ -488,6 +490,9 @@ int x509_main(int argc, char **argv)
         goto opthelp;
     }
 
+    if (!nmflag_set)
+        nmflag = XN_FLAG_ONELINE;
+
     if (!app_load_modules(NULL))
         goto end;
 
diff --git a/doc/apps/x509.pod b/doc/apps/x509.pod
index 062a919..a0127fe 100644
--- a/doc/apps/x509.pod
+++ b/doc/apps/x509.pod
@@ -442,7 +442,7 @@ a B<-> to turn the option off. Only the first four will normally be used.
 
 =item B<compat>
 
-use the old format. This is equivalent to specifying no name options at all.
+use the old format.
 
 =item B<RFC2253>
 
@@ -455,7 +455,7 @@ B<sep_comma_plus>, B<dn_rev> and B<sname>.
 a oneline format which is more readable than RFC2253. It is equivalent to
 specifying the  B<esc_2253>, B<esc_ctrl>, B<esc_msb>, B<utf8>, B<dump_nostr>,
 B<dump_der>, B<use_quote>, B<sep_comma_plus_space>, B<space_eq> and B<sname>
-options.
+options.  This is the I<default> of no name options are given explicitely.
 
 =item B<multiline>
 


More information about the openssl-commits mailing list