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

Richard Levitte levitte at openssl.org
Thu Nov 3 23:19:54 UTC 2016


The branch OpenSSL_1_1_0-stable has been updated
       via  8f8e9f184bf51fa283c1af9c4fd63098fc7387dd (commit)
      from  0d325d9cb9ecb10cb1d41f64751ca8d8f2df472b (commit)


- Log -----------------------------------------------------------------
commit 8f8e9f184bf51fa283c1af9c4fd63098fc7387dd
Author: Richard Levitte <levitte at openssl.org>
Date:   Thu Nov 3 18:48:23 2016 +0100

    Don't assume to know the shared library extension
    
    test/shlibloadtest.c assumes all Unix style platforms use .so as
    shared library extension.  This is not the case for Mac OS X, which
    uses .dylib.  Instead of this, have the test recipe find out the
    extension from configuration data.
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/1844)
    (cherry picked from commit 62dd3351a16089aedb0f1e62e3b6df371c93389c)

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

Summary of changes:
 test/recipes/90-test_shlibload.t | 17 ++++++++---------
 test/shlibloadtest.c             | 19 +++----------------
 2 files changed, 11 insertions(+), 25 deletions(-)

diff --git a/test/recipes/90-test_shlibload.t b/test/recipes/90-test_shlibload.t
index dc35613..9058ba5 100644
--- a/test/recipes/90-test_shlibload.t
+++ b/test/recipes/90-test_shlibload.t
@@ -22,16 +22,15 @@ plan skip_all => "Test only supported in a shared build" if disabled("shared");
 
 plan tests => 3;
 
-ok(run(test(["shlibloadtest", "-crypto_first",
-             $unified_info{sharednames}->{libcrypto},
-             $unified_info{sharednames}->{libssl}])),
+my $libcrypto =
+    $unified_info{sharednames}->{libcrypto}.$target{shared_extension_simple};
+my $libssl =
+    $unified_info{sharednames}->{libssl}.$target{shared_extension_simple};
+
+ok(run(test(["shlibloadtest", "-crypto_first", $libcrypto, $libssl])),
    "running shlibloadtest -crypto_first");
-ok(run(test(["shlibloadtest", "-ssl_first",
-             $unified_info{sharednames}->{libcrypto},
-             $unified_info{sharednames}->{libssl}])),
+ok(run(test(["shlibloadtest", "-ssl_first", $libcrypto, $libssl])),
    "running shlibloadtest -ssl_first");
-ok(run(test(["shlibloadtest", "-just_crypto",
-             $unified_info{sharednames}->{libcrypto},
-             $unified_info{sharednames}->{libssl}])),
+ok(run(test(["shlibloadtest", "-just_crypto", $libcrypto, $libssl])),
    "running shlibloadtest -just_crypto");
 
diff --git a/test/shlibloadtest.c b/test/shlibloadtest.c
index 20030d9..eea2e3a 100644
--- a/test/shlibloadtest.c
+++ b/test/shlibloadtest.c
@@ -44,22 +44,9 @@ typedef void * SHLIB;
 typedef void * SHLIB_SYM;
 # define SHLIB_INIT NULL
 
-# define SHARED_LIBRARY_SUFFIX ".so"
-
-static int shlib_load(char *filename, SHLIB *lib)
+static int shlib_load(const char *filename, SHLIB *lib)
 {
-    char *tmpfile;
-    size_t filenamelen = strlen(filename);
-
-    /* Total length = base filename len + suffix len + 1 for NULL terminator */
-    tmpfile = malloc(filenamelen + sizeof(SHARED_LIBRARY_SUFFIX) + 1);
-    if (tmpfile == NULL)
-        return 0;
-    strcpy(tmpfile, filename);
-    strcpy(tmpfile + filenamelen, SHARED_LIBRARY_SUFFIX);
-
-    *lib = dlopen(tmpfile, RTLD_GLOBAL | RTLD_LAZY);
-    free(tmpfile);
+    *lib = dlopen(filename, RTLD_GLOBAL | RTLD_LAZY);
 
     if (*lib == NULL)
         return 0;
@@ -90,7 +77,7 @@ typedef HINSTANCE SHLIB;
 typedef void * SHLIB_SYM;
 # define SHLIB_INIT 0
 
-static int shlib_load(char *filename, SHLIB *lib)
+static int shlib_load(const char *filename, SHLIB *lib)
 {
     *lib = LoadLibraryA(filename);
     if (*lib == NULL)


More information about the openssl-commits mailing list