[openssl-commits] [openssl] OpenSSL_1_0_2-stable update

Matt Caswell matt at openssl.org
Tue Mar 17 14:54:34 UTC 2015


The branch OpenSSL_1_0_2-stable has been updated
       via  c1559f5046092b542f8033bb8eec8bd88ce0d8f2 (commit)
       via  d8d2e503593ac429fa04b96c7722dcf1c33bdeb3 (commit)
      from  6c4ce00753c5763cf836f6fec9ec07ed7c2e6e03 (commit)


- Log -----------------------------------------------------------------
commit c1559f5046092b542f8033bb8eec8bd88ce0d8f2
Author: Matt Caswell <matt at openssl.org>
Date:   Thu Mar 12 14:09:00 2015 +0000

    Dead code removal from apps
    
    Some miscellaneous removal of dead code from apps. Also fix an issue with
    error handling with pkcs7.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (cherry picked from commit 11abf92259e899f4f7da4a3e80781e84b0fb1a64)

commit d8d2e503593ac429fa04b96c7722dcf1c33bdeb3
Author: Matt Caswell <matt at openssl.org>
Date:   Thu Mar 12 14:08:21 2015 +0000

    Remove dead code from crypto
    
    Some miscellaneous removal of dead code from lib crypto.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (cherry picked from commit b7573c597c1932ef709b2455ffab47348b5c54e5)

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

Summary of changes:
 apps/pkcs7.c           | 10 +++++-----
 apps/s_server.c        |  2 +-
 crypto/bio/b_print.c   |  7 ++-----
 crypto/dso/dso_dlfcn.c |  7 +++----
 4 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/apps/pkcs7.c b/apps/pkcs7.c
index 4d80f82..643507f 100644
--- a/apps/pkcs7.c
+++ b/apps/pkcs7.c
@@ -189,11 +189,11 @@ int MAIN(int argc, char **argv)
     if (infile == NULL)
         BIO_set_fp(in, stdin, BIO_NOCLOSE);
     else {
-        if (BIO_read_filename(in, infile) <= 0)
-            if (in == NULL) {
-                perror(infile);
-                goto end;
-            }
+        if (BIO_read_filename(in, infile) <= 0) {
+            BIO_printf(bio_err, "unable to load input file\n");
+            ERR_print_errors(bio_err);
+            goto end;
+        }
     }
 
     if (informat == FORMAT_ASN1)
diff --git a/apps/s_server.c b/apps/s_server.c
index d5d2492..a8491ac 100644
--- a/apps/s_server.c
+++ b/apps/s_server.c
@@ -347,7 +347,7 @@ static unsigned int psk_server_cb(SSL *ssl, const char *identity,
     }
     if (s_debug)
         BIO_printf(bio_s_out, "identity_len=%d identity=%s\n",
-                   identity ? (int)strlen(identity) : 0, identity);
+                   (int)strlen(identity), identity);
 
     /* here we could lookup the given identity e.g. from a database */
     if (strcmp(identity, psk_identity) != 0) {
diff --git a/crypto/bio/b_print.c b/crypto/bio/b_print.c
index f7940f2..c2cf6e6 100644
--- a/crypto/bio/b_print.c
+++ b/crypto/bio/b_print.c
@@ -592,7 +592,6 @@ fmtfp(char **sbuffer,
     int fplace = 0;
     int padlen = 0;
     int zpadlen = 0;
-    int caps = 0;
     long intpart;
     long fracpart;
     long max10;
@@ -630,8 +629,7 @@ fmtfp(char **sbuffer,
 
     /* convert integer part */
     do {
-        iconvert[iplace++] =
-            (caps ? "0123456789ABCDEF" : "0123456789abcdef")[intpart % 10];
+        iconvert[iplace++] = "0123456789"[intpart % 10];
         intpart = (intpart / 10);
     } while (intpart && (iplace < (int)sizeof(iconvert)));
     if (iplace == sizeof iconvert)
@@ -640,8 +638,7 @@ fmtfp(char **sbuffer,
 
     /* convert fractional part */
     do {
-        fconvert[fplace++] =
-            (caps ? "0123456789ABCDEF" : "0123456789abcdef")[fracpart % 10];
+        fconvert[fplace++] = "0123456789"[fracpart % 10];
         fracpart = (fracpart / 10);
     } while (fplace < max);
     if (fplace == sizeof fconvert)
diff --git a/crypto/dso/dso_dlfcn.c b/crypto/dso/dso_dlfcn.c
index c0fcbb1..f629f03 100644
--- a/crypto/dso/dso_dlfcn.c
+++ b/crypto/dso/dso_dlfcn.c
@@ -314,7 +314,7 @@ static char *dlfcn_merger(DSO *dso, const char *filespec1,
             return (NULL);
         }
         strcpy(merged, filespec2);
-    } else
+    } else {
         /*
          * This part isn't as trivial as it looks.  It assumes that the
          * second file specification really is a directory, and makes no
@@ -322,13 +322,12 @@ static char *dlfcn_merger(DSO *dso, const char *filespec1,
          * concatenation of filespec2 followed by a slash followed by
          * filespec1.
          */
-    {
         int spec2len, len;
 
         spec2len = strlen(filespec2);
-        len = spec2len + (filespec1 ? strlen(filespec1) : 0);
+        len = spec2len + strlen(filespec1);
 
-        if (filespec2 && filespec2[spec2len - 1] == '/') {
+        if (spec2len && filespec2[spec2len - 1] == '/') {
             spec2len--;
             len--;
         }


More information about the openssl-commits mailing list