[openssl-commits] [openssl] OpenSSL_1_1_0-stable update

Richard Levitte levitte at openssl.org
Sun Dec 10 10:25:21 UTC 2017


The branch OpenSSL_1_1_0-stable has been updated
       via  b2621ffdf8063c961ee5c3a7dd9db68d623d3554 (commit)
      from  b6f28b1243fdcddc872cb170ea87ab2138b5c388 (commit)


- Log -----------------------------------------------------------------
commit b2621ffdf8063c961ee5c3a7dd9db68d623d3554
Author: FdaSilvaYY <fdasilvayy at gmail.com>
Date:   Sat Dec 9 15:49:13 2017 +0100

    Useless conf != NULL test
    
    check is already made 10 line above.
    clean commented code
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/4885)
    
    (cherry picked from commit df364297495e1d7409f1fcb0f4432c8671019cd8)

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

Summary of changes:
 apps/ca.c | 35 ++++++++++++++---------------------
 1 file changed, 14 insertions(+), 21 deletions(-)

diff --git a/apps/ca.c b/apps/ca.c
index 3b2afd6..2648549 100644
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -440,30 +440,23 @@ end_of_options:
         && (section = lookup_conf(conf, BASE_SECTION, ENV_DEFAULT_CA)) == NULL)
         goto end;
 
-    if (conf != NULL) {
-        p = NCONF_get_string(conf, NULL, "oid_file");
-        if (p == NULL)
-            ERR_clear_error();
-        if (p != NULL) {
-            BIO *oid_bio;
+    p = NCONF_get_string(conf, NULL, "oid_file");
+    if (p == NULL)
+        ERR_clear_error();
+    if (p != NULL) {
+        BIO *oid_bio = BIO_new_file(p, "r");
 
-            oid_bio = BIO_new_file(p, "r");
-            if (oid_bio == NULL) {
-                /*-
-                BIO_printf(bio_err,"problems opening %s for extra oid's\n",p);
-                ERR_print_errors(bio_err);
-                */
-                ERR_clear_error();
-            } else {
-                OBJ_create_objects(oid_bio);
-                BIO_free(oid_bio);
-            }
-        }
-        if (!add_oid_section(conf)) {
-            ERR_print_errors(bio_err);
-            goto end;
+        if (oid_bio == NULL) {
+            ERR_clear_error();
+        } else {
+            OBJ_create_objects(oid_bio);
+            BIO_free(oid_bio);
         }
     }
+    if (!add_oid_section(conf)) {
+        ERR_print_errors(bio_err);
+        goto end;
+    }
 
     randfile = NCONF_get_string(conf, BASE_SECTION, "RANDFILE");
     if (randfile == NULL)


More information about the openssl-commits mailing list