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

Richard Levitte levitte at openssl.org
Mon Mar 19 06:03:28 UTC 2018


The branch OpenSSL_1_1_0-stable has been updated
       via  f778cd2d89b3dfb2438df44f42e5a9082b213a71 (commit)
       via  c8ee36792d69bc327d770453681acc7203ec6494 (commit)
      from  ec76f1794a55276c719617b23e816850646c43ff (commit)


- Log -----------------------------------------------------------------
commit f778cd2d89b3dfb2438df44f42e5a9082b213a71
Author: Richard Levitte <levitte at openssl.org>
Date:   Wed Mar 14 17:31:20 2018 +0100

    Stop test/shlibloadtest.c from failing in a regression test
    
    When doing a regression test, it's obvious that the version
    test/shlibloadtest is built for will not be the same as the library
    version.  So we change the test to check for assumed compatibility.
    
    Reviewed-by: Andy Polyakov <appro at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/5620)

commit c8ee36792d69bc327d770453681acc7203ec6494
Author: Richard Levitte <levitte at openssl.org>
Date:   Wed Mar 14 17:25:37 2018 +0100

    Add a simple method to run regression tests
    
    This is only useful when building shared libraries.  This allows us to
    run our tests against newer libraries when the time comes.  Simply do
    this:
    
        OPENSSL_REGRESSION=/other/OpenSSL/build/tree make test
    
    ($OPENSSL_REGRESSION *must* be an absolute path)
    
    Reviewed-by: Andy Polyakov <appro at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/5620)

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

Summary of changes:
 test/shlibloadtest.c  | 16 +++++++++++++++-
 util/shlib_wrap.sh.in | 20 ++++++++++++++++++++
 2 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/test/shlibloadtest.c b/test/shlibloadtest.c
index 6f220ba..6dae111 100644
--- a/test/shlibloadtest.c
+++ b/test/shlibloadtest.c
@@ -196,7 +196,21 @@ int main(int argc, char **argv)
         return 1;
     }
 
-    if (OpenSSL_version_num() != OPENSSL_VERSION_NUMBER) {
+    /*
+     * The bits that COMPATIBILITY_MASK lets through MUST be the same in
+     * the library and in the application.
+     * The bits that are masked away MUST be a larger or equal number in
+     * the library compared to the application.
+     */
+# define COMPATIBILITY_MASK 0xfff00000L
+    if ((OpenSSL_version_num() & COMPATIBILITY_MASK)
+        != (OPENSSL_VERSION_NUMBER & COMPATIBILITY_MASK)) {
+        printf("Unexpected library version loaded\n");
+        return 1;
+    }
+
+    if ((OpenSSL_version_num() & ~COMPATIBILITY_MASK)
+        < (OPENSSL_VERSION_NUMBER & ~COMPATIBILITY_MASK)) {
         printf("Unexpected library version loaded\n");
         return 1;
     }
diff --git a/util/shlib_wrap.sh.in b/util/shlib_wrap.sh.in
index 27a1e51..6c115ba 100755
--- a/util/shlib_wrap.sh.in
+++ b/util/shlib_wrap.sh.in
@@ -1,5 +1,25 @@
 #!/bin/sh
 
+# To test this OpenSSL version's applications against another version's
+# shared libraries, simply set
+#
+#     OPENSSL_REGRESSION=/path/to/other/OpenSSL/build/tree
+if [ -n "$OPENSSL_REGRESSION" ]; then
+    shlibwrap="$OPENSSL_REGRESSION/util/shlib_wrap.sh"
+    if [ -x "$shlibwrap" ]; then
+        # We clear OPENSSL_REGRESSION to avoid a loop, should the shlib_wrap.sh
+        # we exec also support that mechanism...
+        OPENSSL_REGRESSION= exec "$shlibwrap" "$@"
+    else
+        if [ -f "$shlibwrap" ]; then
+            echo "Not permitted to run $shlibwrap" >&2
+        else
+            echo "No $shlibwrap, perhaps OPENSSL_REGRESSION isn't properly set?" >&2
+        fi
+        exit 1
+    fi
+fi
+
 [ $# -ne 0 ] || set -x		# debug mode without arguments:-)
 
 THERE="`echo $0 | sed -e 's|[^/]*$||' 2>/dev/null`.."


More information about the openssl-commits mailing list