]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Correct the synthetisized OPENSSL_VERSION_NUMBER
authorRichard Levitte <levitte@openssl.org>
Mon, 11 Aug 2025 18:57:44 +0000 (20:57 +0200)
committerRichard Levitte <levitte@openssl.org>
Wed, 13 Aug 2025 04:07:38 +0000 (06:07 +0200)
The last hex digit always became 0x0L, even of OPENSSL_VERSION_PRE_RELEASE
was the empty string.

Resolves: https://github.com/openssl/openssl/issues/28227

Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28230)

(cherry picked from commit ba2c314a60d9f42d1d2e63ea0f791cc04e03005b)

include/openssl/opensslv.h.in

index 3f47a2ac08f05f6449efcb2caa7644c5b2472dbd..d15cce412f5c9e6a17db398bef85327e40dc832f 100644 (file)
@@ -90,16 +90,11 @@ extern "C" {
 # define OPENSSL_VERSION_TEXT "OpenSSL {- "$config{full_version} $config{release_date}" -}"
 
 /* Synthesize OPENSSL_VERSION_NUMBER with the layout 0xMNN00PPSL */
-# ifdef OPENSSL_VERSION_PRE_RELEASE
-#  define _OPENSSL_VERSION_PRE_RELEASE 0x0L
-# else
-#  define _OPENSSL_VERSION_PRE_RELEASE 0xfL
-# endif
 # define OPENSSL_VERSION_NUMBER          \
     ( (OPENSSL_VERSION_MAJOR<<28)        \
       |(OPENSSL_VERSION_MINOR<<20)       \
       |(OPENSSL_VERSION_PATCH<<4)        \
-      |_OPENSSL_VERSION_PRE_RELEASE )
+      |{- @config{prerelease} ? "0x0L" : "0xfL" -} )
 
 # ifdef  __cplusplus
 }