1OPENSSL_VERSION(3ossl)              OpenSSL             OPENSSL_VERSION(3ossl)
2
3
4

NAME

6       OPENSSL_VERSION_MAJOR, OPENSSL_VERSION_MINOR, OPENSSL_VERSION_PATCH,
7       OPENSSL_VERSION_PRE_RELEASE, OPENSSL_VERSION_BUILD_METADATA,
8       OPENSSL_VERSION_TEXT, OPENSSL_VERSION_PREREQ, OPENSSL_version_major,
9       OPENSSL_version_minor, OPENSSL_version_patch,
10       OPENSSL_version_pre_release, OPENSSL_version_build_metadata,
11       OpenSSL_version, OPENSSL_VERSION_NUMBER, OpenSSL_version_num,
12       OPENSSL_info - get OpenSSL version number and other information
13

SYNOPSIS

15        #include <openssl/opensslv.h>
16
17        #define OPENSSL_VERSION_MAJOR  x
18        #define OPENSSL_VERSION_MINOR  y
19        #define OPENSSL_VERSION_PATCH  z
20
21        /* The definitions here are typical release values */
22        #define OPENSSL_VERSION_PRE_RELEASE ""
23        #define OPENSSL_VERSION_BUILD_METADATA ""
24
25        #define OPENSSL_VERSION_TEXT "OpenSSL x.y.z xx XXX xxxx"
26
27        #define OPENSSL_VERSION_PREREQ(maj,min)
28
29        #include <openssl/crypto.h>
30
31        unsigned int OPENSSL_version_major(void);
32        unsigned int OPENSSL_version_minor(void);
33        unsigned int OPENSSL_version_patch(void);
34        const char *OPENSSL_version_pre_release(void);
35        const char *OPENSSL_version_build_metadata(void);
36
37        const char *OpenSSL_version(int t);
38
39        const char *OPENSSL_info(int t);
40
41        /* from openssl/opensslv.h */
42        #define OPENSSL_VERSION_NUMBER 0xnnnnnnnnL
43
44        /* from openssl/crypto.h */
45        unsigned long OpenSSL_version_num();
46

DESCRIPTION

