OpenSSL_version.3ossl 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. .\" -*- mode: troff; coding: utf-8 -*-
  2. .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
  3. .\"
  4. .\" Standard preamble:
  5. .\" ========================================================================
  6. .de Sp \" Vertical space (when we can't use .PP)
  7. .if t .sp .5v
  8. .if n .sp
  9. ..
  10. .de Vb \" Begin verbatim text
  11. .ft CW
  12. .nf
  13. .ne \\$1
  14. ..
  15. .de Ve \" End verbatim text
  16. .ft R
  17. .fi
  18. ..
  19. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
  20. .ie n \{\
  21. . ds C` ""
  22. . ds C' ""
  23. 'br\}
  24. .el\{\
  25. . ds C`
  26. . ds C'
  27. 'br\}
  28. .\"
  29. .\" Escape single quotes in literal strings from groff's Unicode transform.
  30. .ie \n(.g .ds Aq \(aq
  31. .el .ds Aq '
  32. .\"
  33. .\" If the F register is >0, we'll generate index entries on stderr for
  34. .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
  35. .\" entries marked with X<> in POD. Of course, you'll have to process the
  36. .\" output yourself in some meaningful fashion.
  37. .\"
  38. .\" Avoid warning from groff about undefined register 'F'.
  39. .de IX
  40. ..
  41. .nr rF 0
  42. .if \n(.g .if rF .nr rF 1
  43. .if (\n(rF:(\n(.g==0)) \{\
  44. . if \nF \{\
  45. . de IX
  46. . tm Index:\\$1\t\\n%\t"\\$2"
  47. ..
  48. . if !\nF==2 \{\
  49. . nr % 0
  50. . nr F 2
  51. . \}
  52. . \}
  53. .\}
  54. .rr rF
  55. .\" ========================================================================
  56. .\"
  57. .IX Title "OPENSSL_VERSION 3ossl"
  58. .TH OPENSSL_VERSION 3ossl 2025-01-17 3.4.0 OpenSSL
  59. .\" For nroff, turn off justification. Always turn off hyphenation; it makes
  60. .\" way too many mistakes in technical documents.
  61. .if n .ad l
  62. .nh
  63. .SH NAME
  64. OPENSSL_VERSION_MAJOR, OPENSSL_VERSION_MINOR, OPENSSL_VERSION_PATCH,
  65. OPENSSL_VERSION_PRE_RELEASE, OPENSSL_VERSION_BUILD_METADATA,
  66. OPENSSL_VERSION_TEXT, OPENSSL_VERSION_PREREQ, OPENSSL_version_major,
  67. OPENSSL_version_minor, OPENSSL_version_patch, OPENSSL_version_pre_release,
  68. OPENSSL_version_build_metadata, OpenSSL_version, OPENSSL_VERSION_NUMBER,
  69. OpenSSL_version_num, OPENSSL_info
  70. \&\- get OpenSSL version number and other information
  71. .SH SYNOPSIS
  72. .IX Header "SYNOPSIS"
  73. .Vb 1
  74. \& #include <openssl/opensslv.h>
  75. \&
  76. \& #define OPENSSL_VERSION_MAJOR x
  77. \& #define OPENSSL_VERSION_MINOR y
  78. \& #define OPENSSL_VERSION_PATCH z
  79. \&
  80. \& /* The definitions here are typical release values */
  81. \& #define OPENSSL_VERSION_PRE_RELEASE ""
  82. \& #define OPENSSL_VERSION_BUILD_METADATA ""
  83. \&
  84. \& #define OPENSSL_VERSION_TEXT "OpenSSL x.y.z xx XXX xxxx"
  85. \&
  86. \& #define OPENSSL_VERSION_PREREQ(maj,min)
  87. \&
  88. \& #include <openssl/crypto.h>
  89. \&
  90. \& unsigned int OPENSSL_version_major(void);
  91. \& unsigned int OPENSSL_version_minor(void);
  92. \& unsigned int OPENSSL_version_patch(void);
  93. \& const char *OPENSSL_version_pre_release(void);
  94. \& const char *OPENSSL_version_build_metadata(void);
  95. \&
  96. \& const char *OpenSSL_version(int t);
  97. \&
  98. \& const char *OPENSSL_info(int t);
  99. \&
  100. \& /* from openssl/opensslv.h */
  101. \& #define OPENSSL_VERSION_NUMBER 0xnnnnnnnnL
  102. \&
  103. \& /* from openssl/crypto.h */
  104. \& unsigned long OpenSSL_version_num();
  105. .Ve
  106. .SH DESCRIPTION
  107. .IX Header "DESCRIPTION"
  108. .SS Macros
  109. .IX Subsection "Macros"
  110. The three macros \fBOPENSSL_VERSION_MAJOR\fR, \fBOPENSSL_VERSION_MINOR\fR and
  111. \&\fBOPENSSL_VERSION_PATCH\fR represent the three parts of a version
  112. identifier, \fR\f(BIMAJOR\fR\fB.\fR\f(BIMINOR\fR\fB.\fR\f(BIPATCH\fR\fB\fR.
  113. .PP
  114. The macro \fBOPENSSL_VERSION_PRE_RELEASE\fR is an added bit of text that
  115. indicates that this is a pre-release version, such as \f(CW"\-dev"\fR for an
  116. ongoing development snapshot or \f(CW"\-alpha3"\fR for an alpha release.
  117. The value must be a string.
  118. .PP
  119. The macro \fBOPENSSL_VERSION_BUILD_METADATA\fR is extra information, reserved
  120. for other parties, such as \f(CW"+fips"\fR, or \f(CW"+vendor.1"\fR).
  121. The OpenSSL project will not touch this macro (will leave it an empty string).
  122. The value must be a string.
  123. .PP
  124. \&\fBOPENSSL_VERSION_STR\fR is a convenience macro to get the short version
  125. identifier string, \f(CW"\fR\f(CIMAJOR\fR\f(CW.\fR\f(CIMINOR\fR\f(CW.\fR\f(CIPATCH\fR\f(CW"\fR.
  126. .PP
  127. \&\fBOPENSSL_FULL_VERSION_STR\fR is a convenience macro to get the longer
  128. version identifier string, which combines \fBOPENSSL_VERSION_STR\fR,
  129. \&\fBOPENSSL_VERSION_PRE_RELEASE\fR and \fBOPENSSL_VERSION_BUILD_METADATA\fR.
  130. .PP
  131. \&\fBOPENSSL_VERSION_TEXT\fR is a convenience macro to get a full descriptive
  132. version text, which includes \fBOPENSSL_FULL_VERSION_STR\fR and the release
  133. date.
  134. .PP
  135. \&\fBOPENSSL_VERSION_PREREQ\fR is a useful macro for checking whether the OpenSSL
  136. version for the headers in use is at least at the given pre-requisite major
  137. (\fBmaj\fR) and minor (\fBmin\fR) number or not. It will evaluate to true if the
  138. header version number (\fBOPENSSL_VERSION_MAJOR\fR.\fBOPENSSL_VERSION_MINOR\fR) is
  139. greater than or equal to \fBmaj\fR.\fBmin\fR.
  140. .PP
  141. \&\fBOPENSSL_VERSION_NUMBER\fR is a combination of the major, minor and
  142. patch version into a single integer 0xMNN00PP0L, where:
  143. .IP M 4
  144. .IX Item "M"
  145. is the number from \fBOPENSSL_VERSION_MAJOR\fR, in hexadecimal notation
  146. .IP NN 4
  147. .IX Item "NN"
  148. is the number from \fBOPENSSL_VERSION_MINOR\fR, in hexadecimal notation
  149. .IP PP 4
  150. .IX Item "PP"
  151. is the number from \fBOPENSSL_VERSION_PATCH\fR, in hexadecimal notation
  152. .SS Functions
  153. .IX Subsection "Functions"
  154. \&\fBOPENSSL_version_major()\fR, \fBOPENSSL_version_minor()\fR, \fBOPENSSL_version_patch()\fR,
  155. \&\fBOPENSSL_version_pre_release()\fR, and \fBOPENSSL_version_build_metadata()\fR return
  156. the values of the macros above for the build of the library, respectively.
  157. .PP
  158. \&\fBOpenSSL_version()\fR returns different strings depending on \fIt\fR:
  159. .IP OPENSSL_VERSION 4
  160. .IX Item "OPENSSL_VERSION"
  161. The value of \fBOPENSSL_VERSION_TEXT\fR
  162. .IP OPENSSL_VERSION_STRING 4
  163. .IX Item "OPENSSL_VERSION_STRING"
  164. The value of \fBOPENSSL_VERSION_STR\fR
  165. .IP OPENSSL_FULL_VERSION_STRING 4
  166. .IX Item "OPENSSL_FULL_VERSION_STRING"
  167. The value of \fBOPENSSL_FULL_VERSION_STR\fR
  168. .IP OPENSSL_CFLAGS 4
  169. .IX Item "OPENSSL_CFLAGS"
  170. The compiler flags set for the compilation process in the form
  171. \&\f(CW\*(C`compiler: ...\*(C'\fR if available, or \f(CW\*(C`compiler: information not available\*(C'\fR
  172. otherwise.
  173. .IP OPENSSL_BUILT_ON 4
  174. .IX Item "OPENSSL_BUILT_ON"
  175. The date of the build process in the form \f(CW\*(C`built on: ...\*(C'\fR if available
  176. or \f(CW\*(C`built on: date not available\*(C'\fR otherwise.
  177. The date would not be available in a reproducible build, for example.
  178. .IP OPENSSL_PLATFORM 4
  179. .IX Item "OPENSSL_PLATFORM"
  180. The "Configure" target of the library build in the form \f(CW\*(C`platform: ...\*(C'\fR
  181. if available, or \f(CW\*(C`platform: information not available\*(C'\fR otherwise.
  182. .IP OPENSSL_DIR 4
  183. .IX Item "OPENSSL_DIR"
  184. The \fBOPENSSLDIR\fR setting of the library build in the form \f(CW\*(C`OPENSSLDIR: "..."\*(C'\fR
  185. if available, or \f(CW\*(C`OPENSSLDIR: N/A\*(C'\fR otherwise.
  186. .IP OPENSSL_ENGINES_DIR 4
  187. .IX Item "OPENSSL_ENGINES_DIR"
  188. The \fBENGINESDIR\fR setting of the library build in the form \f(CW\*(C`ENGINESDIR: "..."\*(C'\fR
  189. if available, or \f(CW\*(C`ENGINESDIR: N/A\*(C'\fR otherwise. This option is deprecated in
  190. OpenSSL 3.0.
  191. .IP OPENSSL_MODULES_DIR 4
  192. .IX Item "OPENSSL_MODULES_DIR"
  193. The \fBMODULESDIR\fR setting of the library build in the form \f(CW\*(C`MODULESDIR: "..."\*(C'\fR
  194. if available, or \f(CW\*(C`MODULESDIR: N/A\*(C'\fR otherwise.
  195. .IP OPENSSL_CPU_INFO 4
  196. .IX Item "OPENSSL_CPU_INFO"
  197. The current OpenSSL cpu settings.
  198. This is the current setting of the cpu capability flags. It is usually
  199. automatically configured but may be set via an environment variable.
  200. The value has the same syntax as the environment variable.
  201. For x86 the string looks like \f(CW\*(C`CPUINFO: OPENSSL_ia32cap=0x123:0x456\*(C'\fR
  202. or \f(CW\*(C`CPUINFO: N/A\*(C'\fR if not available.
  203. .IP OPENSSL_WINCTX 4
  204. .IX Item "OPENSSL_WINCTX"
  205. The Windows install context.
  206. The Windows install context is used to compute the OpenSSL registry key name
  207. on Windows. The full registry key is
  208. \&\f(CW\*(C`SOFTWARE\eWOW6432Node\eOpenSSL\-{major}.{minor}\-{context}\*(C'\fR, where \f(CW\*(C`{major}\*(C'\fR,
  209. \&\f(CW\*(C`{minor}\*(C'\fR and \f(CW\*(C`{context}\*(C'\fR are OpenSSL's major version number, minor version
  210. number and the Windows install context, respectively.
  211. .PP
  212. For an unknown \fIt\fR, the text \f(CW\*(C`not available\*(C'\fR is returned.
  213. .PP
  214. \&\fBOPENSSL_info()\fR also returns different strings depending on \fIt\fR:
  215. .IP OPENSSL_INFO_CONFIG_DIR 4
  216. .IX Item "OPENSSL_INFO_CONFIG_DIR"
  217. The configured \f(CW\*(C`OPENSSLDIR\*(C'\fR, which is the default location for
  218. OpenSSL configuration files.
  219. .IP OPENSSL_INFO_ENGINES_DIR 4
  220. .IX Item "OPENSSL_INFO_ENGINES_DIR"
  221. The configured \f(CW\*(C`ENGINESDIR\*(C'\fR, which is the default location for
  222. OpenSSL engines.
  223. .IP OPENSSL_INFO_MODULES_DIR 4
  224. .IX Item "OPENSSL_INFO_MODULES_DIR"
  225. The configured \f(CW\*(C`MODULESDIR\*(C'\fR, which is the default location for
  226. dynamically loadable OpenSSL modules other than engines.
  227. .IP OPENSSL_INFO_DSO_EXTENSION 4
  228. .IX Item "OPENSSL_INFO_DSO_EXTENSION"
  229. The configured dynamically loadable module extension.
  230. .IP OPENSSL_INFO_DIR_FILENAME_SEPARATOR 4
  231. .IX Item "OPENSSL_INFO_DIR_FILENAME_SEPARATOR"
  232. The separator between a directory specification and a filename.
  233. Note that on some operating systems, this is not the same as the
  234. separator between directory elements.
  235. .IP OPENSSL_INFO_LIST_SEPARATOR 4
  236. .IX Item "OPENSSL_INFO_LIST_SEPARATOR"
  237. The OpenSSL list separator.
  238. This is typically used in strings that are lists of items, such as the
  239. value of the environment variable \f(CW$PATH\fR on Unix (where the
  240. separator is \f(CW\*(C`:\*(C'\fR) or \f(CW\*(C`%PATH%\*(C'\fR on Windows (where the separator is
  241. \&\f(CW\*(C`;\*(C'\fR).
  242. .IP OPENSSL_INFO_CPU_SETTINGS 4
  243. .IX Item "OPENSSL_INFO_CPU_SETTINGS"
  244. The current OpenSSL cpu settings.
  245. This is the current setting of the cpu capability flags. It is usually
  246. automatically configured but may be set via an environment variable.
  247. The value has the same syntax as the environment variable.
  248. For x86 the string looks like \f(CW\*(C`OPENSSL_ia32cap=0x123:0x456\*(C'\fR.
  249. .IP OPENSSL_INFO_WINDOWS_CONTEXT 4
  250. .IX Item "OPENSSL_INFO_WINDOWS_CONTEXT"
  251. The Windows install context.
  252. The Windows install context is used to compute the OpenSSL registry key name
  253. on Windows. The full registry key is
  254. \&\f(CW\*(C`SOFTWARE\eWOW6432Node\eOpenSSL\-{major}.{minor}\-{context}\*(C'\fR, where \f(CW\*(C`{major}\*(C'\fR,
  255. \&\f(CW\*(C`{minor}\*(C'\fR and \f(CW\*(C`{context}\*(C'\fR are OpenSSL's major version number, minor version
  256. number and the Windows install context, respectively.
  257. .PP
  258. For an unknown \fIt\fR, NULL is returned.
  259. .PP
  260. \&\fBOpenSSL_version_num()\fR returns the value of \fBOPENSSL_VERSION_NUMBER\fR.
  261. .SH "RETURN VALUES"
  262. .IX Header "RETURN VALUES"
  263. \&\fBOPENSSL_version_major()\fR, \fBOPENSSL_version_minor()\fR and \fBOPENSSL_version_patch()\fR
  264. return the version number parts as integers.
  265. .PP
  266. \&\fBOPENSSL_version_pre_release()\fR and \fBOPENSSL_version_build_metadata()\fR return
  267. the values of \fBOPENSSL_VERSION_PRE_RELEASE\fR and
  268. \&\fBOPENSSL_VERSION_BUILD_METADATA\fR respectively as constant strings.
  269. For any of them that is undefined, the empty string is returned.
  270. .PP
  271. \&\fBOpenSSL_version()\fR returns constant strings.
  272. .SH "SEE ALSO"
  273. .IX Header "SEE ALSO"
  274. \&\fBcrypto\fR\|(7)
  275. .SH HISTORY
  276. .IX Header "HISTORY"
  277. The macros and functions described here were added in OpenSSL 3.0,
  278. except for OPENSSL_VERSION_NUMBER and \fBOpenSSL_version_num()\fR.
  279. .SH COPYRIGHT
  280. .IX Header "COPYRIGHT"
  281. Copyright 2018\-2024 The OpenSSL Project Authors. All Rights Reserved.
  282. .PP
  283. Licensed under the Apache License 2.0 (the "License"). You may not use
  284. this file except in compliance with the License. You can obtain a copy
  285. in the file LICENSE in the source distribution or at
  286. <https://www.openssl.org/source/license.html>.