[openssl-commits] [openssl] master update

Matt Caswell matt at openssl.org
Thu Apr 21 09:54:01 UTC 2016


The branch master has been updated
       via  5d94e5b65adc7d773068b8eb4b5525d35930f1ae (commit)
       via  3ad4af89cf7380aa94d1995e05e713d59e1c469a (commit)
       via  dfefe7ec1e21078be4ad456c3f465cc174071d7c (commit)
       via  bcc31778e3695e23d7c4cd6274126a8e3d58db72 (commit)
       via  e69f2a223cf7e2d7f5bcea43e68ce38818813b81 (commit)
       via  46da5f9ca98822197f09b74248f1b9cc60ad3307 (commit)
       via  56e253477da0d75b556b94995c52e124799398e6 (commit)
       via  d278284e74cb0864a1cb33256ecac0c1c4f0a55b (commit)
      from  a043d0b91d62fd8526a3fd791e3ad2ebcf888cd9 (commit)


- Log -----------------------------------------------------------------
commit 5d94e5b65adc7d773068b8eb4b5525d35930f1ae
Author: Matt Caswell <matt at openssl.org>
Date:   Thu Apr 21 10:01:19 2016 +0100

    Remove some unneccessary assignments to argc
    
    openssl.c and ts.c assign the value of opt_num_rest() to argc, but then
    only use the value once.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>

commit 3ad4af89cf7380aa94d1995e05e713d59e1c469a
Author: Matt Caswell <matt at openssl.org>
Date:   Sat Apr 16 12:18:19 2016 +0100

    Remove some unused argc assignments
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>

commit dfefe7ec1e21078be4ad456c3f465cc174071d7c
Author: Matt Caswell <matt at openssl.org>
Date:   Fri Apr 15 14:45:12 2016 +0100

    Fix a missing return value check in v3_addr
    
    All other instances of extract_min_max are checked for an error return,
    except this one.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>

commit bcc31778e3695e23d7c4cd6274126a8e3d58db72
Author: Matt Caswell <matt at openssl.org>
Date:   Fri Apr 15 14:42:48 2016 +0100

    Add missing return value check in pkcs8 app
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>

commit e69f2a223cf7e2d7f5bcea43e68ce38818813b81
Author: Matt Caswell <matt at openssl.org>
Date:   Fri Apr 15 14:31:03 2016 +0100

    Add missing return value checks
    
    Also correct the return value from the the "prime" application
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>

commit 46da5f9ca98822197f09b74248f1b9cc60ad3307
Author: Matt Caswell <matt at openssl.org>
Date:   Fri Apr 15 14:11:09 2016 +0100

    Fix missing break in option parsing
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>

commit 56e253477da0d75b556b94995c52e124799398e6
Author: Matt Caswell <matt at openssl.org>
Date:   Fri Apr 15 14:01:41 2016 +0100

    Remove some dead code
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>

commit d278284e74cb0864a1cb33256ecac0c1c4f0a55b
Author: Matt Caswell <matt at openssl.org>
Date:   Fri Apr 15 13:56:44 2016 +0100

    Fix some code maintenance issues
    
    Various instances of variables being written to, but then never read.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>

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

Summary of changes:
 apps/enc.c              |  2 --
 apps/errstr.c           |  2 --
 apps/openssl.c          |  4 +---
 apps/pkcs8.c            |  5 ++++-
 apps/prime.c            | 17 ++++++++++++++---
 apps/s_cb.c             |  4 ----
 apps/s_client.c         |  1 +
 apps/ts.c               |  4 +---
 apps/x509.c             |  2 +-
 crypto/asn1/asn_mime.c  |  2 +-
 crypto/x509v3/v3_addr.c |  3 ++-
 11 files changed, 25 insertions(+), 21 deletions(-)

diff --git a/apps/enc.c b/apps/enc.c
index 9e7d069..0286191 100644
--- a/apps/enc.c
+++ b/apps/enc.c
@@ -291,8 +291,6 @@ int enc_main(int argc, char **argv)
             break;
         }
     }
-    argc = opt_num_rest();
-    argv = opt_rest();
 
     if (cipher && EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER) {
         BIO_printf(bio_err, "%s: AEAD ciphers not supported\n", prog);
diff --git a/apps/errstr.c b/apps/errstr.c
index 141338a..81028ef 100644
--- a/apps/errstr.c
+++ b/apps/errstr.c
@@ -106,8 +106,6 @@ int errstr_main(int argc, char **argv)
             goto end;
         }
     }
-    argc = opt_num_rest();
-    argv = opt_rest();
 
     ret = 0;
     for (argv = opt_rest(); *argv; argv++) {
diff --git a/apps/openssl.c b/apps/openssl.c
index c8912ee..f2fb295 100644
--- a/apps/openssl.c
+++ b/apps/openssl.c
@@ -491,10 +491,8 @@ int help_main(int argc, char **argv)
             return 0;
         }
     }
-    argc = opt_num_rest();
-    argv = opt_rest();
 
-    if (argc != 0) {
+    if (opt_num_rest() != 0) {
         BIO_printf(bio_err, "Usage: %s\n", prog);
         return 1;
     }
diff --git a/apps/pkcs8.c b/apps/pkcs8.c
index 15b8e6a..cd4e76b 100644
--- a/apps/pkcs8.c
+++ b/apps/pkcs8.c
@@ -341,7 +341,10 @@ int pkcs8_main(int argc, char **argv)
         else if (1) {
 #ifndef OPENSSL_NO_UI
             p8pass = pass;
-            EVP_read_pw_string(pass, sizeof pass, "Enter Password:", 0);
+            if (EVP_read_pw_string(pass, sizeof pass, "Enter Password:", 0)) {
+                BIO_printf(bio_err, "Can't read Password\n");
+                goto end;
+            }
         } else {
 #endif
             BIO_printf(bio_err, "Password required\n");
diff --git a/apps/prime.c b/apps/prime.c
index b18257d..3cbf98d 100644
--- a/apps/prime.c
+++ b/apps/prime.c
@@ -122,16 +122,26 @@ int prime_main(int argc, char **argv)
             goto end;
         }
         bn = BN_new();
-        BN_generate_prime_ex(bn, bits, safe, NULL, NULL, NULL);
+        if (!BN_generate_prime_ex(bn, bits, safe, NULL, NULL, NULL)) {
+            BIO_printf(bio_err, "Failed to generate prime.\n");
+            goto end;
+        }
         s = hex ? BN_bn2hex(bn) : BN_bn2dec(bn);
         BIO_printf(bio_out, "%s\n", s);
         OPENSSL_free(s);
     } else {
         for ( ; *argv; argv++) {
+            int r;
+
             if (hex)
-                BN_hex2bn(&bn, argv[0]);
+                r = BN_hex2bn(&bn, argv[0]);
             else
-                BN_dec2bn(&bn, argv[0]);
+                r = BN_dec2bn(&bn, argv[0]);
+
+            if(!r) {
+                BIO_printf(bio_err, "Failed to process value (%s)\n", argv[0]);
+                goto end;
+            }
 
             BN_print(bio_out, bn);
             BIO_printf(bio_out, " (%s) %s prime\n",
@@ -143,6 +153,7 @@ int prime_main(int argc, char **argv)
 
     BN_free(bn);
 
+    ret = 0;
  end:
     return ret;
 }
diff --git a/apps/s_cb.c b/apps/s_cb.c
index abcbad4..ad241f8 100644
--- a/apps/s_cb.c
+++ b/apps/s_cb.c
@@ -406,8 +406,6 @@ int ssl_print_point_formats(BIO *out, SSL *s)
 
         }
     }
-    if (nformats <= 0)
-        BIO_puts(out, "NONE");
     BIO_puts(out, "\n");
     return 1;
 }
@@ -439,8 +437,6 @@ int ssl_print_curves(BIO *out, SSL *s, int noshared)
             BIO_printf(out, "%s", cname);
         }
     }
-    if (ncurves == 0)
-        BIO_puts(out, "NONE");
     OPENSSL_free(curves);
     if (noshared) {
         BIO_puts(out, "\n");
diff --git a/apps/s_client.c b/apps/s_client.c
index d658e04..5d575ad 100644
--- a/apps/s_client.c
+++ b/apps/s_client.c
@@ -1384,6 +1384,7 @@ int s_client_main(int argc, char **argv)
         case OPT_STARTTLS:
             if (!opt_pair(opt_arg(), services, &starttls_proto))
                 goto end;
+            break;
         case OPT_SERVERNAME:
             servername = opt_arg();
             break;
diff --git a/apps/ts.c b/apps/ts.c
index 70a9013..cec2177 100644
--- a/apps/ts.c
+++ b/apps/ts.c
@@ -319,9 +319,7 @@ int ts_main(int argc, char **argv)
             break;
         }
     }
-    argc = opt_num_rest();
-    argv = opt_rest();
-    if (mode == OPT_ERR || argc != 0)
+    if (mode == OPT_ERR || opt_num_rest() != 0)
         goto opthelp;
 
     /* Seed the random number generator if it is going to be used. */
diff --git a/apps/x509.c b/apps/x509.c
index 6e6ee08..6370116 100644
--- a/apps/x509.c
+++ b/apps/x509.c
@@ -763,7 +763,7 @@ int x509_main(int argc, char **argv)
                 BIO_printf(out, "/*\n"
                                 " * Subject: %s\n", buf);
 
-                m = X509_NAME_oneline(X509_get_issuer_name(x), buf, sizeof buf);
+                X509_NAME_oneline(X509_get_issuer_name(x), buf, sizeof buf);
                 BIO_printf(out, " * Issuer:  %s\n"
                                 " */\n", buf);
 
diff --git a/crypto/asn1/asn_mime.c b/crypto/asn1/asn_mime.c
index 851fb91..7c10b58 100644
--- a/crypto/asn1/asn_mime.c
+++ b/crypto/asn1/asn_mime.c
@@ -187,7 +187,7 @@ static ASN1_VALUE *b64_read_asn1(BIO *bio, const ASN1_ITEM *it)
     if (!val)
         ASN1err(ASN1_F_B64_READ_ASN1, ASN1_R_DECODE_ERROR);
     (void)BIO_flush(bio);
-    bio = BIO_pop(bio);
+    BIO_pop(bio);
     BIO_free(b64);
     return val;
 }
diff --git a/crypto/x509v3/v3_addr.c b/crypto/x509v3/v3_addr.c
index 49d0d4d..f68f937 100644
--- a/crypto/x509v3/v3_addr.c
+++ b/crypto/x509v3/v3_addr.c
@@ -897,7 +897,8 @@ static int IPAddressOrRanges_canonize(IPAddressOrRanges *aors,
         IPAddressOrRange *a = sk_IPAddressOrRange_value(aors, j);
         if (a != NULL && a->type == IPAddressOrRange_addressRange) {
             unsigned char a_min[ADDR_RAW_BUF_LEN], a_max[ADDR_RAW_BUF_LEN];
-            extract_min_max(a, a_min, a_max, length);
+            if (!extract_min_max(a, a_min, a_max, length))
+                return 0;
             if (memcmp(a_min, a_max, length) > 0)
                 return 0;
         }


More information about the openssl-commits mailing list