openssl-prebuild/linux_amd64/share/doc/openssl/html/man3/OpenSSL_version.html
2020-03-02 16:50:34 +00:00

310 lines
12 KiB
HTML
Executable File

<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenSSL_version</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:root@localhost" />
</head>
<body style="background-color: white">
<!-- INDEX BEGIN -->
<div name="index">
<p><a name="__index__"></a></p>
<ul>
<li><a href="#name">NAME</a></li>
<li><a href="#synopsis">SYNOPSIS</a></li>
<li><a href="#description">DESCRIPTION</a></li>
<ul>
<li><a href="#macros">Macros</a></li>
<li><a href="#functions">Functions</a></li>
</ul>
<li><a href="#backward_compatibility">BACKWARD COMPATIBILITY</a></li>
<ul>
<li><a href="#macros">Macros</a></li>
<li><a href="#functions">Functions</a></li>
</ul>
<li><a href="#return_values">RETURN VALUES</a></li>
<li><a href="#see_also">SEE ALSO</a></li>
<li><a href="#history">HISTORY</a></li>
<li><a href="#copyright">COPYRIGHT</a></li>
</ul>
<hr name="index" />
</div>
<!-- INDEX END -->
<p>
</p>
<hr />
<h1><a name="name">NAME</a></h1>
<p>OPENSSL_VERSION_MAJOR, OPENSSL_VERSION_MINOR, OPENSSL_VERSION_PATCH,
OPENSSL_VERSION_PRE_RELEASE, OPENSSL_VERSION_BUILD_METADATA,
OPENSSL_VERSION_TEXT,
OPENSSL_version_major, OPENSSL_version_minor, OPENSSL_version_patch,
OPENSSL_version_pre_release, OPENSSL_version_build_metadata, OpenSSL_version,
OPENSSL_VERSION_NUMBER, OpenSSL_version_num, OPENSSL_info
- get OpenSSL version number and other information</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<pre>
#include &lt;openssl/opensslv.h&gt;</pre>
<pre>
#define OPENSSL_VERSION_MAJOR x
#define OPENSSL_VERSION_MINOR y
#define OPENSSL_VERSION_PATCH z</pre>
<pre>
/* The definitions here are typical release values */
#define OPENSSL_VERSION_PRE_RELEASE &quot;&quot;
#define OPENSSL_VERSION_BUILD_METADATA &quot;&quot;</pre>
<pre>
#define OPENSSL_VERSION_TEXT &quot;OpenSSL x.y.z xx XXX xxxx&quot;</pre>
<pre>
#include &lt;openssl/crypto.h&gt;</pre>
<pre>
unsigned int OPENSSL_version_major(void);
unsigned int OPENSSL_version_minor(void);
unsigned int OPENSSL_version_patch(void);
const char *OPENSSL_version_pre_release(void);
const char *OPENSSL_version_build_metadata(void);</pre>
<pre>
const char *OpenSSL_version(int t);</pre>
<pre>
const char *OPENSSL_info(int t);</pre>
<p>Deprecated:</p>
<pre>
/* from openssl/opensslv.h */
#define OPENSSL_VERSION_NUMBER 0xnnnnnnnnnL</pre>
<pre>
/* from openssl/crypto.h */
unsigned long OpenSSL_version_num();</pre>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>
</p>
<h2><a name="macros">Macros</a></h2>
<p>The three macros <strong>OPENSSL_VERSION_MAJOR</strong>, <strong>OPENSSL_VERSION_MINOR</strong> and
<strong>OPENSSL_VERSION_PATCH</strong> represent the three parts of a version
identifier, <strong><em>MAJOR</em>.<em>MINOR</em>.<em>PATCH</em></strong>.</p>
<p>The macro <strong>OPENSSL_VERSION_PRE_RELEASE</strong> is an added bit of text that
indicates that this is a pre-release version, such as <code>&quot;-dev&quot;</code> for an
ongoing development snapshot or <code>&quot;-alpha3&quot;</code> for an alpha release.
The value must be a string.</p>
<p>The macro <strong>OPENSSL_VERSION_BUILD_METADATA</strong> is extra information, reserved
for other parties, such as <code>&quot;+fips&quot;</code>, or <code>&quot;+vendor.1&quot;</code>).
The OpenSSL project will not touch this macro (will leave it an empty string).
The value must be a string.</p>
<p><strong>OPENSSL_VERSION_STR</strong> is a convenience macro to get the short version
identifier string, <code>&quot;MAJOR.MINOR.PATCH&quot;</code>.</p>
<p><strong>OPENSSL_FULL_VERSION_STR</strong> is a convenience macro to get the longer
version identifier string, which combines <strong>OPENSSL_VERSION_STR</strong>,
<strong>OPENSSL_VERSION_PRE_RELEASE</strong> and <strong>OPENSSL_VERSION_BUILD_METADATA</strong>.</p>
<p><strong>OPENSSL_VERSION_TEXT</strong> is a convenience macro to get a full descriptive
version text, which includes <strong>OPENSSL_FULL_VERSION_STR</strong> and the release
date.</p>
<p>
</p>
<h2><a name="functions">Functions</a></h2>
<p><code>OPENSSL_version_major()</code>, <code>OPENSSL_version_minor()</code>, <code>OPENSSL_version_patch()</code>,
<code>OPENSSL_version_pre_release()</code>, and <code>OPENSSL_version_build_metadata()</code> return
the values of the macros above for the build of the library, respectively.</p>
<p><code>OpenSSL_version()</code> returns different strings depending on <em>t</em>:</p>
<dl>
<dt><strong><a name="openssl_version" class="item">OPENSSL_VERSION</a></strong></dt>
<dd>
<p>The value of <strong>OPENSSL_VERSION_TEXT</strong></p>
</dd>
<dt><strong><a name="openssl_version_string" class="item">OPENSSL_VERSION_STRING</a></strong></dt>
<dd>
<p>The value of <strong>OPENSSL_VERSION_STR</strong></p>
</dd>
<dt><strong><a name="openssl_full_version_string" class="item">OPENSSL_FULL_VERSION_STRING</a></strong></dt>
<dd>
<p>The value of <strong>OPENSSL_FULL_VERSION_STR</strong></p>
</dd>
<dt><strong><a name="openssl_cflags" class="item">OPENSSL_CFLAGS</a></strong></dt>
<dd>
<p>The compiler flags set for the compilation process in the form
<code>compiler: ...</code> if available, or <code>compiler: information not available</code>
otherwise.</p>
</dd>
<dt><strong><a name="openssl_built_on" class="item">OPENSSL_BUILT_ON</a></strong></dt>
<dd>
<p>The date of the build process in the form <code>built on: ...</code> if available
or <code>built on: date not available</code> otherwise.
The date would not be available in a reproducible build, for example.</p>
</dd>
<dt><strong><a name="openssl_platform" class="item">OPENSSL_PLATFORM</a></strong></dt>
<dd>
<p>The &quot;Configure&quot; target of the library build in the form <code>platform: ...</code>
if available, or <code>platform: information not available</code> otherwise.</p>
</dd>
<dt><strong><a name="openssl_dir" class="item">OPENSSL_DIR</a></strong></dt>
<dd>
<p>The <strong>OPENSSLDIR</strong> setting of the library build in the form <code>OPENSSLDIR: &quot;...&quot;</code>
if available, or <code>OPENSSLDIR: N/A</code> otherwise.</p>
</dd>
<dt><strong><a name="openssl_engines_dir" class="item">OPENSSL_ENGINES_DIR</a></strong></dt>
<dd>
<p>The <strong>ENGINESDIR</strong> setting of the library build in the form <code>ENGINESDIR: &quot;...&quot;</code>
if available, or <code>ENGINESDIR: N/A</code> otherwise.</p>
</dd>
<dt><strong><a name="openssl_modules_dir" class="item">OPENSSL_MODULES_DIR</a></strong></dt>
<dd>
<p>The <strong>MODULESDIR</strong> setting of the library build in the form <code>MODULESDIR: &quot;...&quot;</code>
if available, or <code>MODULESDIR: N/A</code> otherwise.</p>
</dd>
<dt><strong><a name="openssl_cpu_info" class="item">OPENSSL_CPU_INFO</a></strong></dt>
<dd>
<p>The current OpenSSL cpu settings.
This is the current setting of the cpu capability flags. It is usually
automatically configured but may be set via an environment variable.
The value has the same syntax as the environment variable.
For x86 the string looks like <code>CPUINFO: OPENSSL_ia32cap=0x123:0x456</code>
or <code>CPUINFO: N/A</code> if not available.</p>
</dd>
</dl>
<p>For an unknown <em>t</em>, the text <code>not available</code> is returned.</p>
<p><code>OPENSSL_info()</code> also returns different strings depending on <em>t</em>:</p>
<dl>
<dt><strong><a name="openssl_info_config_dir" class="item">OPENSSL_INFO_CONFIG_DIR</a></strong></dt>
<dd>
<p>The configured <code>OPENSSLDIR</code>, which is the default location for
OpenSSL configuration files.</p>
</dd>
<dt><strong><a name="openssl_info_engines_dir" class="item">OPENSSL_INFO_ENGINES_DIR</a></strong></dt>
<dd>
<p>The configured <code>ENGINESDIR</code>, which is the default location for
OpenSSL engines.</p>
</dd>
<dt><strong><a name="openssl_info_modules_dir" class="item">OPENSSL_INFO_MODULES_DIR</a></strong></dt>
<dd>
<p>The configured <code>MODULESDIR</code>, which is the default location for
dynamically loadable OpenSSL modules other than engines.</p>
</dd>
<dt><strong><a name="openssl_info_dso_extension" class="item">OPENSSL_INFO_DSO_EXTENSION</a></strong></dt>
<dd>
<p>The configured dynamically loadable module extension.</p>
</dd>
<dt><strong><a name="openssl_info_dir_filename_separator" class="item">OPENSSL_INFO_DIR_FILENAME_SEPARATOR</a></strong></dt>
<dd>
<p>The separator between a directory specification and a filename.
Note that on some operating systems, this is not the same as the
separator between directory elements.</p>
</dd>
<dt><strong><a name="openssl_info_list_separator" class="item">OPENSSL_INFO_LIST_SEPARATOR</a></strong></dt>
<dd>
<p>The OpenSSL list separator.
This is typically used in strings that are lists of items, such as the
value of the environment variable <code>$PATH</code> on Unix (where the
separator is <code>:</code>) or <code>%PATH%</code> on Windows (where the separator is
<code>;</code>).</p>
</dd>
<dt><strong><a name="openssl_info_cpu_settings" class="item">OPENSSL_INFO_CPU_SETTINGS</a></strong></dt>
<dd>
<p>The current OpenSSL cpu settings.
This is the current setting of the cpu capability flags. It is usually
automatically configured but may be set via an environment variable.
The value has the same syntax as the environment variable.
For x86 the string looks like <code>OPENSSL_ia32cap=0x123:0x456</code>.</p>
</dd>
</dl>
<p>For an unknown <em>t</em>, NULL is returned.</p>
<p>
</p>
<hr />
<h1><a name="backward_compatibility">BACKWARD COMPATIBILITY</a></h1>
<p>For compatibility, some older macros and functions are retained or
synthesised.
They are all considered deprecated.</p>
<p>
</p>
<h2><a name="macros">Macros</a></h2>
<p><strong>OPENSSL_VERSION_NUMBER</strong> is a combination of the major, minor and
patch version into a single integer 0xMNN00PP0L, where:</p>
<dl>
<dt><strong><a name="m" class="item">M</a></strong></dt>
<dd>
<p>is the number from <strong>OPENSSL_VERSION_MAJOR</strong>, in hexadecimal notation</p>
</dd>
<dt><strong><a name="nn" class="item">NN</a></strong></dt>
<dd>
<p>is the number from <strong>OPENSSL_VERSION_MINOR</strong>, in hexadecimal notation</p>
</dd>
<dt><strong><a name="pp" class="item">PP</a></strong></dt>
<dd>
<p>is the number from <strong>OPENSSL_VERSION_PATCH</strong>, in hexadecimal notation</p>
</dd>
</dl>
<p>
</p>
<h2><a name="functions">Functions</a></h2>
<p><code>OpenSSL_version_num()</code> returns the value of <strong>OPENSSL_VERSION_NUMBER</strong>.</p>
<p>
</p>
<hr />
<h1><a name="return_values">RETURN VALUES</a></h1>
<p><code>OPENSSL_version_major()</code>, <code>OPENSSL_version_minor()</code> and <code>OPENSSL_version_patch()</code>
return the version number parts as integers.</p>
<p><code>OPENSSL_version_pre_release()</code> and <code>OPENSSL_version_build_metadata()</code> return
the values of <strong>OPENSSL_VERSION_PRE_RELEASE</strong> and
<strong>OPENSSL_VERSION_BUILD_METADATA</strong> respectively as constant strings.
For any of them that is undefined, the empty string is returned.</p>
<p><code>OpenSSL_version()</code> returns constant strings.</p>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p><em>crypto(7)</em></p>
<p>
</p>
<hr />
<h1><a name="history">HISTORY</a></h1>
<p>The macros and functions described here were added in OpenSSL 3.0,
with the exception of the <a href="#backward_compatibility">BACKWARD COMPATIBILITY</a> ones.</p>
<p>
</p>
<hr />
<h1><a name="copyright">COPYRIGHT</a></h1>
<p>Copyright 2018-2019 The OpenSSL Project Authors. All Rights Reserved.</p>
<p>Licensed under the Apache License 2.0 (the &quot;License&quot;). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
<a href="https://www.openssl.org/source/license.html">https://www.openssl.org/source/license.html</a>.</p>
</body>
</html>