48   Macros
49       The three macros OPENSSL_VERSION_MAJOR, OPENSSL_VERSION_MINOR and
50       OPENSSL_VERSION_PATCH represent the three parts of a version
51       identifier, MAJOR.MINOR.PATCH.
52
53       The macro OPENSSL_VERSION_PRE_RELEASE is an added bit of text that
54       indicates that this is a pre-release version, such as "-dev" for an
55       ongoing development snapshot or "-alpha3" for an alpha release.  The
56       value must be a string.
57
58       The macro OPENSSL_VERSION_BUILD_METADATA is extra information, reserved
59       for other parties, such as "+fips", or "+vendor.1").  The OpenSSL
60       project will not touch this macro (will leave it an empty string).  The
61       value must be a string.
62
63       OPENSSL_VERSION_STR is a convenience macro to get the short version
64       identifier string, "MAJOR.MINOR.PATCH".
65
66       OPENSSL_FULL_VERSION_STR is a convenience macro to get the longer
67       version identifier string, which combines OPENSSL_VERSION_STR,
68       OPENSSL_VERSION_PRE_RELEASE and OPENSSL_VERSION_BUILD_METADATA.
69
70       OPENSSL_VERSION_TEXT is a convenience macro to get a full descriptive
71       version text, which includes OPENSSL_FULL_VERSION_STR and the release
72       date.
73
74       OPENSSL_VERSION_PREREQ is a useful macro for checking whether the
75       OpenSSL version for the headers in use is at least at the given pre-
76       requisite major (maj) and minor (min) number or not. It will evaluate
77       to true if the header version number
78       (OPENSSL_VERSION_MAJOR.OPENSSL_VERSION_MINOR) is greater than or equal
79       to maj.min.
80
81       OPENSSL_VERSION_NUMBER is a combination of the major, minor and patch
82       version into a single integer 0xMNN00PP0L, where:
83
84       M   is the number from OPENSSL_VERSION_MAJOR, in hexadecimal notation
85
86       NN  is the number from OPENSSL_VERSION_MINOR, in hexadecimal notation
87
88       PP  is the number from OPENSSL_VERSION_PATCH, in hexadecimal notation
89
90   Functions
91       OPENSSL_version_major(), OPENSSL_version_minor(),
92       OPENSSL_version_patch(), OPENSSL_version_pre_release(), and
93       OPENSSL_version_build_metadata() return the values of the macros above
94       for the build of the library, respectively.
95
96       OpenSSL_version() returns different strings depending on t:
97
98       OPENSSL_VERSION
99           The value of OPENSSL_VERSION_TEXT
100
101       OPENSSL_VERSION_STRING
102           The value of OPENSSL_VERSION_STR
103
104       OPENSSL_FULL_VERSION_STRING
105           The value of OPENSSL_FULL_VERSION_STR
106
107       OPENSSL_CFLAGS
108           The compiler flags set for the compilation process in the form
109           "compiler: ..."  if available, or "compiler: information not
110           available" otherwise.
111
112       OPENSSL_BUILT_ON
113           The date of the build process in the form "built on: ..." if
114           available or "built on: date not available" otherwise.  The date
115           would not be available in a reproducible build, for example.
116
117       OPENSSL_PLATFORM
118           The "Configure" target of the library build in the form "platform:
119           ..."  if available, or "platform: information not available"
120           otherwise.
121
122       OPENSSL_DIR
123           The OPENSSLDIR setting of the library build in the form
124           "OPENSSLDIR: "...""  if available, or "OPENSSLDIR: N/A" otherwise.
125
126       OPENSSL_ENGINES_DIR
127           The ENGINESDIR setting of the library build in the form
128           "ENGINESDIR: "...""  if available, or "ENGINESDIR: N/A" otherwise.
129           This option is deprecated in OpenSSL 3.0.
130
131       OPENSSL_MODULES_DIR
132           The MODULESDIR setting of the library build in the form
133           "MODULESDIR: "...""  if available, or "MODULESDIR: N/A" otherwise.
134
135       OPENSSL_CPU_INFO
136           The current OpenSSL cpu settings.  This is the current setting of
137           the cpu capability flags. It is usually automatically configured
138           but may be set via an environment variable.  The value has the same
139           syntax as the environment variable.  For x86 the string looks like
140           "CPUINFO: OPENSSL_ia32cap=0x123:0x456" or "CPUINFO: N/A" if not
141           available.
142
143       For an unknown t, the text "not available" is returned.
144
145       OPENSSL_info() also returns different strings depending on t:
146
147       OPENSSL_INFO_CONFIG_DIR
148           The configured "OPENSSLDIR", which is the default location for
149           OpenSSL configuration files.
150
151       OPENSSL_INFO_ENGINES_DIR
152           The configured "ENGINESDIR", which is the default location for
153           OpenSSL engines.
154
155       OPENSSL_INFO_MODULES_DIR
156           The configured "MODULESDIR", which is the default location for
157           dynamically loadable OpenSSL modules other than engines.
158
159       OPENSSL_INFO_DSO_EXTENSION
160           The configured dynamically loadable module extension.
161
162       OPENSSL_INFO_DIR_FILENAME_SEPARATOR
163           The separator between a directory specification and a filename.
164           Note that on some operating systems, this is not the same as the
165           separator between directory elements.
166
167       OPENSSL_INFO_LIST_SEPARATOR
168           The OpenSSL list separator.  This is typically used in strings that
169           are lists of items, such as the value of the environment variable
170           $PATH on Unix (where the separator is ":") or "%PATH%" on Windows
171           (where the separator is ";").
172
173       OPENSSL_INFO_CPU_SETTINGS
174           The current OpenSSL cpu settings.  This is the current setting of
175           the cpu capability flags. It is usually automatically configured
176           but may be set via an environment variable.  The value has the same
177           syntax as the environment variable.  For x86 the string looks like
178           "OPENSSL_ia32cap=0x123:0x456".
179
180       For an unknown t, NULL is returned.
181
182       OpenSSL_version_num() returns the value of OPENSSL_VERSION_NUMBER.
183

RETURN VALUES

185       OPENSSL_version_major(), OPENSSL_version_minor() and
186       OPENSSL_version_patch() return the version number parts as integers.
187
188       OPENSSL_version_pre_release() and OPENSSL_version_build_metadata()
189       return the values of OPENSSL_VERSION_PRE_RELEASE and
190       OPENSSL_VERSION_BUILD_METADATA respectively as constant strings.  For
191       any of them that is undefined, the empty string is returned.
192
193       OpenSSL_version() returns constant strings.
194

SEE ALSO

196       crypto(7)
197

HISTORY

199       The macros and functions described here were added in OpenSSL 3.0,
200       except for OPENSSL_VERSION_NUMBER and OpenSSL_version_num().
201
203       Copyright 2018-2022 The OpenSSL Project Authors. All Rights Reserved.
204
205       Licensed under the Apache License 2.0 (the "License").  You may not use
206       this file except in compliance with the License.  You can obtain a copy
207       in the file LICENSE in the source distribution or at
208       <https://www.openssl.org/source/license.html>.
209
210
211
2123.0.5                             2022-11-01            OPENSSL_VERSION(3ossl)
Impressum