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

Rich Salz rsalz at openssl.org
Thu Feb 1 18:27:43 UTC 2018


The branch OpenSSL_1_1_0-stable has been updated
       via  d8adfdcd2e5de23f3e1d1a1d10c2fda6f4a65c4a (commit)
      from  d4577a1474cd67afbfa5a48729c979180144b9d6 (commit)


- Log -----------------------------------------------------------------
commit d8adfdcd2e5de23f3e1d1a1d10c2fda6f4a65c4a
Author: Michael Richardson <mcr at sandelman.ca>
Date:   Thu Feb 1 13:22:48 2018 -0500

    Add OPENSSL_VERSION_AT_LEAST
    
    added macro to create version number
    use the macro to build OPENSSL_VERSION_AT_LEAST(maj,min,fix) so that
    customers of libssl (such as ruby-openssl) do not need to be so aware of
    openssl version numbers.
    includes updates to ssl(7) and OPENSSL_VERSION_NUMBER(3) man page
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/5212)
    (cherry picked from commit 3c5a61dd0f9d9a9eac098419bcaf47d1c296ca81)

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

Summary of changes:
 doc/crypto/OPENSSL_VERSION_NUMBER.pod | 5 +++++
 doc/ssl/ssl.pod                       | 6 ++++++
 include/openssl/opensslv.h            | 5 +++++
 3 files changed, 16 insertions(+)

diff --git a/doc/crypto/OPENSSL_VERSION_NUMBER.pod b/doc/crypto/OPENSSL_VERSION_NUMBER.pod
index 9cc1ed1..6e23abf 100644
--- a/doc/crypto/OPENSSL_VERSION_NUMBER.pod
+++ b/doc/crypto/OPENSSL_VERSION_NUMBER.pod
@@ -47,6 +47,11 @@ number was therefore 0x0090581f.
 
 OpenSSL_version_num() returns the version number.
 
+The macro OPENSSL_VERSION_AT_LEAST(major,minor) can be used at compile
+time test if the current version is at least as new as the version provided.
+The arguments major, minor and fix correspond to the version information
+as given above.
+
 OpenSSL_version() returns different strings depending on B<t>:
 
 =over 4
diff --git a/doc/ssl/ssl.pod b/doc/ssl/ssl.pod
index daee30d..3b17ec1 100644
--- a/doc/ssl/ssl.pod
+++ b/doc/ssl/ssl.pod
@@ -91,6 +91,12 @@ includes both more private SSL headers and headers from the B<crypto> library.
 Whenever you need hard-core details on the internals of the SSL API, look
 inside this header file.
 
+OPENSSL_VERSION_AT_LEAST(major,minor) can be
+used in C<#if> statements in order to determine which version of the library is
+being used. This can be used to either enable optional features at compile
+time, or work around issues with a previous version.
+See L<OPENSSL_VERSION_NUMBER(3)>.
+
 =item B<ssl2.h>
 
 Unused. Present for backwards compatibility only.
diff --git a/include/openssl/opensslv.h b/include/openssl/opensslv.h
index 47cb0bf..a7a0136 100644
--- a/include/openssl/opensslv.h
+++ b/include/openssl/opensslv.h
@@ -46,6 +46,11 @@ extern "C" {
 #  define OPENSSL_VERSION_TEXT    "OpenSSL 1.1.0h-dev  xx XXX xxxx"
 # endif
 
+#define OPENSSL_MAKE_VERSION(maj,min,fix,patch) ((0x10000000L)+((maj&0xff)<<20)+((min&0xff)<<12)+((fix&0xff)<<4)+patch)
+
+/* use this for #if tests, should never depend upon fix/patch */
+#define OPENSSL_VERSION_AT_LEAST(maj,min) (OPENSSL_MAKE_VERSION(maj,min, 0, 0) >= OPENSSL_VERSION_NUMBER)
+
 /*-
  * The macros below are to be used for shared library (.so, .dll, ...)
  * versioning.  That kind of versioning works a bit differently between


More information about the openssl-commits mailing list