Undeprecate OpenSSL_version_num and OPENSSL_VERSION_NUMBER
authorViktor Dukhovni <openssl-users@dukhovni.org>
Sun, 9 Dec 2018 22:10:29 +0000 (17:10 -0500)
committerRichard Levitte <levitte@openssl.org>
Thu, 5 Sep 2019 19:48:41 +0000 (21:48 +0200)
The OpenSSL_version_num() function returns at runtime the
OPENSSL_VERSION_NUMBER of the compiled OpenSSL library.  This is a
used and useful interface, and should not (at least yet) be
deprecated, we just introduced the new versioning schema, it seems
too early to deprecate the old.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7853)

crypto/cversion.c
include/openssl/crypto.h
include/openssl/opensslv.h
util/libcrypto.num

index 2a0dcf9..c81f56f 100644 (file)
 
 #include "buildinf.h"
 
-#if !OPENSSL_API_3
 unsigned long OpenSSL_version_num(void)
 {
     return OPENSSL_VERSION_NUMBER;
 }
-#endif
 
 unsigned int OPENSSL_version_major(void)
 {
index 05580ad..da62eef 100644 (file)
@@ -158,7 +158,7 @@ int OPENSSL_hexchar2int(unsigned char c);
 
 # define OPENSSL_MALLOC_MAX_NELEMS(type)  (((1U<<(sizeof(int)*8-1))-1)/sizeof(type))
 
-DEPRECATEDIN_3(unsigned long OpenSSL_version_num(void))
+unsigned long OpenSSL_version_num(void);
 const char *OpenSSL_version(int type);
 # define OPENSSL_VERSION                0
 # define OPENSSL_CFLAGS                 1
index c1d4b6f..6a62b49 100644 (file)
@@ -121,21 +121,17 @@ const char *OPENSSL_version_build_metadata(void);
 /*
  * SECTION 4: BACKWARD COMPATIBILITY
  */
-# include <openssl/macros.h>
-
-# if !OPENSSL_API_4
 /* 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 )
+# ifdef OPENSSL_VERSION_PRE_RELEASE
+#  define _OPENSSL_VERSION_PRE_RELEASE 0x0
+# else
+#  define _OPENSSL_VERSION_PRE_RELEASE 0xf
 # endif
+# define OPENSSL_VERSION_NUMBER          \
+    ( (OPENSSL_VERSION_MAJOR<<28)        \
+      |(OPENSSL_VERSION_MINOR<<20)       \
+      |(OPENSSL_VERSION_PATCH<<4)        \
+      |_OPENSSL_VERSION_PRE_RELEASE )
 
 # ifdef  __cplusplus
 }
index 9f7b0fd..e6567ae 100644 (file)
@@ -3150,7 +3150,7 @@ CMS_RecipientInfo_get0_pkey_ctx         3215      3_0_0   EXIST::FUNCTION:CMS
 OCSP_REQINFO_free                       3216   3_0_0   EXIST::FUNCTION:OCSP
 AUTHORITY_KEYID_new                     3217   3_0_0   EXIST::FUNCTION:
 i2d_DIST_POINT_NAME                     3218   3_0_0   EXIST::FUNCTION:
-OpenSSL_version_num                     3219   3_0_0   EXIST::FUNCTION:DEPRECATEDIN_3
+OpenSSL_version_num                     3219   3_0_0   EXIST::FUNCTION:
 OCSP_CERTID_free                        3220   3_0_0   EXIST::FUNCTION:OCSP
 BIO_hex_string                          3221   3_0_0   EXIST::FUNCTION:
 X509_REQ_sign_ctx                       3222   3_0_0   EXIST::FUNCTION: