From: Richard Levitte Date: Thu, 18 Sep 2025 05:14:13 +0000 (+0200) Subject: Fix OPENSSL_VERSION_NUMBER to always have zero status bits X-Git-Tag: openssl-3.3.5~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f1fd3d52356fdad065b7e03fb292e8e905dda301;p=thirdparty%2Fopenssl.git Fix OPENSSL_VERSION_NUMBER to always have zero status bits The documentation suggested that they were always zero, while the implementation in suggested that it could be 0xf in OpenSSL releases... which (almost) never happened because of a bug in said implementation. Therefore, we solidify that the status bits are indeed always zero, at least in all OpenSSL 3 versions. Resolves: https://github.com/openssl/project/issues/1621 Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/28603) (cherry picked from commit 60c4feacce6faf0e98167dc2ab2a1c2e85882049) --- diff --git a/doc/man3/OpenSSL_version.pod b/doc/man3/OpenSSL_version.pod index e1cf16e2a10..d1bd234bdd4 100644 --- a/doc/man3/OpenSSL_version.pod +++ b/doc/man3/OpenSSL_version.pod @@ -238,6 +238,13 @@ L The macros and functions described here were added in OpenSSL 3.0, except for OPENSSL_VERSION_NUMBER and OpenSSL_version_num(). +=head1 BUGS + +There was a discrepancy between this manual and commentary + code +in F<< >>, where the latter suggested that the +four least significant bits of B could be +C<0x0f> in released OpenSSL versions. + =head1 COPYRIGHT Copyright 2018-2022 The OpenSSL Project Authors. All Rights Reserved. diff --git a/include/openssl/opensslv.h.in b/include/openssl/opensslv.h.in index d15cce412f5..f6ef0963e34 100644 --- a/include/openssl/opensslv.h.in +++ b/include/openssl/opensslv.h.in @@ -89,12 +89,12 @@ extern "C" { # define OPENSSL_VERSION_TEXT "OpenSSL {- "$config{full_version} $config{release_date}" -}" -/* Synthesize OPENSSL_VERSION_NUMBER with the layout 0xMNN00PPSL */ +/* Synthesize OPENSSL_VERSION_NUMBER with the layout 0xMNN00PP0L */ # define OPENSSL_VERSION_NUMBER \ ( (OPENSSL_VERSION_MAJOR<<28) \ |(OPENSSL_VERSION_MINOR<<20) \ |(OPENSSL_VERSION_PATCH<<4) \ - |{- @config{prerelease} ? "0x0L" : "0xfL" -} ) + |0x0L ) # ifdef __cplusplus }