<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openssl.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Matt</id>
	<title>OpenSSLWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openssl.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Matt"/>
	<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php/Special:Contributions/Matt"/>
	<updated>2026-05-28T23:00:13Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.13</generator>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=FIPS_mode_and_TLS&amp;diff=3229</id>
		<title>FIPS mode and TLS</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=FIPS_mode_and_TLS&amp;diff=3229"/>
		<updated>2024-02-02T08:32:31Z</updated>

		<summary type="html">&lt;p&gt;Matt: Added sentence about the new FIPS module&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page discusses the use of FIPS with OpenSSL 1.0.x. It is NOT relevant to the FIPS provider in OpenSSL 3.0 or above.&lt;br /&gt;
&lt;br /&gt;
The new SP800-131A and FIPS 186-4 restrictions on algorithms and key sizes complicate&lt;br /&gt;
the use of ciphersuites for TLS considerably. This page is intended to answer the&lt;br /&gt;
question &amp;quot;can I configure an OpenSSL cipherstring for TLS to comply with the new FIPS restrictions?&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
This discussion assumes use of a &amp;quot;FIPS capable&amp;quot; OpenSSL 1.0.1f or later.&lt;br /&gt;
&lt;br /&gt;
A new security framework in development for future versions will make enforcing these types&lt;br /&gt;
of restrictions easier and the algorithm restrictions are performed all in one place.&lt;br /&gt;
&lt;br /&gt;
== Quick Summary ==&lt;br /&gt;
&lt;br /&gt;
The preferred cipherstring for OpenSSL 1.0.1f+ for all versions of TLS subject to the new FIPS&lt;br /&gt;
restrictions is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	'TLSv1.2+FIPS:kRSA+FIPS:!eNULL:!aNULL'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
However, multiple caveats apply as discussed below.&lt;br /&gt;
&lt;br /&gt;
Workarounds for OpenSSL releases prior to 1.0.1f are discussed below.&lt;br /&gt;
&lt;br /&gt;
== Detailed discussion ==&lt;br /&gt;
&lt;br /&gt;
The general rule is you can't use SHA1 for digital signatures any more nor&lt;br /&gt;
a combination like MD5+SHA1. You *can* use SHA1 for HMAC so there's no need to&lt;br /&gt;
force the use of SHA256 HMAC ciphersuites.&lt;br /&gt;
&lt;br /&gt;
A cipherstring in OpenSSL also known as a &amp;quot;cipher list&amp;quot; &lt;br /&gt;
https://www.openssl.org/docs/apps/ciphers.html#CIPHER_STRINGS&lt;br /&gt;
A cipherstring in OpenSSL is a compact notation for a set of cryptographic algorithms&lt;br /&gt;
(public key, symmetric key, and digest algorithms) in order of preference.&lt;br /&gt;
&lt;br /&gt;
The cipherstring notation is discussed at https://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT&lt;br /&gt;
Briefly, a cipherstring is a series of elements each designating either a specific ciphersuite or a set of&lt;br /&gt;
ciphersuites. The &amp;quot;+&amp;quot; operator designates a logical and operation, so &amp;quot;element1+element1&amp;quot; represents that&lt;br /&gt;
set of ciphersuites containing the algorithms in both element1 and element2. The &amp;quot;!&amp;quot; operator permanently&lt;br /&gt;
all the algorithms in the following element.&lt;br /&gt;
&lt;br /&gt;
=== TLS 1.0 and 1.1 ===&lt;br /&gt;
&lt;br /&gt;
All TLS 1.0/1.1 authenticated PFS (Perfect Forward Secrecy) ciphersuites use SHA1 alone or MD5+SHA1. That&lt;br /&gt;
leaves only unauthenticated ones (which are vulnerable to MiTM so we discount&lt;br /&gt;
them) or those using static keys. Theoretically that would permit RSA, DH or&lt;br /&gt;
ECDH keys in certificates but in practice everyone uses RSA.&lt;br /&gt;
&lt;br /&gt;
The corresponding cipherstring is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
openssl ciphers -v 'kRSA+FIPS:!TLSv1.2'&lt;br /&gt;
AES256-SHA              SSLv3 Kx=RSA      Au=RSA  Enc=AES(256)  Mac=SHA1&lt;br /&gt;
DES-CBC3-SHA            SSLv3 Kx=RSA      Au=RSA  Enc=3DES(168) Mac=SHA1&lt;br /&gt;
AES128-SHA              SSLv3 Kx=RSA      Au=RSA  Enc=AES(128)  Mac=SHA1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
That cipherstring specifies three possible ciphersuites allowable in FIPS mode for TLS 1.0 and 1.1.&lt;br /&gt;
The RSA key in the certificate has to be of suitable size&lt;br /&gt;
(2048 bits minimum) as do all other keys in the chain and none of the CAs can&lt;br /&gt;
sign using SHA1. Also those kRSA ciphersuites are allowed for&lt;br /&gt;
server certificates only; client authentication is never allowed&lt;br /&gt;
with the new rules for TLS 1.0 and 1.1.&lt;br /&gt;
&lt;br /&gt;
In a real application when FIPS mode is enabled then only &lt;br /&gt;
FIPS ciphersuites are allowed no matter what you use in the string. So in FIPS mode&lt;br /&gt;
&amp;quot;kRSA:!TLSv1.2&amp;quot; will be functionally equivalent to &amp;quot;kRSA+FIPS!TLSv1.2&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note the &amp;quot;TLSv1.2&amp;quot; string was only added to OpenSSL recently, as of OpenSSL 1.0.1f.&lt;br /&gt;
It designates the ciphers for TLSv1.2 subject to the FIPS 140-2 and FIPS 186-4&lt;br /&gt;
restrictions.&lt;br /&gt;
&lt;br /&gt;
Note the cipherstring 'FIPS:!TLSv1.2' would also allow fixed DH and fixed ECDH&lt;br /&gt;
certificates but those are not encountered in the wild.&lt;br /&gt;
The key exchange component &amp;quot;kRSA&amp;quot; specifies just those algorithms that support RSA key exchange.&lt;br /&gt;
&lt;br /&gt;
=== TLS 1.2 ===&lt;br /&gt;
&lt;br /&gt;
TLS 1.2 provides more options as the signature can use an algorithm other&lt;br /&gt;
than SHA1. &lt;br /&gt;
&amp;quot;kRSA+FIPS&amp;quot; specifies those ciphersuites that use RSA key exchange, including TLS v1.2, *and*&lt;br /&gt;
are allowed in FIPS mode, and including anonymous ones which may be undesirable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
openssl ciphers -v 'kRSA+FIPS'&lt;br /&gt;
AES256-GCM-SHA384       TLSv1.2 Kx=RSA      Au=RSA  Enc=AESGCM(256) Mac=AEAD&lt;br /&gt;
AES256-SHA256           TLSv1.2 Kx=RSA      Au=RSA  Enc=AES(256)  Mac=SHA256&lt;br /&gt;
AES256-SHA              SSLv3 Kx=RSA        Au=RSA  Enc=AES(256)  Mac=SHA1&lt;br /&gt;
DES-CBC3-SHA            SSLv3 Kx=RSA        Au=RSA  Enc=3DES(168) Mac=SHA1&lt;br /&gt;
AES128-GCM-SHA256       TLSv1.2 Kx=RSA      Au=RSA  Enc=AESGCM(128) Mac=AEAD&lt;br /&gt;
AES128-SHA256           TLSv1.2 Kx=RSA      Au=RSA  Enc=AES(128)  Mac=SHA256&lt;br /&gt;
AES128-SHA              SSLv3 Kx=RSA        Au=RSA  Enc=AES(128)  Mac=SHA1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The ephemeral key for the now permitted PFS keys must be at least 2048 bits (DH)&lt;br /&gt;
or 256 bits (ECDH) in size. Anything supporting ECDH will probably set P-256 as&lt;br /&gt;
a default so that should be OK (Apache does).&lt;br /&gt;
&lt;br /&gt;
There's a snag though. The ciphersuite ECDH-RSA-AES128-SHA can (outside FIPS) be&lt;br /&gt;
used for TLS 1.0 and later whereas in FIPS mode it can only be used for TLS v1.2. A&lt;br /&gt;
TLS client can't advertise ciphersuites in that way (i.e. you can use this for&lt;br /&gt;
TLS1.2 only and nothing earlier) so you're left with the situation where a FIPS&lt;br /&gt;
compliant client might say it wants ECDH-RSA-AES128-SHA&lt;br /&gt;
and TLS 1.2 and the server only supports TLS 1.0 so it will choke when it tries to&lt;br /&gt;
use the prohibited ciphersuite+version combination. Servers are fine because&lt;br /&gt;
they can theoretically select based on version (except in practice OpenSSL doesn't support that).&lt;br /&gt;
&lt;br /&gt;
If that wasn't enough there's another complication. For TLS v1.2 you have to&lt;br /&gt;
restrict the supported signature algorithms to exclude SHA1, allowing only&lt;br /&gt;
SHA256 and above. There is no way to do that in OpenSSL 1.0.1 clients.&lt;br /&gt;
Similarly the supported EC curves have to be restricted to exclude some which are&lt;br /&gt;
of insufficient field size.&lt;br /&gt;
&lt;br /&gt;
In summary: it's a bloody mess.&lt;br /&gt;
&lt;br /&gt;
The list of allowable ciphers for all versions of TLS, 1.0/1/1/1.2 is 'TLSv1.2:kRSA'&lt;br /&gt;
which includes those with no encryption or no authentication which are generally&lt;br /&gt;
undesirable and should be excluded.  In full with explicit &amp;quot;+FIPS&amp;quot; qualification that becomes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
'TLSv1.2+FIPS:kRSA+FIPS:!eNULL:!aNULL'&lt;br /&gt;
ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH        Au=RSA  Enc=AESGCM(256) Mac=AEAD&lt;br /&gt;
ECDHE-ECDSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH      Au=ECDSA Enc=AESGCM(256) Mac=AEAD&lt;br /&gt;
ECDHE-RSA-AES256-SHA384 TLSv1.2 Kx=ECDH            Au=RSA  Enc=AES(256)  Mac=SHA384&lt;br /&gt;
ECDHE-ECDSA-AES256-SHA384 TLSv1.2 Kx=ECDH          Au=ECDSA Enc=AES(256)  Mac=SHA384&lt;br /&gt;
DHE-DSS-AES256-GCM-SHA384 TLSv1.2 Kx=DH            Au=DSS  Enc=AESGCM(256) Mac=AEAD&lt;br /&gt;
DHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=DH            Au=RSA  Enc=AESGCM(256) Mac=AEAD&lt;br /&gt;
DHE-RSA-AES256-SHA256   TLSv1.2 Kx=DH              Au=RSA  Enc=AES(256)  Mac=SHA256&lt;br /&gt;
DHE-DSS-AES256-SHA256   TLSv1.2 Kx=DH              Au=DSS  Enc=AES(256)  Mac=SHA256&lt;br /&gt;
ECDH-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH/RSA     Au=ECDH Enc=AESGCM(256) Mac=AEAD&lt;br /&gt;
ECDH-ECDSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH/ECDSA Au=ECDH Enc=AESGCM(256) Mac=AEAD&lt;br /&gt;
ECDH-RSA-AES256-SHA384  TLSv1.2 Kx=ECDH/RSA        Au=ECDH Enc=AES(256)  Mac=SHA384&lt;br /&gt;
ECDH-ECDSA-AES256-SHA384 TLSv1.2 Kx=ECDH/ECDSA     Au=ECDH Enc=AES(256)  Mac=SHA384&lt;br /&gt;
AES256-GCM-SHA384       TLSv1.2 Kx=RSA             Au=RSA  Enc=AESGCM(256) Mac=AEAD&lt;br /&gt;
AES256-SHA256           TLSv1.2 Kx=RSA             Au=RSA  Enc=AES(256)  Mac=SHA256&lt;br /&gt;
ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH        Au=RSA  Enc=AESGCM(128) Mac=AEAD&lt;br /&gt;
ECDHE-ECDSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH      Au=ECDSA Enc=AESGCM(128) Mac=AEAD&lt;br /&gt;
ECDHE-RSA-AES128-SHA256 TLSv1.2 Kx=ECDH            Au=RSA  Enc=AES(128)  Mac=SHA256&lt;br /&gt;
ECDHE-ECDSA-AES128-SHA256 TLSv1.2 Kx=ECDH          Au=ECDSA Enc=AES(128)  Mac=SHA256&lt;br /&gt;
DHE-DSS-AES128-GCM-SHA256 TLSv1.2 Kx=DH            Au=DSS  Enc=AESGCM(128) Mac=AEAD&lt;br /&gt;
DHE-RSA-AES128-GCM-SHA256 TLSv1.2 Kx=DH            Au=RSA  Enc=AESGCM(128) Mac=AEAD&lt;br /&gt;
DHE-RSA-AES128-SHA256   TLSv1.2 Kx=DH              Au=RSA  Enc=AES(128)  Mac=SHA256&lt;br /&gt;
DHE-DSS-AES128-SHA256   TLSv1.2 Kx=DH              Au=DSS  Enc=AES(128)  Mac=SHA256&lt;br /&gt;
ECDH-RSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH/RSA     Au=ECDH Enc=AESGCM(128) Mac=AEAD&lt;br /&gt;
ECDH-ECDSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH/ECDSA Au=ECDH Enc=AESGCM(128) Mac=AEAD&lt;br /&gt;
ECDH-RSA-AES128-SHA256  TLSv1.2 Kx=ECDH/RSA        Au=ECDH Enc=AES(128)  Mac=SHA256&lt;br /&gt;
ECDH-ECDSA-AES128-SHA256 TLSv1.2 Kx=ECDH/ECDSA     Au=ECDH Enc=AES(128)  Mac=SHA256&lt;br /&gt;
AES128-GCM-SHA256       TLSv1.2 Kx=RSA             Au=RSA  Enc=AESGCM(128) Mac=AEAD&lt;br /&gt;
AES128-SHA256           TLSv1.2 Kx=RSA             Au=RSA  Enc=AES(128)  Mac=SHA256&lt;br /&gt;
AES256-SHA              SSLv3 Kx=RSA               Au=RSA  Enc=AES(256)  Mac=SHA1&lt;br /&gt;
DES-CBC3-SHA            SSLv3 Kx=RSA               Au=RSA  Enc=3DES(168) Mac=SHA1&lt;br /&gt;
AES128-SHA              SSLv3 Kx=RSA               Au=RSA  Enc=AES(128)  Mac=SHA1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
What does this ciphersuite specification mean in practice?&lt;br /&gt;
&lt;br /&gt;
If the peer supports TLS v1.2 it will use a TLS v1.2 ciphersuite which is FIPS&lt;br /&gt;
186-4 compliant (with the curve and signature restrictions I mentioned) or&lt;br /&gt;
non-PFS RSA otherwise.&lt;br /&gt;
&lt;br /&gt;
If the peer only supports TLS 1.1 or 1.0 it will fall back to the non-PFS RSA&lt;br /&gt;
ciphersuites which again will be FIPS 186-4 compliant subject to the silly key&lt;br /&gt;
and certificate signing restrictions.&lt;br /&gt;
&lt;br /&gt;
The ciphersuite (for 1.0.1f+) of 'TLSv1.2+FIPS:kRSA+FIPS:!eNULL:!aNULL'&lt;br /&gt;
will satisfy FIPS 186-4 for any version of TLS 1.0/1.1/1.2 with caveats as noted.&lt;br /&gt;
&lt;br /&gt;
To specify a list of allowable ciphers for TLS 1.0/1.1 only append !TLSv1.2 which permanently deletes&lt;br /&gt;
those which are only usable for TLS v1.2, giving 'kRSA+FIPS:!TLSv1.2'.&lt;br /&gt;
&lt;br /&gt;
=== Cipherstrings ===&lt;br /&gt;
&lt;br /&gt;
Commentary on what the cipherstrings components mean and their relevance:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;TLSv1.2&amp;quot;: list of ciphersuites only allowed for TLS 1.2. This means if TLS 1.2&lt;br /&gt;
is negotiated they can be used and if not they won't. They also happen to be&lt;br /&gt;
permitted by FIPS 186-4 because TLS 1.2 can use signature algorithms stronger&lt;br /&gt;
that SHA1. That means that it is &amp;quot;safe&amp;quot; to include this in a cipher string&lt;br /&gt;
because (a) they are compliant with FIPS 186-4 in for TLS 1.2 and (b) they can&lt;br /&gt;
never be used for TLS 1.1 or 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;kRSA&amp;quot;: list of ciphersuites which support RSA key exchange. Because TLS 1.1 and&lt;br /&gt;
1.0 can only use SHA1+MD5 in signatures these are the only ones allowed because&lt;br /&gt;
they don't use signatures.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;FIPS&amp;quot;: list of ciphersuites allowed in FIPS mode excluding those offering no&lt;br /&gt;
encryption. This is for informational purposes only because if you *are* in FIPS&lt;br /&gt;
mode you can only use those ciphersuites anyway (but including the no encryption&lt;br /&gt;
ones).&lt;br /&gt;
&lt;br /&gt;
The lists above all include ciphersuites which you wouldn't normally use: no&lt;br /&gt;
encryption or no authentication. So those need to be disabled. This is done by&lt;br /&gt;
appending '!eNULL:!aNULL': this means &amp;quot;disable any ciphersuites present which&lt;br /&gt;
include no encryption or authentication&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
So combining these we get the following cipher string in FIPS mode:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	'TLSv1.2:kRSA:!eNULL:!aNULL'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
which with the functionally redundant &amp;quot;+FIPS&amp;quot; qualifiers is equivant to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	'TLSv1.2+FIPS:kRSA+FIPS:!eNULL:!aNULL'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Without the &amp;quot;+FIPS&amp;quot; qualifiers and outside FIPS mode you'll will see weak export grade&lt;br /&gt;
ciphersuites which would be disabled in FIPS mode. Those can be seen with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	openssl ciphers -v 'TLSv1.2:kRSA:!eNULL:!aNULL'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To see the actual set of ciphersuites in FIPS mode, without the explicit &amp;quot;+FIPS&amp;quot; qualifiers,&lt;br /&gt;
do:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	OPENSSL_FIPS=1 openssl ciphers -v 'TLSv1.2:kRSA:!eNULL:!aNULL'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
So in summary &amp;quot;in FIPS mode use the cipherstring 'TLSv1.2:kRSA:!eNULL:!aNULL'&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note this important disclaimer though: This cipherstring *only* restricts the ciphersuites to those&lt;br /&gt;
not explicitly excluded by FIPS 186-4. There are other conditions which must be&lt;br /&gt;
enforced such as key size, permitted curves and permitted signature algorithms.&lt;br /&gt;
Just because a ciphersuite has been negotiated in this range does not guaranteed&lt;br /&gt;
compliance.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;FIPS capable&amp;quot; OpenSSL does not currently provide a means to automatically enforce the&lt;br /&gt;
new FIPS 186-4 restrictions.&lt;br /&gt;
&lt;br /&gt;
=== A quick overview of TLS ===&lt;br /&gt;
&lt;br /&gt;
The primary purpose of the handshake is to enable both peers to securely obtain&lt;br /&gt;
a shared secret value called the pre-master secret. They then use that to&lt;br /&gt;
generate session keys (encryption and MAC) which are used for the exchange of&lt;br /&gt;
actual application data. The handshake is the only place public key algorithms&lt;br /&gt;
are used.&lt;br /&gt;
&lt;br /&gt;
In the case of PFS ciphersuites both ends generate a temporary key (ECDH or DH)&lt;br /&gt;
and exchange the public bits with each other. They use the algorithm to generate&lt;br /&gt;
the shared DH/ECDH secret value which is used later on. The new FIPS restrictions interfere with&lt;br /&gt;
this because those keys have to be large enough. For ECDH an extension can be&lt;br /&gt;
used to ensure this. For DH you just have to hope the server has a big enough&lt;br /&gt;
key and abort if not.&lt;br /&gt;
&lt;br /&gt;
For anonymous algorithms that's all you get. They are vulnerable to man in the&lt;br /&gt;
middle (MitM) attacks and so are rarely used.&lt;br /&gt;
&lt;br /&gt;
In the real world algorithms include authentication. In those the server digitally&lt;br /&gt;
signs its ECDH or DH key using the key in its certificate. This is to ensure the&lt;br /&gt;
temporary ECDH or DH key can't be forged. It is that digital signature that is&lt;br /&gt;
important here and the one which the new FIPS restrictions disrupt.&lt;br /&gt;
&lt;br /&gt;
How that temporary key is signed depends on the cipher suite and the key in the&lt;br /&gt;
server's certificate. The whole process is called server authentication.&lt;br /&gt;
&lt;br /&gt;
In the case of TLS 1.0 and 1.1 that signature uses a MD5+SHA1 hybrid for RSA&lt;br /&gt;
keys and just SHA1 for DSA and ECDSA. That's why PFS is prohibited by the new FIPS&lt;br /&gt;
rules: there is no option but to use SHA1.&lt;br /&gt;
&lt;br /&gt;
In the case of TLS 1.2 any valid combination can be used and the MD5+SHA1 hybrid is no&lt;br /&gt;
longer present for RSA. RSA just uses the same signature format that&lt;br /&gt;
certificates use (PKCS#1).&lt;br /&gt;
&lt;br /&gt;
For TLS 1.2 the client sends the set of signature algorithms it supports in&lt;br /&gt;
preference order in the supported signature algorithms extensions. The server&lt;br /&gt;
then selects one and uses that for that signature. For new FIPS it would just&lt;br /&gt;
use SHA256 as a minimum or abort the connection if the client only supported&lt;br /&gt;
SHA1 (unlikely).&lt;br /&gt;
&lt;br /&gt;
Client authentication in TLS is a secondary concern. In this case the client&lt;br /&gt;
signs some data related to the handshake and sends the result back. The server&lt;br /&gt;
then checks that signature.&lt;br /&gt;
&lt;br /&gt;
As with server authentication TLS 1.1/1.0 has to use either MD5+SHA1 for RSA or&lt;br /&gt;
just SHA1 for other algorithms. So client authentication violates the new FIPS&lt;br /&gt;
restrictions and cannot be used for TLs 1.0/1.1.&lt;br /&gt;
&lt;br /&gt;
TLS 1.2 removes the restriction to SHA1. In this case the server sends back the&lt;br /&gt;
algorithms it supports and the client selects one. Again SHA256 or&lt;br /&gt;
better s needed to comply with new FIPS restrictions.&lt;br /&gt;
&lt;br /&gt;
Next consider the non-PFS case. We consider RSA&lt;br /&gt;
key exchange only as is the only practical option. This is completely different from PFS. In&lt;br /&gt;
this case the client generates the pre master secret and encrypts it using the&lt;br /&gt;
servers key. The server decrypts it and then uses that to complete the&lt;br /&gt;
handshake. No additional signing is used here so no place for SHA1 to be used.&lt;br /&gt;
The server is authenticated because if it didn't have the right key it couldn't&lt;br /&gt;
decrypt the pre-master secret. It's a bit unusual in that authentication (which&lt;br /&gt;
is normally associated with signatures) is performed using an RSA decryption&lt;br /&gt;
operation.&lt;br /&gt;
&lt;br /&gt;
Some further discussion in case that wasn't confusing enough:&lt;br /&gt;
&lt;br /&gt;
Some people say that it is implied that TLS 1.1 and 1.0 must use SHA1 in&lt;br /&gt;
digital signatures in all certificates. If so then&lt;br /&gt;
TLS 1.1 and 1.0 can never be compliant with new FIPS.&lt;br /&gt;
&lt;br /&gt;
Assuming that is not true, what does it mean in practice? A&lt;br /&gt;
a public webserver would require a certificate signed by CAs that&lt;br /&gt;
use SHA256 minimum and large enough keys. Not a trivial&lt;br /&gt;
task in itself.&lt;br /&gt;
&lt;br /&gt;
Aside from that, problems will be encountered if your server needs to use anything&lt;br /&gt;
outside of the new FIPS restrictions (e.g. to talk to other&lt;br /&gt;
clients). Some older browsers (e.g. IE on XP is one which is&lt;br /&gt;
still very common) don't support SHA2 at all. So they'll fail when they talk to&lt;br /&gt;
that server because the can't verify the signatures.&lt;br /&gt;
&lt;br /&gt;
TLS 1.2 is a bit better, at least in theory. The supported signatures should apply to the&lt;br /&gt;
whole certificate chain. So a client advertising only SHA1+RSA receive a&lt;br /&gt;
chain supporting SHA1+RSA only (if the  server has one) and a client supporting SHA256+RSA&lt;br /&gt;
will receive a &amp;quot;new FIPS&amp;quot; friendly chain.&lt;br /&gt;
&lt;br /&gt;
However, in practice that requirement is generally ignored and implementations serve up whatever&lt;br /&gt;
chain is configured regardless of signature algorithms sent by the client&lt;br /&gt;
because many implementers consider that a slly restriction. For interoperability OpenSSL is&lt;br /&gt;
similarly lax if a &amp;quot;strict&amp;quot; option isn't set. In fact configuring multiple&lt;br /&gt;
chains like that can't be directly done in OpenSSL without application support&lt;br /&gt;
which nothing other than s_server can currently handle.&lt;br /&gt;
&lt;br /&gt;
==== Digests in TLS ====&lt;br /&gt;
&lt;br /&gt;
There are different purposes that digest algorithms are put to.&lt;br /&gt;
&lt;br /&gt;
In TLS 1.2 something called the supported signature algorithms extension&lt;br /&gt;
determines the supported digests as a public key + algorithm pair. It's that&lt;br /&gt;
usage that FIPS 186-4 (and SP800-57) has an impact on. So you can't use RSA+SHA1&lt;br /&gt;
any more. For digital signatures the strength of SHA1 is at most 80 bits: it can&lt;br /&gt;
be less with a weak key.&lt;br /&gt;
&lt;br /&gt;
That digital signature is used to maintain the integrity of the handshake&lt;br /&gt;
messages and certificate chains in PFS ciphersuites: basically server and client&lt;br /&gt;
authentication.&lt;br /&gt;
&lt;br /&gt;
For TLS 1.2 you can specify any digest to be used to maintain handshake&lt;br /&gt;
integrity for digital signatures: for TLS 1.1 and below you could only use&lt;br /&gt;
SHA1+MD5. It's that reason why PFS ciphersuites are banned in TLS 1.1 and below.&lt;br /&gt;
&lt;br /&gt;
Digests use HMAC. For HMAC use the key strength is the digest length so SHA1 is 160 bits.&lt;br /&gt;
&lt;br /&gt;
Before TLS 1.2 all cipher suites used SHA1 HMAC (or in legacy cases MD5) for the&lt;br /&gt;
HMAC.&lt;br /&gt;
&lt;br /&gt;
TLS 1.2 introduced some ciphersuites which used SHA256 and SHA384 for the HMAC&lt;br /&gt;
and the AEAD ones like AES-GCM which have a mac as part of the algorithm itself.&lt;br /&gt;
&lt;br /&gt;
Note that TLS 1.2 also permits all the ciphersuites for TLS 1.1, 1.0 too.&lt;br /&gt;
For details see Table 2 and 3 in SP800-57.&lt;br /&gt;
&lt;br /&gt;
Those tables make a lot more sense when you realise for digital signatures it's&lt;br /&gt;
half the digest size. So SHA1 is 20 bytes which is 160 bits and so 80 bits of&lt;br /&gt;
strength so it only appears in the &amp;quot;80 bits&amp;quot; box for digital signatures. Whereas&lt;br /&gt;
for other uses it is the full digest size so SHA1 appears in the 80, 112 and 128&lt;br /&gt;
bit boxes.&lt;br /&gt;
&lt;br /&gt;
Unfortunately the FIPS terminology unnecessarily obfuscated the issue. It would&lt;br /&gt;
have been easier to just say in SP800-57 that SHA1 HMAC is 160 bits&lt;br /&gt;
of equivalent security instead of placing it in the :Security Strenght 128&amp;quot; row&lt;br /&gt;
of Table 3. &lt;br /&gt;
&lt;br /&gt;
TLS 1.2 can use SHA1 in two different places. One is the signature algorithms on&lt;br /&gt;
certificates: i.e. the algorithm the CA signs with. The second place is&lt;br /&gt;
temporary key signature (server authentication) as described below.&lt;br /&gt;
&lt;br /&gt;
==== Digital Signatures in TLS ====&lt;br /&gt;
&lt;br /&gt;
There are three places digital signatures are used in TLS.&lt;br /&gt;
&lt;br /&gt;
1. The signatures on certificates.&lt;br /&gt;
&lt;br /&gt;
The certificates' signatures are set by the CA so to comply with new FIPS&lt;br /&gt;
whatever else you do you need a certificate chain that uses SHA256 at least.&lt;br /&gt;
&lt;br /&gt;
2. Server Key Exchange.&lt;br /&gt;
&lt;br /&gt;
The Server Key Exchange message contains a signature in any authenticated PFS&lt;br /&gt;
ciphersuite. The algorithm used depends on the version of TLS.&lt;br /&gt;
&lt;br /&gt;
For TLS 1.1 and 1.0 the algorithm is either a MD5+SHA1 hybrid (RSA) or SHA1&lt;br /&gt;
(DSA, ECDSA). Both of these are prohibited by new FIPS so TLS 1.1 and 1.0&lt;br /&gt;
authenticated PFS ciphersuites are not allowed.&lt;br /&gt;
&lt;br /&gt;
For TLS 1.2 any appropriate algorithm can be used to sign Server Key Exchange&lt;br /&gt;
messages. So PFS authenticated ciphersuites *are* allowed under new FIPS as long&lt;br /&gt;
as SHA1 is not used to sign Server Key Exchange. MD5 is of course a double no-no.&lt;br /&gt;
&lt;br /&gt;
3. Certificate Verify.&lt;br /&gt;
&lt;br /&gt;
The Certificate Verify message is used whenever client authentication is enabled&lt;br /&gt;
for any applicable ciphersuite (not just PFS). The same digest algorithms are&lt;br /&gt;
used as Server Key Exchange.&lt;br /&gt;
&lt;br /&gt;
Therefore new FIPS and TLS 1.1 and 1.0 prohibits client authentication outright&lt;br /&gt;
in *any* ciphersuite.&lt;br /&gt;
&lt;br /&gt;
TLS 1.2 is more flexible and can use any appropriate algorithm so client&lt;br /&gt;
authentication is permitted as long as SHA1 and MD5 are not used.&lt;br /&gt;
&lt;br /&gt;
=== What about versions of OpenSSL prior to 1.0.1f? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;TLSv1.2&amp;quot; ciphersuite designation was added at 1.0.1f. For earlier versions of&lt;br /&gt;
OpenSSL the current equivalent of the cipherstring&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	'TLSv1.2:kRSA:!eNULL:!aNULL'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
can be &amp;quot;brute forced&amp;quot; as the unwieldy&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:DHE-DSS-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA256:ADH-AES256-GCM-SHA384:ADH-AES256-SHA256:ECDH-RSA-AES256-GCM-SHA384:ECDH-ECDSA-AES256-GCM-SHA384:ECDH-RSA-AES256-SHA384:ECDH-ECDSA-AES256-SHA384:AES256-GCM-SHA384:AES256-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:DHE-DSS-AES128-GCM-SHA256:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-SHA256:DHE-DSS-AES128-SHA256:ADH-AES128-GCM-SHA256:ADH-AES128-SHA256:ECDH-RSA-AES128-GCM-SHA256:ECDH-ECDSA-AES128-GCM-SHA256:ECDH-RSA-AES128-SHA256:ECDH-ECDSA-AES128-SHA256:AES128-GCM-SHA256:AES128-SHA256:NULL-SHA256:kRSA:!eNULL:!aNULL'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
However, as new ciphersuites get added to the 'TLSv1.2' ciphersuite that brute force&lt;br /&gt;
equivalent might end up not being&lt;br /&gt;
equivalent any more.&lt;br /&gt;
&lt;br /&gt;
Since TLSv1.2 only ciphers use SHA256, SHA384 and AES in GCM mode so one string is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	'AESGCM:SHA384:SHA256'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There are other ways to get the same effect. One is to disable any ciphers which&lt;br /&gt;
use SHA1. So &amp;quot;FIPS:-SHA&amp;quot; is currently equivalent to &amp;quot;FIPS+TLSv1.2&amp;quot;. The use of&lt;br /&gt;
the &amp;quot;-SHA&amp;quot; is necessary here because it only *temporarily* disables SHA1 MACs.&lt;br /&gt;
That means you can do: &amp;quot;FIPS:-SHA:FIPS+kRSA&amp;quot; to add back the RSA key exchange&lt;br /&gt;
ciphersuites that use SHA1. Contrast that with using &amp;quot;!SHA&amp;quot; instead which permanently&lt;br /&gt;
removes SHA1 from the cipherstring.&lt;br /&gt;
&lt;br /&gt;
[[Category:FIPS 140]]&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=Simple_TLS_Server&amp;diff=3221</id>
		<title>Simple TLS Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=Simple_TLS_Server&amp;diff=3221"/>
		<updated>2022-11-08T13:16:02Z</updated>

		<summary type="html">&lt;p&gt;Matt: Ignore broken pipe signals.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
You may find an up to date example within repository demos/sslecho.&lt;br /&gt;
&lt;br /&gt;
The code below is a complete implementation of a minimal TLS server. The first thing we do is create an ''SSL_CTX'' or SSL context. This is created using the ''TLS_server_method'' which creates a server that will negotiate the highest version of SSL/TLS supported by the client it is connecting to. The context is then configured by specifying the certificate and private key to use.&lt;br /&gt;
&lt;br /&gt;
Next we perform some normal socket programming and create a new server socket, there's nothing OpenSSL specific about this code. Whenever we get a new connection we call ''accept'' as normal. To handle the TLS we create a new ''SSL'' structure, this holds the information related to this particular connection. We use ''SSL_set_fd'' to tell openssl the file descriptor to use for the communication. In this example, we call ''SSL_accept'' to handle the server side of the TLS handshake, then use ''SSL_write()'' to send our message. Finally we clean up the various structures.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;&lt;br /&gt;
#include &amp;lt;sys/socket.h&amp;gt;&lt;br /&gt;
#include &amp;lt;arpa/inet.h&amp;gt;&lt;br /&gt;
#include &amp;lt;openssl/ssl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;openssl/err.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
int create_socket(int port)&lt;br /&gt;
{&lt;br /&gt;
    int s;&lt;br /&gt;
    struct sockaddr_in addr;&lt;br /&gt;
&lt;br /&gt;
    addr.sin_family = AF_INET;&lt;br /&gt;
    addr.sin_port = htons(port);&lt;br /&gt;
    addr.sin_addr.s_addr = htonl(INADDR_ANY);&lt;br /&gt;
&lt;br /&gt;
    s = socket(AF_INET, SOCK_STREAM, 0);&lt;br /&gt;
    if (s &amp;lt; 0) {&lt;br /&gt;
        perror(&amp;quot;Unable to create socket&amp;quot;);&lt;br /&gt;
        exit(EXIT_FAILURE);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (bind(s, (struct sockaddr*)&amp;amp;addr, sizeof(addr)) &amp;lt; 0) {&lt;br /&gt;
        perror(&amp;quot;Unable to bind&amp;quot;);&lt;br /&gt;
        exit(EXIT_FAILURE);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (listen(s, 1) &amp;lt; 0) {&lt;br /&gt;
        perror(&amp;quot;Unable to listen&amp;quot;);&lt;br /&gt;
        exit(EXIT_FAILURE);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return s;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
SSL_CTX *create_context()&lt;br /&gt;
{&lt;br /&gt;
    const SSL_METHOD *method;&lt;br /&gt;
    SSL_CTX *ctx;&lt;br /&gt;
&lt;br /&gt;
    method = TLS_server_method();&lt;br /&gt;
&lt;br /&gt;
    ctx = SSL_CTX_new(method);&lt;br /&gt;
    if (!ctx) {&lt;br /&gt;
        perror(&amp;quot;Unable to create SSL context&amp;quot;);&lt;br /&gt;
        ERR_print_errors_fp(stderr);&lt;br /&gt;
        exit(EXIT_FAILURE);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return ctx;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void configure_context(SSL_CTX *ctx)&lt;br /&gt;
{&lt;br /&gt;
    /* Set the key and cert */&lt;br /&gt;
    if (SSL_CTX_use_certificate_file(ctx, &amp;quot;cert.pem&amp;quot;, SSL_FILETYPE_PEM) &amp;lt;= 0) {&lt;br /&gt;
        ERR_print_errors_fp(stderr);&lt;br /&gt;
        exit(EXIT_FAILURE);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (SSL_CTX_use_PrivateKey_file(ctx, &amp;quot;key.pem&amp;quot;, SSL_FILETYPE_PEM) &amp;lt;= 0 ) {&lt;br /&gt;
        ERR_print_errors_fp(stderr);&lt;br /&gt;
        exit(EXIT_FAILURE);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char **argv)&lt;br /&gt;
{&lt;br /&gt;
    int sock;&lt;br /&gt;
    SSL_CTX *ctx;&lt;br /&gt;
&lt;br /&gt;
    /* Ignore broken pipe signals */&lt;br /&gt;
    signal(SIGPIPE, SIG_IGN);&lt;br /&gt;
&lt;br /&gt;
    ctx = create_context();&lt;br /&gt;
&lt;br /&gt;
    configure_context(ctx);&lt;br /&gt;
&lt;br /&gt;
    sock = create_socket(4433);&lt;br /&gt;
&lt;br /&gt;
    /* Handle connections */&lt;br /&gt;
    while(1) {&lt;br /&gt;
        struct sockaddr_in addr;&lt;br /&gt;
        unsigned int len = sizeof(addr);&lt;br /&gt;
        SSL *ssl;&lt;br /&gt;
        const char reply[] = &amp;quot;test\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
        int client = accept(sock, (struct sockaddr*)&amp;amp;addr, &amp;amp;len);&lt;br /&gt;
        if (client &amp;lt; 0) {&lt;br /&gt;
            perror(&amp;quot;Unable to accept&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        ssl = SSL_new(ctx);&lt;br /&gt;
        SSL_set_fd(ssl, client);&lt;br /&gt;
&lt;br /&gt;
        if (SSL_accept(ssl) &amp;lt;= 0) {&lt;br /&gt;
            ERR_print_errors_fp(stderr);&lt;br /&gt;
        } else {&lt;br /&gt;
            SSL_write(ssl, reply, strlen(reply));&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        SSL_shutdown(ssl);&lt;br /&gt;
        SSL_free(ssl);&lt;br /&gt;
        close(client);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    close(sock);&lt;br /&gt;
    SSL_CTX_free(ctx);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Session Reuse ==&lt;br /&gt;
&lt;br /&gt;
According to Viktor Dukhovni at [http://mta.openssl.org/pipermail/openssl-users/2016-September/004564.html Possible to control session reuse from the client]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; For performance testing purposes, I would like to turn off session&lt;br /&gt;
&amp;gt; reuse in the (homegrown) client I use for testing. Is there a function&lt;br /&gt;
&amp;gt; in the openssl library to do it?&lt;br /&gt;
&amp;gt; &lt;br /&gt;
&amp;gt; I tried googling for &amp;quot;openssl client don't send session id&amp;quot; but I didn't&lt;br /&gt;
&amp;gt; find anything useful.&lt;br /&gt;
&lt;br /&gt;
Just do nothing.  Client sessions are not reused unless you explicitly&lt;br /&gt;
arrange for reuse of a session by calling SSL_set_session() before&lt;br /&gt;
SSL_connect().  If you're trying to avoid wasting memory on storing&lt;br /&gt;
client-side sessions that you'll never reuse then this may help:&lt;br /&gt;
&lt;br /&gt;
   SSL_CTX_set_session_cache_mode(client_ctx, SSL_SESS_CACHE_OFF);&lt;br /&gt;
&lt;br /&gt;
but note this is also the default state, so is also not needed unless&lt;br /&gt;
some other code has explicitly enabled client-side caching of sessions.&lt;br /&gt;
&lt;br /&gt;
Only the server-side cache is enabled by default.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 0-RTT ==&lt;br /&gt;
&lt;br /&gt;
0-RTT is specified in XXX (TODO). 0-RTT allows an application to immediately resume a previous session at the expense of consuming unauthenticated data. You should avoid 0-RTT if possible. In fact, an organization's data security policy may not allow it for some higher data sensitivity levels.&lt;br /&gt;
&lt;br /&gt;
Care should be taken if enabling 0-RTT at the server because a number of protections must be enabled. Additionally, some of the protections are required higher up in the stack, outside of the secure socket layer. Below is a list of potential problems from [http://www.ietf.org/mail-archive/web/tls/current/msg23561.html Closing on 0-RTT] on the IETF TLS working group mailing list.&lt;br /&gt;
&lt;br /&gt;
* 0-RTT without stateful anti-replay allows for very high number of replays, breaking rate limiting systems, even high-performance ones, resulting in an opening for DDoS attacks.&lt;br /&gt;
&lt;br /&gt;
* 0-RTT without stateful anti-replay allows for very high number of replays, allowing exploiting timing side channels for information leakage. Very few if any applications are engineered to mitigate or eliminate such side channels.&lt;br /&gt;
&lt;br /&gt;
* 0-RTT without global anti-replay allows leaking information from the 0-RTT data via cache timing attacks. HTTP GET URLs sent to CDNs are especially vulnerable.&lt;br /&gt;
&lt;br /&gt;
* 0-RTT without global anti-replay allows non-idempotent actions contained in 0-RTT data to be repeated potentially lots of times. Abuse of HTTP GET for non-idempotent actions is fairly common.&lt;br /&gt;
&lt;br /&gt;
* 0-RTT allows easily reordering request with re-transmission from the client. This can lead to various unexpected application behavior if possibility of such reordering is not taken into account. &amp;quot;Eventually consistent&amp;quot; datastores are especially vulnerable.&lt;br /&gt;
&lt;br /&gt;
* 0-RTT exporters are not safe for authentication unless the server does global anti-replay on 0-RTT.&lt;br /&gt;
&lt;br /&gt;
[[Category:Examples]]&lt;br /&gt;
[[Category:C level]]&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=Binaries&amp;diff=3209</id>
		<title>Binaries</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=Binaries&amp;diff=3209"/>
		<updated>2022-05-17T12:44:30Z</updated>

		<summary type="html">&lt;p&gt;Matt: Highlight the fact that donations to 3rd parties doesn't come to us, and add details about how to donate to OpenSSL&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Some people have offered to provide OpenSSL binary distributions for selected operating systems. The condition to get a link here is that the link is stable and can provide continued support for OpenSSL for a while.&lt;br /&gt;
&lt;br /&gt;
Note: many Linux distributions come with pre-compiled OpenSSL packages. Those are already well-known among the users of said distributions, and will therefore not be mentioned here. If you are such a user, we ask you to get in touch with your distributor first. This service is primarily for operating systems where there are no pre-compiled OpenSSL packages.&lt;br /&gt;
&lt;br /&gt;
'''Important Disclaimer''':&lt;br /&gt;
''The listing of these third party products does not imply any endorsement by the OpenSSL project, and these organizations are not affiliated in any way with OpenSSL other than by the reference to their independent web sites here.'' '''In particular any donations or payments to any of these organizations will not be known to, seen by, or in any way benefit the OpenSSL project.'''&lt;br /&gt;
&lt;br /&gt;
'''To make a donation to the project directly go to our [https://github.com/sponsors/openssl github sponsors page]. Alternatively consider becoming a [https://www.openssl.org/support/donations.html corporate sponsor].'''&lt;br /&gt;
&lt;br /&gt;
Use these OpenSSL derived products at your own risk; these products have not been evaluated or tested by the OpenSSL project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Third Party OpenSSL Related Binary Distributions&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Product&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | URL&lt;br /&gt;
|-&lt;br /&gt;
| OpenSSL for Windows&lt;br /&gt;
| Works with MSVC++, Builder 3/4/5, and MinGW. Comes in form of self-install executables.&lt;br /&gt;
| https://slproweb.com/products/Win32OpenSSL.html&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| OpenSSL for Windows&lt;br /&gt;
| Pre-compiled Win32/64 libraries without external dependencies to the Microsoft Visual Studio Runtime DLLs, except for the system provided msvcrt.dll.&lt;br /&gt;
| https://indy.fulgan.com/SSL/&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| OpenSSL for Windows&lt;br /&gt;
| Reproducible builds with latest MinGW-w64, 64/32-bit, static/dynamic libs and executable.&lt;br /&gt;
| https://github.com/curl/curl-for-win&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| OpenSSL for Solaris&lt;br /&gt;
| Versions for Solaris 2.5 - 11 SPARC and X86&lt;br /&gt;
| http://www.unixpackages.com/&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| OpensSSL for Windows, Linux, OSX, Android&lt;br /&gt;
| Pre-compiled packages at conan.io package manager:&amp;lt;br&amp;gt;''Windows'' x86/x86_64 (Visual Studio 10, 12, 14, 15) &amp;lt;br&amp;gt;''Linux'' x86/x86_64 (gcc 4.6, 4.8, 4.9, 5, 6, 7) &amp;lt;br&amp;gt;''OSx'' (Apple clang). &amp;lt;br&amp;gt;Cross-building ready recipe: Linux ARM, Android.&lt;br /&gt;
| https://www.conan.io&amp;lt;br&amp;gt;https://conan.io/center/openssl&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| OpenSSL for Windows&lt;br /&gt;
| Pre-compiled Win32/64 1.0.2, 1.1.0, 1.1.1 and 3.0 libraries without external dependencies, primarily built for François Piette's Internet Component Suite (ICS) for Embarcadero (Borland) Delphi and C++ development tools, but may be used for any Windows applications.  The OpenSSL DLLs and EXE files are digitally code signed 'Open Source Developer, François PIETTE', so applications can self verify them for corruption.   &lt;br /&gt;
| http://wiki.overbyte.eu/wiki/index.php/ICS_Download&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| OpenSSL for Windows&lt;br /&gt;
| Pre-compiled 64-bit (x64) and 32-bit (x86) 1.1.1 and 3.0 executables and libraries for Microsoft Windows Operating Systems with a dependency on the Microsoft Visual Studio 2015-2019 runtime and Microsoft Visual Studio 2015-2022 runtime respectively. The distribution may be used standalone or integrated into any Windows application. The distribution's EXE and DLL files are digitally signed 'FireDaemon Technologies Limited'.&lt;br /&gt;
| [https://kb.firedaemon.com/support/solutions/articles/4000121705 https://kb.firedaemon.com/support/solutions/articles/4000121705]&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| OpenSSL for NonStop&lt;br /&gt;
| Pre-compiled NonStop ia64/x86 1.0.2, 1.1.1 executables and libraries for the HPE NonStop Operating Systems. Threaded versions are included. The SPT version depends on FLOSS, otherwise there are no other dependencies. 32-bit versions are available. The builds are done by the ITUGLIB Technical Committee as part of Connect.&lt;br /&gt;
| [https://ituglib.connect-community.org/apps/Ituglib/SrchOpenSrcLib.xhtml https://ituglib.connect-community.org/apps/Ituglib/SrchOpenSrcLib.xhtml]&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Engines=&lt;br /&gt;
&lt;br /&gt;
Some third parties provide OpenSSL compatible engines. As for the binaries above the following disclaimer applies:&lt;br /&gt;
&lt;br /&gt;
'''Important Disclaimer''':&lt;br /&gt;
''The listing of these third party products does not imply any endorsement by the OpenSSL project, and these organizations are not affiliated in any way with OpenSSL other than by the reference to their independent web sites here. In particular any donations or payments to any of these organizations will not be known to, seen by, or in any way benefit the OpenSSL project.''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Third Party OpenSSL compatible engines&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Product&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | URL&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| Intel® QuickAssist Technology engine&lt;br /&gt;
| Intel® QuickAssist Technology (http://www.intel.com/content/www/us/en/embedded/technology/quickassist/overview.html) provides acceleration for a number of cryptographic algorithms. QAT_engine adds support for Intel® QuickAssist Technology to OpenSSL-1.1.0 via the ENGINE framework. The definitive list of algorithms exposed into OpenSSL (a subset of those supported in the device) is defined on the associated github page.&lt;br /&gt;
| https://github.com/01org/QAT_Engine&lt;br /&gt;
|-&lt;br /&gt;
| ATECCX08 engine&lt;br /&gt;
| Support for the Atmel ATECC508A (http://www.atmel.com/devices/ATECC508A.aspx) hardware to provide secure key storage, ECC cryptographic calculations for the ECC NIST P-256 curve, and FIPS certified hardware Random Number Generator.&lt;br /&gt;
| https://github.com/AtmelCSO/cryptoauth-openssl-engine&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| GOST engine&lt;br /&gt;
| A reference implementation of the Russian GOST crypto algorithms for OpenSSL. The presence of this engine also enables the built-in OpenSSL support for GOST TLS ciphersuites. (Note: this engine is for OpenSSL version 1.1.0 and above. Previous versions of OpenSSL used a built-in GOST engine)&lt;br /&gt;
| https://github.com/gost-engine/engine&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| ISARA Radiate Solution Suite OpenSSL Connector&lt;br /&gt;
| Commercially available engine and source code patch for OpenSSL 1.0.2 branch.  The ISARA Radiate OpenSSL Connector lets you implement OpenSSL using quantum safe algorithms. ISARA Radiate (https://www.isara.com/isara-radiate/) gives you the cryptographic building blocks to create applications that will resist attacks by quantum computers.&lt;br /&gt;
| https://www.isara.com/openssl/1/&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| BEE2EVP engine&lt;br /&gt;
| Implements the Belarusian national cryptography: symmetric and public-key encryption, MAC, AEAD, hashing, digital signature. Encapsulates the Bee2 core cryptographic library into OpenSSL using the EVP interface.&lt;br /&gt;
| https://github.com/bcrypto/bee2evp&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| wolfSSL wolfEngine&lt;br /&gt;
| wolfSSL has an OpenSSL engine, wolfEngine. wolfEngine is structured as a separate standalone library which links against wolfSSL (libwolfssl) and OpenSSL. wolfEngine implements and exposes an OpenSSL engine implementation which wraps the wolfCrypt native API internally.  Algorithm support matches that as listed on the wolfCrypt FIPS 140-2 certificate #3389.&lt;br /&gt;
| https://github.com/wolfSSL/wolfEngine&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| wolfSSL wolfProvider&lt;br /&gt;
| Similar to the wolfEngine above, the wolfSSL team has also created the wolfProvider. The wolfProvider is structured as a separate standalone library which links against wolfSSL (libwolfssl) and OpenSSL 3.0.0 using the new provider API. Algorithm support matches that as listed on the wolfCrypt FIPS 140-2 certificate #3389.&lt;br /&gt;
| https://github.com/wolfSSL/wolfProvider&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=TLS1.3&amp;diff=3199</id>
		<title>TLS1.3</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=TLS1.3&amp;diff=3199"/>
		<updated>2022-03-28T13:46:31Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Differences with TLS1.2 and below */ typo fix&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The OpenSSL 1.1.1 release includes support for TLSv1.3. The release is binary and API compatible with OpenSSL 1.1.0. In theory, if your application supports OpenSSL 1.1.0, then all you need to do to upgrade is to drop in the new version of OpenSSL and you will automatically start being able to use TLSv1.3. However there are some issues that application developers and deployers need to be aware of.&lt;br /&gt;
&lt;br /&gt;
== Differences with TLS1.2 and below ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 is a major rewrite of the specification. There was some debate as to whether it should really be called TLSv2.0 - but TLSv1.3 it is. There are major changes and some things work very differently. A brief, incomplete, summary of some things that you are likely to notice follows:&lt;br /&gt;
&lt;br /&gt;
* There are new ciphersuites that only work in TLSv1.3. The old ciphersuites cannot be used for TLSv1.3 connections and the new ones cannot be used in TLSv1.2 and below.&lt;br /&gt;
* The new ciphersuites are defined differently and do not specify the certificate type (e.g. RSA, DSA, ECDSA) or the key exchange mechanism (e.g. DHE or ECDHE). This has implications for ciphersuite configuration.&lt;br /&gt;
* Clients provide a “key_share” in the ClientHello. This has consequences for “group” configuration.&lt;br /&gt;
* Sessions are not established until after the main handshake has been completed. There may be a gap between the end of the handshake and the establishment of a session (or, in theory, a session may not be established at all). This could have impacts on session resumption code.&lt;br /&gt;
* Renegotiation is not possible in a TLSv1.3 connection&lt;br /&gt;
* More of the handshake is now encrypted.&lt;br /&gt;
* More types of messages can now have extensions (this has an impact on the custom extension APIs and Certificate Transparency)&lt;br /&gt;
* DSA certificates are no longer allowed in TLSv1.3 connections&lt;br /&gt;
&lt;br /&gt;
Note that at this stage only TLSv1.3 is supported. DTLSv1.3 is still in the early days of specification and there is no OpenSSL support for it at this time.&lt;br /&gt;
&lt;br /&gt;
== Current status of the TLSv1.3 standard ==&lt;br /&gt;
&lt;br /&gt;
The TLSv1.3 standard has now been published as [[https://tools.ietf.org/html/rfc8446 RFC 8446]]. During the development of the standard the TLS Working Group published various draft versions. Implementations of draft versions of the standard identify the specific draft version that they are using. This means that implementations based on different draft versions, and also the final RFC version, do not interoperate with each other.&lt;br /&gt;
&lt;br /&gt;
The OpenSSL git master branch (and the 1.1.1-pre9 beta version) contain our development TLSv1.3 code which is based on the final version of RFC8446 and can be used for testing purposes (i.e. it is not for production use). Earlier beta versions of OpenSSL 1.1.1 implemented draft versions of the standard. Those versions contained the macro TLS1_3_VERSION_DRAFT_TXT in the tls1.h header file which identified the specific draft version that was implemented. This macro has been removed from 1.1.1-pre9 and the current master branch.&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 is enabled by default in the latest development versions (there is no need to explicitly enable it). To disable it at compile time you must use the “no-tls1_3” option to “config” or “Configure”.&lt;br /&gt;
&lt;br /&gt;
Although the latest 1.1.1 versions support the final standard version, other applications that support TLSv1.3 may still be using older draft versions. This is a common source of interoperability problems. If two peers supporting different TLSv1.3 draft versions attempt to communicate then they will fall back to TLSv1.2.&lt;br /&gt;
&lt;br /&gt;
== Ciphersuites ==&lt;br /&gt;
&lt;br /&gt;
OpenSSL has implemented support for five TLSv1.3 ciphersuites as follows:&lt;br /&gt;
&lt;br /&gt;
* TLS_AES_256_GCM_SHA384&lt;br /&gt;
* TLS_CHACHA20_POLY1305_SHA256&lt;br /&gt;
* TLS_AES_128_GCM_SHA256&lt;br /&gt;
* TLS_AES_128_CCM_8_SHA256&lt;br /&gt;
* TLS_AES_128_CCM_SHA256&lt;br /&gt;
&lt;br /&gt;
Due to the major differences between the way that ciphersuites for TLSv1.2 and below and ciphersuites for TLSv1.3 work, they are configured in OpenSSL differently too.&lt;br /&gt;
&lt;br /&gt;
By default the first three of the above ciphersuites are enabled by default. This means that if you have no explicit ciphersuite configuration then you will automatically use those three and will be able to negotiate TLSv1.3. Note that changing the TLSv1.2 and below cipher list has no impact on the TLSv1.3 ciphersuite configuration.&lt;br /&gt;
&lt;br /&gt;
Applications should use the SSL_CTX_set_ciphersuites() or SSL_set_ciphersuites() functions to configure TLSv1.3 ciphersuites. Note that the functions SSL_CTX_get_ciphers() and SSL_get_ciphers() will return&lt;br /&gt;
the full list of ciphersuites that have been configured for both TLSv1.2 and below and TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
For the OpenSSL command line applications there is a new &amp;quot;-ciphersuites&amp;quot; option to configure the TLSv1.3 ciphersuite list. This is just a simple colon (&amp;quot;:&amp;quot;) separated list of TLSv1.3 ciphersuite names in preference order. Note that you cannot use the special characters such as &amp;quot;+&amp;quot;, &amp;quot;!&amp;quot;, &amp;quot;-&amp;quot; etc, that you can for defining TLSv1.2 ciphersuites. In practice this is not likely to be a problem because there are only a very small number of TLSv1.3 ciphersuites.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
$ openssl s_server -cert mycert.pem -key mykey.pem -cipher ECDHE -ciphersuites &amp;quot;TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This will configure OpenSSL to use any ECDHE based ciphersuites for TLSv1.2 and below. For TLSv1.3 the TLS_AES_256_GCM_SHA384 and TLS_CHACHA20_POLY1305_SHA256 ciphersuites will be available.&lt;br /&gt;
&lt;br /&gt;
Note that all of the above applies to the &amp;quot;ciphers&amp;quot; command line application as well. This can sometimes lead to surprising results. For example this command:&lt;br /&gt;
&lt;br /&gt;
$ openssl ciphers -s -v ECDHE&lt;br /&gt;
&lt;br /&gt;
Will list all the ciphersuites for TLSv1.2 and below that support ECDHE '''and''' additionally all of the default TLSv1.3 ciphersuites. Use the &amp;quot;-ciphersuites&amp;quot; option to further configure the TLSv1.3 ciphersuites.&lt;br /&gt;
&lt;br /&gt;
== Groups ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 the client selects a “group” that it will use for key exchange. OpenSSL only supports ECDHE groups for this. The client then sends “key_share” information to the server for its selected group in the ClientHello.&lt;br /&gt;
&lt;br /&gt;
The list of supported groups is configurable. It is possible for a client to select a group that the server does not support. In this case the server requests that the client sends a new key_share that it does support. While this means a connection will still be established (assuming a mutually supported group exists), it does introduce an extra server round trip - so this has implications for performance. In the ideal scenario the client will select a group that the server supports in the first instance.&lt;br /&gt;
&lt;br /&gt;
In practice most clients will use X25519 or P-256 for their initial key_share. For maximum performance it is recommended that servers are configured to support at least those two groups and clients use one of those two for its initial key_share. This is the default case (OpenSSL clients will use X25519).&lt;br /&gt;
&lt;br /&gt;
The group configuration also controls the allowed groups in TLSv1.2 and below. If applications have previously configured their groups in OpenSSL 1.1.0 then you should review that configuration to ensure that it still makes sense for TLSv1.3. The first named (i.e. most preferred group) will be the one used by an OpenSSL client in its intial key_share.&lt;br /&gt;
&lt;br /&gt;
Applications can configure the group list by using SSL_CTX_set1_groups() or a similar function (see [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_groups.html here] for further details). Alternatively, if applications use SSL_CONF style configuration files then this can be configured using the Groups or Curves command (see [https://www.openssl.org/docs/manmaster/man3/SSL_CONF_cmd.html#SUPPORTED-CONFIGURATION-FILE-COMMANDS here]).&lt;br /&gt;
&lt;br /&gt;
== Sessions ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 and below a session is established as part of the handshake. This session can then be used in a subsequent connection to achieve an abbreviated handshake. Applications might typically obtain a handle on the session after a handshake has completed using the [https://www.openssl.org/docs/manmaster/man3/SSL_get1_session.html SSL_get1_session()] function (or similar).&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 sessions are not established until after the main handshake has completed. The server sends a separate post-handshake message to the client containing the session details. Typically this will happen soon after the handshake has completed, but it could be sometime later (or not at all).&lt;br /&gt;
&lt;br /&gt;
The specification recommends that applications only use a session once (although this may not be enforced). For this reason some servers send multiple session messages to a client. To enforce the “use once” recommendation applications could use [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_remove_session.html SSL_CTX_remove_session()] to mark a session as non-resumable (and remove it from the cache) once it has been used. OpenSSL servers that accept &amp;quot;early_data&amp;quot; will automatically enforce single use sessions. Any attempt to resume with a session that has already been used will fallback to a full handshake.&lt;br /&gt;
&lt;br /&gt;
The old SSL_get1_session() and similar APIs may not operate as expected for client applications written for TLSv1.2 and below. Specifically if a client application calls SSL_get1_session() before the server message containing session details has been received then an SSL_SESSION object will still be returned, but any attempt to resume with it will not succeed and a full handshake will occur instead. In the case where multiple sessions have been sent by the server then only the last session will be returned by SSL_get1_session(). Calling SSL_get1_session() after a 2 way shutdown will give a resumable session if any was sent. You can check that a session is resumable with [https://www.openssl.org/docs/manmaster/man3/SSL_SESSION_is_resumable.html SSL_SESSION_is_resumable()].&lt;br /&gt;
&lt;br /&gt;
Client application developers should consider using the [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_sess_set_new_cb.html SSL_CTX_sess_set_new_cb()] API instead. This provides a callback mechanism which gets invoked every time a new session is established. This can get invoked multiple times for a single connection if a server sends multiple session messages.&lt;br /&gt;
&lt;br /&gt;
Note that SSL_CTX_sess_set_new_cb() was also available in previous versions of OpenSSL. Applications that already used that API will still work, but they may find that the callback is invoked at unexpected times, i.e. post-handshake.&lt;br /&gt;
&lt;br /&gt;
An OpenSSL server will immediately attempt to send session details to a client after the main handshake has completed. The number of tickets can be set using [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_num_tickets.html SSL_CTX_set_num_tickets]. To server applications this post-handshake stage will appear to be part of the main handshake, so calls to SSL_get1_session() should continue to work as before.&lt;br /&gt;
&lt;br /&gt;
If a client sends it's data and directly sends the close notify request and closes the connection, the server will still try to send tickets if configured to do so. Since the connection is already closed by the client, this might result in a write error and receiving the SIGPIPE signal. The write error will be ignored if it's a session ticket. But server applications can still get SIGPIPE they didn't get before.&lt;br /&gt;
&lt;br /&gt;
If the server sends session tickets and you want to be able to get a resumable session, you need to either call SSL_read() after the ticket was sent or do a 2 way shutdown.&lt;br /&gt;
&lt;br /&gt;
== Custom Extensions and Certificate Transparency ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 and below the initial ClientHello and ServerHello messages can contain “extensions”. This allows the base specifications to be extended with additional features and capabilities that may not be applicable in all scenarios or could not be foreseen at the time that the base specifications were written. OpenSSL provides support for a number of “built-in” extensions.&lt;br /&gt;
&lt;br /&gt;
Additionally the custom extensions API provides some basic capabilities for application developers to add support for new extensions that are not built-in to OpenSSL.&lt;br /&gt;
&lt;br /&gt;
Built on top of the custom extensions API is the “serverinfo” API. This provides an even more basic interface that can be configured at run time. One use case for this is Certificate Transparency. OpenSSL provides built-in support for the client side of Certificate Transparency but there is no built-in server side support. However this can easily be achieved using “serverinfo” files. A serverinfo file containing the Certificate Transparency information can be configured within OpenSSL and it will then be sent back to the client as appropriate.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 the use of extensions is expanded significantly and there are many more messages that can include them. Additionally some extensions that were applicable to TLSv1.2 and below are no longer applicable in TLSv1.3 and some extensions are moved from the ServerHello message to the EncryptedExtensions message. The old custom extensions API does not have the ability to specify which messages the extensions should be associated with. For that reason a new custom extensions API was required.&lt;br /&gt;
&lt;br /&gt;
The old API will still work, but the custom extensions will only be added where TLSv1.2 or below is negotiated. To add custom extensions that work for all TLS versions application developers will need to update their applications to the new API (see [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_add_custom_ext.html here] for details).&lt;br /&gt;
&lt;br /&gt;
The “serverinfo” data format has also been updated to include additional information about which messages the extensions are relevant to. Applications using “serverinfo” files may need to update to the “version 2” file format to be able to operate in TLSv1.3 (see [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_use_serverinfo.html here] for details).&lt;br /&gt;
&lt;br /&gt;
== Renegotiation ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 does not have renegotiation so calls to SSL_renegotiate() or SSL_renegotiate_abbreviated() will immediately fail if invoked on a connection that has negotiated TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
A common use case for renegotiation is to update the connection keys. The function SSL_key_update() can be used for this purpose in TLSv1.3 (see [https://www.openssl.org/docs/manmaster/man3/SSL_key_update.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
Another use case is to request a certificate from the client. This can be achieved by using the SSL_verify_client_post_handshake() function in TLSv1.3 (see [https://www.openssl.org/docs/manmaster/man3/SSL_verify_client_post_handshake.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
== DSA certificates ==&lt;br /&gt;
&lt;br /&gt;
DSA certificates are no longer allowed in TLSv1.3. From OpenSSL 1.1.0 and above ciphersuites for TLSv1.2 and below based on DSA are no longer available by default (you must compile OpenSSL with the &amp;quot;enable-weak-ssl-ciphers&amp;quot; option, and explicitly configure the ciphersuites at run time). If your server application is using a DSA certificate and has made the necessary configuration changes to enable the ciphersuites then TLSv1.3 will never be negotiated when that certificate is used for a connection (the maximum version will be TLSv1.2).&lt;br /&gt;
&lt;br /&gt;
Please use an ECDSA or RSA certificate instead.&lt;br /&gt;
&lt;br /&gt;
== Middlebox Compatibility Mode ==&lt;br /&gt;
&lt;br /&gt;
During development of the TLSv1.3 standard it became apparent that in some cases, even if a client and server both support TLSv1.3, connections could sometimes still fail. This is because middleboxes on the network between the two peers do not understand the new protocol and prevent the connection from taking place. In order to work around this problem the TLSv1.3 specification introduced a “middlebox compatibility” mode. This made a few optional changes to the protocol to make it appear more like TLSv1.2 so that middleboxes would let it through. Largely these changes are superficial in nature but do include sending some small but unneccessary messages. OpenSSL has middlebox compatibility mode on by default, so most users should not need to worry about this. However applications may choose to switch it off by calling the function SSL_CTX_clear_options() and passing SSL_OP_ENABLE_MIDDLEBOX_COMPAT as an argument (see [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_clear_options.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
If the remote peer is not using middlebox compatibility mode and there are problematic middleboxes on the network path then this could cause spurious connection failures.&lt;br /&gt;
&lt;br /&gt;
== Server Name Indication ==&lt;br /&gt;
&lt;br /&gt;
Server Name Indication (SNI) can be used by the client to select one of several sites on the same host, and so a different X.509 certificate can be sent depending on the hostname that was sent in the SNI extension. If the SNI extension is not sent the server's options are to either disconnect or select a default hostname and matching certificate. The default would typically be the main site.&lt;br /&gt;
&lt;br /&gt;
SNI has been made mandatory to implement in TLS 1.3 but not mandatory to use. Some sites want to encourage the use of SNI and configure a default certificate that fails WebPKI authentication  when the client supports TLS 1.3. This is under the assumption that if a hostname is not sent, then it means that the client does not verify the server certificate (unauthenticated opportunistic TLS). For implementation that actually don't send the SNI extension, but do verify the server certificate this can cause connection failures.&lt;br /&gt;
&lt;br /&gt;
To enable SNI you need to use the [https://www.openssl.org/docs/manmaster/man3/SSL_set_tlsext_host_name.html SSL_set_tlsext_host_name()] function. For hostname validation see [[Hostname_validation|Hostname validation]].&lt;br /&gt;
&lt;br /&gt;
== PSKs ==&lt;br /&gt;
&lt;br /&gt;
Pre-shared Keys work differently in TLSv1.2 and below compared to TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 (and below) special PSK specific ciphersuites are used. A client wishing to use a PSK will offer one (or more) of those ciphersuites to the server in the initial ClientHello message. If the server also wishes to use a PSK, then it will select that ciphersuite and will (optionally) send back an &amp;quot;identity hint&amp;quot; to the client. Finally the client sends back to the server identity details so that the server knows which PSK to use. In OpenSSL 1.1.0 and below this is implemented using a callback mechanism. The callback is called passing in the identity hint (or NULL if there is no hint) and the callback responds by filling in the identity details, as well as the PSK itself.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3, if a client wishes to use a PSK, then the identity details are sent immediately in the initial ClientHello message. Use of a PSK is independent of any ciphersuite selection. If the server wishes to use the PSK then it will signal this in its response to the client. Otherwise a full (non-PSK) handshake will occur. Note that there is no identity hint in TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
OpenSSL 1.1.1 introduces new TLSv1.3 specific PSK callbacks. See [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_psk_use_session_callback.html here] and [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_psk_find_session_callback.html here] for further details. These are the preferred callbacks to use for TLSv1.3 PSKs. However, if an application has set up the TLSv1.2 PSK callbacks and TLSv1.3 is enabled then OpenSSL will attempt to fallback to using the old style callbacks. In this case, on the client side, the callback will be invoked before any communication with the server has taken place during construction of the initial ClientHello. This is because the identity details must be sent immediately in TLSv1.3. The identity hint value will always be NULL in this case.&lt;br /&gt;
&lt;br /&gt;
Note that the TLSv1.2 callbacks could end up being called twice for the same connection. For example if a client application provides no TLSv1.3 callback and TLSv1.3 is enabled, then it will be called first during the initial ClientHello construction. If the server subsequently selects TLSv1.2 then the callback will be called again later on in the handshake to set up the TLSv1.2 PSK.&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 PSKs must specify a message digest (e.g. such as SHA-256). Where old style TLSv1.2 callbacks are used in a TLSv1.3 context then the message digest will default to SHA-256 (as specified in the standard). A server which has been configured with TLSv1.2 PSK callbacks, but negotiates TLSv1.3 with a client, will prefer ciphersuites based on SHA-256 in order to maximise the chances of a PSK being used.&lt;br /&gt;
&lt;br /&gt;
== Non-application data records ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 sends more non-application data records after the handshake is finished. At least the session ticket and possibly a key update is send after the finished message. With TLSv1.2 it happened in case of renegotiation. [https://www.openssl.org/docs/manmaster/man3/SSL_read.html SSL_read()] has always documented that it can return SSL_ERROR_WANT_READ after processing non-application data, even when there is still data that can be read. When SSL_MODE_AUTO_RETRY is set using [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_mode.html SSL_CTX_set_mode()] OpenSSL will try to process the next record, and so not return SSL_ERROR_WANT_READ while it still has data available. Because many applications did not handle this properly, SSL_MODE_AUTO_RETRY has been made the default. If the application is using blocking sockets and SSL_MODE_AUTO_RETRY is enabled, and select() is used to check if a socket is readable this results in SSL_read() processing the non-application data records, but then try to read an application data record which might not be available and hang.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 represents a significant step forward and has some exciting new features but there are some hazards for the unwary when upgrading. Mostly these issues have relatively straight forward solutions. Application developers should review their code and consider whether anything should be updated in order to work more effectively with TLSv1.3. Similarly application deployers should review their configuration.&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=Simple_TLS_Server&amp;diff=3190</id>
		<title>Simple TLS Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=Simple_TLS_Server&amp;diff=3190"/>
		<updated>2021-11-11T09:55:12Z</updated>

		<summary type="html">&lt;p&gt;Matt: Update the demo TLS server code for currently supported versions of OpenSSL. Remove some old stuff that is no longer relevant with current versions of OpenSSL.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The code below is a complete implementation of a minimal TLS server. The first thing we do is create an ''SSL_CTX'' or SSL context. This is created using the ''TLS_server_method'' which creates a server that will negotiate the highest version of SSL/TLS supported by the client it is connecting to. The context is then configured by specifying the certificate and private key to use.&lt;br /&gt;
&lt;br /&gt;
Next we perform some normal socket programming and create a new server socket, there's nothing OpenSSL specific about this code. Whenever we get a new connection we call ''accept'' as normal. To handle the TLS we create a new ''SSL'' structure, this holds the information related to this particular connection. We use ''SSL_set_fd'' to tell openssl the file descriptor to use for the communication. In this example, we call ''SSL_accept'' to handle the server side of the TLS handshake, then use ''SSL_write()'' to send our message. Finally we clean up the various structures.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;sys/socket.h&amp;gt;&lt;br /&gt;
#include &amp;lt;arpa/inet.h&amp;gt;&lt;br /&gt;
#include &amp;lt;openssl/ssl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;openssl/err.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
int create_socket(int port)&lt;br /&gt;
{&lt;br /&gt;
    int s;&lt;br /&gt;
    struct sockaddr_in addr;&lt;br /&gt;
&lt;br /&gt;
    addr.sin_family = AF_INET;&lt;br /&gt;
    addr.sin_port = htons(port);&lt;br /&gt;
    addr.sin_addr.s_addr = htonl(INADDR_ANY);&lt;br /&gt;
&lt;br /&gt;
    s = socket(AF_INET, SOCK_STREAM, 0);&lt;br /&gt;
    if (s &amp;lt; 0) {&lt;br /&gt;
        perror(&amp;quot;Unable to create socket&amp;quot;);&lt;br /&gt;
        exit(EXIT_FAILURE);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (bind(s, (struct sockaddr*)&amp;amp;addr, sizeof(addr)) &amp;lt; 0) {&lt;br /&gt;
        perror(&amp;quot;Unable to bind&amp;quot;);&lt;br /&gt;
        exit(EXIT_FAILURE);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (listen(s, 1) &amp;lt; 0) {&lt;br /&gt;
        perror(&amp;quot;Unable to listen&amp;quot;);&lt;br /&gt;
        exit(EXIT_FAILURE);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return s;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
SSL_CTX *create_context()&lt;br /&gt;
{&lt;br /&gt;
    const SSL_METHOD *method;&lt;br /&gt;
    SSL_CTX *ctx;&lt;br /&gt;
&lt;br /&gt;
    method = TLS_server_method();&lt;br /&gt;
&lt;br /&gt;
    ctx = SSL_CTX_new(method);&lt;br /&gt;
    if (!ctx) {&lt;br /&gt;
        perror(&amp;quot;Unable to create SSL context&amp;quot;);&lt;br /&gt;
        ERR_print_errors_fp(stderr);&lt;br /&gt;
        exit(EXIT_FAILURE);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return ctx;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void configure_context(SSL_CTX *ctx)&lt;br /&gt;
{&lt;br /&gt;
    /* Set the key and cert */&lt;br /&gt;
    if (SSL_CTX_use_certificate_file(ctx, &amp;quot;cert.pem&amp;quot;, SSL_FILETYPE_PEM) &amp;lt;= 0) {&lt;br /&gt;
        ERR_print_errors_fp(stderr);&lt;br /&gt;
        exit(EXIT_FAILURE);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (SSL_CTX_use_PrivateKey_file(ctx, &amp;quot;key.pem&amp;quot;, SSL_FILETYPE_PEM) &amp;lt;= 0 ) {&lt;br /&gt;
        ERR_print_errors_fp(stderr);&lt;br /&gt;
        exit(EXIT_FAILURE);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char **argv)&lt;br /&gt;
{&lt;br /&gt;
    int sock;&lt;br /&gt;
    SSL_CTX *ctx;&lt;br /&gt;
&lt;br /&gt;
    ctx = create_context();&lt;br /&gt;
&lt;br /&gt;
    configure_context(ctx);&lt;br /&gt;
&lt;br /&gt;
    sock = create_socket(4433);&lt;br /&gt;
&lt;br /&gt;
    /* Handle connections */&lt;br /&gt;
    while(1) {&lt;br /&gt;
        struct sockaddr_in addr;&lt;br /&gt;
        unsigned int len = sizeof(addr);&lt;br /&gt;
        SSL *ssl;&lt;br /&gt;
        const char reply[] = &amp;quot;test\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
        int client = accept(sock, (struct sockaddr*)&amp;amp;addr, &amp;amp;len);&lt;br /&gt;
        if (client &amp;lt; 0) {&lt;br /&gt;
            perror(&amp;quot;Unable to accept&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        ssl = SSL_new(ctx);&lt;br /&gt;
        SSL_set_fd(ssl, client);&lt;br /&gt;
&lt;br /&gt;
        if (SSL_accept(ssl) &amp;lt;= 0) {&lt;br /&gt;
            ERR_print_errors_fp(stderr);&lt;br /&gt;
        } else {&lt;br /&gt;
            SSL_write(ssl, reply, strlen(reply));&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        SSL_shutdown(ssl);&lt;br /&gt;
        SSL_free(ssl);&lt;br /&gt;
        close(client);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    close(sock);&lt;br /&gt;
    SSL_CTX_free(ctx);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Session Reuse ==&lt;br /&gt;
&lt;br /&gt;
According to Viktor Dukhovni at [http://mta.openssl.org/pipermail/openssl-users/2016-September/004564.html Possible to control session reuse from the client]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;gt; For performance testing purposes, I would like to turn off session&lt;br /&gt;
&amp;gt; reuse in the (homegrown) client I use for testing. Is there a function&lt;br /&gt;
&amp;gt; in the openssl library to do it?&lt;br /&gt;
&amp;gt; &lt;br /&gt;
&amp;gt; I tried googling for &amp;quot;openssl client don't send session id&amp;quot; but I didn't&lt;br /&gt;
&amp;gt; find anything useful.&lt;br /&gt;
&lt;br /&gt;
Just do nothing.  Client sessions are not reused unless you explicitly&lt;br /&gt;
arrange for reuse of a session by calling SSL_set_session() before&lt;br /&gt;
SSL_connect().  If you're trying to avoid wasting memory on storing&lt;br /&gt;
client-side sessions that you'll never reuse then this may help:&lt;br /&gt;
&lt;br /&gt;
   SSL_CTX_set_session_cache_mode(client_ctx, SSL_SESS_CACHE_OFF);&lt;br /&gt;
&lt;br /&gt;
but note this is also the default state, so is also not needed unless&lt;br /&gt;
some other code has explicitly enabled client-side caching of sessions.&lt;br /&gt;
&lt;br /&gt;
Only the server-side cache is enabled by default.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 0-RTT ==&lt;br /&gt;
&lt;br /&gt;
0-RTT is specified in XXX (TODO). 0-RTT allows an application to immediately resume a previous session at the expense of consuming unauthenticated data. You should avoid 0-RTT if possible. In fact, an organization's data security policy may not allow it for some higher data sensitivity levels.&lt;br /&gt;
&lt;br /&gt;
Care should be taken if enabling 0-RTT at the server because a number of protections must be enabled. Additionally, some of the protections are required higher up in the stack, outside of the secure socket layer. Below is a list of potential problems from [http://www.ietf.org/mail-archive/web/tls/current/msg23561.html Closing on 0-RTT] on the IETF TLS working group mailing list.&lt;br /&gt;
&lt;br /&gt;
* 0-RTT without stateful anti-replay allows for very high number of replays, breaking rate limiting systems, even high-performance ones, resulting in an opening for DDoS attacks.&lt;br /&gt;
&lt;br /&gt;
* 0-RTT without stateful anti-replay allows for very high number of replays, allowing exploiting timing side channels for information leakage. Very few if any applications are engineered to mitigate or eliminate such side channels.&lt;br /&gt;
&lt;br /&gt;
* 0-RTT without global anti-replay allows leaking information from the 0-RTT data via cache timing attacks. HTTP GET URLs sent to CDNs are especially vulnerable.&lt;br /&gt;
&lt;br /&gt;
* 0-RTT without global anti-replay allows non-idempotent actions contained in 0-RTT data to be repeated potentially lots of times. Abuse of HTTP GET for non-idempotent actions is fairly common.&lt;br /&gt;
&lt;br /&gt;
* 0-RTT allows easily reordering request with re-transmission from the client. This can lead to various unexpected application behavior if possibility of such reordering is not taken into account. &amp;quot;Eventually consistent&amp;quot; datastores are especially vulnerable.&lt;br /&gt;
&lt;br /&gt;
* 0-RTT exporters are not safe for authentication unless the server does global anti-replay on 0-RTT.&lt;br /&gt;
&lt;br /&gt;
[[Category:Examples]]&lt;br /&gt;
[[Category:C level]]&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3186</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3186"/>
		<updated>2021-09-20T12:36:15Z</updated>

		<summary type="html">&lt;p&gt;Matt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''READ ME FIRST:'''&lt;br /&gt;
&lt;br /&gt;
This page is no longer being maintained. Refer instead to the OpenSSL 3.0 [https://www.openssl.org/docs/man3.0/man7/migration_guide.html migration guide] for the most up to date information.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
One of the standard providers available is the FIPS provider. This makes available FIPS validated cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
* The RAND_DRBG subsystem has been removed.  The new EVP_RAND is a partial replacement: the DRBG callback framework is absent.&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Starting with OpenSSL 3.0.0 alpha16, no separate installation step for the FIPS module (a.k.a FIPS provider) is necessary anymore. It will be built and installed automatically if FIPS support has been configured. The current documentation can be found in the [https://github.com/openssl/openssl/blob/master/README-FIPS.md README-FIPS] file on the master branch.&lt;br /&gt;
&lt;br /&gt;
''The documentation in the remaining section applies to alpha versions up to OpenSSL 3.0.0 alpha15.''&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OSSL_LIB_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OSSL_LIB_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
'''Note:''' ''In alpha releases of OpenSSL 3.0.0 up until alpha6, the OSSL_LIB_CTX was called OPENSSL_CTX. It was renamed for OpenSSL 3.0.0 alpha7. If you are still using an alpha6 release or earlier, take a look at this [https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;amp;oldid=3119 older version of the wiki page].''&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OSSL_LIB_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OSSL_LIB_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OSSL_LIB_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OSSL_LIB_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the high level APIs a provider is selected. It is that provider implementation that actually does the required work. There are five providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The base provider. This contains a small sub-set of non-cryptographic algorithms available in the default provider. For example algorithms to encode and decode keys to files. If you do not load the default provider then you should always load this one instead (including if you are using the FIPS provider).&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any&lt;br /&gt;
legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the high level APIs, such as EVP, instead)&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
All of the above APIs are deprecated in OpenSSL 3.0 - so a simple rule is to&lt;br /&gt;
avoid using all deprecated functions.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they can automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
 base = base_sect&lt;br /&gt;
 &lt;br /&gt;
 [base_sect]&lt;br /&gt;
 activate = 1&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour. Note that this configuration also activates the &amp;quot;base&amp;quot; provider. The base provider does not include any cryptographic algorithms (and therefore does not impact the validation status of any cryptographic operations), but does include other supporting algorithms that may be required. It is designed to be used in conjunction with the FIPS module.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain deprecated APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot; (note that setting this value to 0 is not sufficient). This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
        OSSL_PROVIDER *base;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        base = OSSL_PROVIDER_load(NULL, &amp;quot;base&amp;quot;);&lt;br /&gt;
        if (base == NULL) {&lt;br /&gt;
            OSSL_PROVIDER_unload(fips);&lt;br /&gt;
            printf(&amp;quot;Failed to load base provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(base);&lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Also note that in this example we have additionally loaded the &amp;quot;base&amp;quot; provider. This loads a sub-set of algorithms that are also available in the default provider - specifically non cryptographic ones which may be used in conjunction with the FIPS provider. For example this contains algorithms for encoding and decoding keys. If you decide not to load the default provider then you will usually want to load the base provider instead.&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. The local property query overrides the default properties if the same property name is specified in both.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default and base providers that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the encoder and decoder algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The encoder and decoder algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;. Note that this config file does not load the &amp;quot;base&amp;quot; provider. All supporting algorithms that are in &amp;quot;base&amp;quot; are also in &amp;quot;default&amp;quot;, so it is unnecessary in this case:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS and base providers. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OSSL_LIB_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    nonfipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS and base providers so we&lt;br /&gt;
     * don't need to explicitly load them here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OSSL_LIB_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OSSL_LIB_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OSSL_LIB_CTX_free(fipslibctx);&lt;br /&gt;
    OSSL_LIB_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Encoders and Decoders with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Encoders and decoders are used to read and write keys or parameters from or to some external format (for example a PEM file). If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a encoder to do this. Similarly you need a decoder to read previously saved keys and parameters. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate encoder/decoder will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL encoder and decoder are implemented in both the default and base providers and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these encoder/decoder have the &amp;quot;fips=yes&amp;quot; property against them. You should ensure that either the default or base provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties and the default library context to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_ex(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use the same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_ex(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_ex(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as encoders from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_ex(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_ex(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithms. Here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_ENCODER                         || 100%               || 100%&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_DECODER                         || 100%               || 100%&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented encoder / decoder ====&lt;br /&gt;
&lt;br /&gt;
===== Encoders =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Encoder                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Decoders =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Decoder                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on decoders&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider encoders for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=Binaries&amp;diff=3184</id>
		<title>Binaries</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=Binaries&amp;diff=3184"/>
		<updated>2021-08-24T10:03:56Z</updated>

		<summary type="html">&lt;p&gt;Matt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Some people have offered to provide OpenSSL binary distributions for selected operating systems. The condition to get a link here is that the link is stable and can provide continued support for OpenSSL for a while.&lt;br /&gt;
&lt;br /&gt;
Note: many Linux distributions come with pre-compiled OpenSSL packages. Those are already well-known among the users of said distributions, and will therefore not be mentioned here. If you are such a user, we ask you to get in touch with your distributor first. This service is primarily for operating systems where there are no pre-compiled OpenSSL packages.&lt;br /&gt;
&lt;br /&gt;
'''Important Disclaimer''':&lt;br /&gt;
''The listing of these third party products does not imply any endorsement by the OpenSSL project, and these organizations are not affiliated in any way with OpenSSL other than by the reference to their independent web sites here. In particular any donations or payments to any of these organizations will not be known to, seen by, or in any way benefit the OpenSSL project.''&lt;br /&gt;
&lt;br /&gt;
Use these OpenSSL derived products at your own risk; these products have not been evaluated or tested by the OpenSSL project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Third Party OpenSSL Related Binary Distributions&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Product&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | URL&lt;br /&gt;
|-&lt;br /&gt;
| OpenSSL for Windows&lt;br /&gt;
| Works with MSVC++, Builder 3/4/5, and MinGW. Comes in form of self-install executables.&lt;br /&gt;
| https://slproweb.com/products/Win32OpenSSL.html&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| OpenSSL for Windows&lt;br /&gt;
| Pre-compiled Win32/64 libraries without external dependencies to the Microsoft Visual Studio Runtime DLLs, except for the system provided msvcrt.dll.&lt;br /&gt;
| https://indy.fulgan.com/SSL/&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| OpenSSL for Windows&lt;br /&gt;
| Reproducible builds with latest MinGW-w64, 64/32-bit, static/dynamic libs and executable.&lt;br /&gt;
| https://github.com/curl/curl-for-win&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| OpenSSL for Solaris&lt;br /&gt;
| Versions for Solaris 2.5 - 11 SPARC and X86&lt;br /&gt;
| http://www.unixpackages.com/&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| OpensSSL for Windows, Linux, OSX, Android&lt;br /&gt;
| Pre-compiled packages at conan.io package manager:&amp;lt;br&amp;gt;''Windows'' x86/x86_64 (Visual Studio 10, 12, 14, 15) &amp;lt;br&amp;gt;''Linux'' x86/x86_64 (gcc 4.6, 4.8, 4.9, 5, 6, 7) &amp;lt;br&amp;gt;''OSx'' (Apple clang). &amp;lt;br&amp;gt;Cross-building ready recipe: Linux ARM, Android.&lt;br /&gt;
| https://www.conan.io&amp;lt;br&amp;gt;https://conan.io/center/openssl&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| OpenSSL for Windows&lt;br /&gt;
| Pre-compiled Win32/64 1.0.2, 1.1.0 and 1.1.1 libraries without external dependencies, primarily built for François Piette's Internet Component Suite (ICS) for Embarcadero (Borland) Delphi and C++ development tools, but may be used for any Windows applications.  The OpenSSL DLLs and EXE files are digitally code signed 'Open Source Developer, François PIETTE', so applications can self verify them for corruption.   &lt;br /&gt;
| http://wiki.overbyte.eu/wiki/index.php/ICS_Download&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| OpenSSL for Windows&lt;br /&gt;
| Pre-compiled 64-bit (x64) and 32-bit (x86) 1.1.1 executables and libraries for Microsoft Windows Operating Systems with a dependency on the Microsoft Visual Studio 2015-2019 runtime. The distribution may be used standalone or integrated into any Windows application. The distribution's EXE and DLL files are digitally signed 'FireDaemon Technologies Limited'.&lt;br /&gt;
| [https://kb.firedaemon.com/support/solutions/articles/4000121705 https://kb.firedaemon.com/support/solutions/articles/4000121705]&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| OpenSSL for NonStop&lt;br /&gt;
| Pre-compiled NonStop ia64/x86 1.0.2, 1.1.1 executables and libraries for the HPE NonStop Operating Systems. Threaded versions are included. The SPT version depends on FLOSS, otherwise there are no other dependencies. 32-bit versions are available. The builds are done by the ITUGLIB Technical Committee as part of Connect.&lt;br /&gt;
| [https://ituglib.connect-community.org/apps/Ituglib/SrchOpenSrcLib.xhtml https://ituglib.connect-community.org/apps/Ituglib/SrchOpenSrcLib.xhtml]&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Engines=&lt;br /&gt;
&lt;br /&gt;
Some third parties provide OpenSSL compatible engines. As for the binaries above the following disclaimer applies:&lt;br /&gt;
&lt;br /&gt;
'''Important Disclaimer''':&lt;br /&gt;
''The listing of these third party products does not imply any endorsement by the OpenSSL project, and these organizations are not affiliated in any way with OpenSSL other than by the reference to their independent web sites here. In particular any donations or payments to any of these organizations will not be known to, seen by, or in any way benefit the OpenSSL project.''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Third Party OpenSSL compatible engines&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Product&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | URL&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| Intel® QuickAssist Technology engine&lt;br /&gt;
| Intel® QuickAssist Technology (http://www.intel.com/content/www/us/en/embedded/technology/quickassist/overview.html) provides acceleration for a number of cryptographic algorithms. QAT_engine adds support for Intel® QuickAssist Technology to OpenSSL-1.1.0 via the ENGINE framework. The definitive list of algorithms exposed into OpenSSL (a subset of those supported in the device) is defined on the associated github page.&lt;br /&gt;
| https://github.com/01org/QAT_Engine&lt;br /&gt;
|-&lt;br /&gt;
| ATECCX08 engine&lt;br /&gt;
| Support for the Atmel ATECC508A (http://www.atmel.com/devices/ATECC508A.aspx) hardware to provide secure key storage, ECC cryptographic calculations for the ECC NIST P-256 curve, and FIPS certified hardware Random Number Generator.&lt;br /&gt;
| https://github.com/AtmelCSO/cryptoauth-openssl-engine&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| GOST engine&lt;br /&gt;
| A reference implementation of the Russian GOST crypto algorithms for OpenSSL. The presence of this engine also enables the built-in OpenSSL support for GOST TLS ciphersuites. (Note: this engine is for OpenSSL version 1.1.0 and above. Previous versions of OpenSSL used a built-in GOST engine)&lt;br /&gt;
| https://github.com/gost-engine/engine&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| ISARA Radiate Solution Suite OpenSSL Connector&lt;br /&gt;
| Commercially available engine and source code patch for OpenSSL 1.0.2 branch.  The ISARA Radiate OpenSSL Connector lets you implement OpenSSL using quantum safe algorithms. ISARA Radiate (https://www.isara.com/isara-radiate/) gives you the cryptographic building blocks to create applications that will resist attacks by quantum computers.&lt;br /&gt;
| https://www.isara.com/openssl/1/&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| BEE2EVP engine&lt;br /&gt;
| Implements the Belarusian national cryptography: symmetric and public-key encryption, MAC, AEAD, hashing, digital signature. Encapsulates the Bee2 core cryptographic library into OpenSSL using the EVP interface.&lt;br /&gt;
| https://github.com/bcrypto/bee2evp&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3165</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3165"/>
		<updated>2021-03-18T12:08:12Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Loading the FIPS module at the same time as other providers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
One of the standard providers available is the FIPS provider. This makes available FIPS validated cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
* The RAND_DRBG subsystem has been removed.  The new EVP_RAND is a partial replacement: the DRBG callback framework is absent.&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OSSL_LIB_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OSSL_LIB_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
'''Note:''' ''In alpha releases of OpenSSL 3.0.0 up until alpha6, the OSSL_LIB_CTX was called OPENSSL_CTX. It was renamed for OpenSSL 3.0.0 alpha7. If you are still using an alpha6 release or earlier, take a look at this [https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;amp;oldid=3119 older version of the wiki page].''&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OSSL_LIB_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OSSL_LIB_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OSSL_LIB_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OSSL_LIB_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the high level APIs a provider is selected. It is that provider implementation that actually does the required work. There are five providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The base provider. This contains a small sub-set of non-cryptographic algorithms available in the default provider. For example algorithms to encode and decode keys to files. If you do not load the default provider then you should always load this one instead (including if you are using the FIPS provider).&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any&lt;br /&gt;
legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the high level APIs, such as EVP, instead)&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
All of the above APIs are deprecated in OpenSSL 3.0 - so a simple rule is to&lt;br /&gt;
avoid using all deprecated functions.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they can automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
 base = base_sect&lt;br /&gt;
 &lt;br /&gt;
 [base_sect]&lt;br /&gt;
 activate = 1&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour. Note that this configuration also activates the &amp;quot;base&amp;quot; provider. The base provider does not include any cryptographic algorithms (and therefore does not impact the validation status of any cryptographic operations), but does include other supporting algorithms that may be required. It is designed to be used in conjunction with the FIPS module.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain deprecated APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot; (note that setting this value to 0 is not sufficient). This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
        OSSL_PROVIDER *base;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        base = OSSL_PROVIDER_load(NULL, &amp;quot;base&amp;quot;);&lt;br /&gt;
        if (base == NULL) {&lt;br /&gt;
            OSSL_PROVIDER_unload(fips);&lt;br /&gt;
            printf(&amp;quot;Failed to load base provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(base);&lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Also note that in this example we have additionally loaded the &amp;quot;base&amp;quot; provider. This loads a sub-set of algorithms that are also available in the default provider - specifically non cryptographic ones which may be used in conjunction with the FIPS provider. For example this contains algorithms for encoding and decoding keys. If you decide not to load the default provider then you will usually want to load the base provider instead.&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. The local property query overrides the default properties if the same property name is specified in both.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default and base providers that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the encoder and decoder algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The encoder and decoder algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;. Note that this config file does not load the &amp;quot;base&amp;quot; provider. All supporting algorithms that are in &amp;quot;base&amp;quot; are also in &amp;quot;default&amp;quot;, so it is unnecessary in this case:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS and base providers. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OSSL_LIB_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    nonfipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS and base providers so we&lt;br /&gt;
     * don't need to explicitly load them here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OSSL_LIB_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OSSL_LIB_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OSSL_LIB_CTX_free(fipslibctx);&lt;br /&gt;
    OSSL_LIB_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Encoders and Decoders with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Encoders and decoders are used to read and write keys or parameters from or to some external format (for example a PEM file). If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a encoder to do this. Similarly you need a decoder to read previously saved keys and parameters. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate encoder/decoder will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL encoder and decoder are implemented in both the default and base providers and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these encoder/decoder have the &amp;quot;fips=yes&amp;quot; property against them. You should ensure that either the default or base provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties and the default library context to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_ex(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use the same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_ex(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_ex(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as encoders from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_ex(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_ex(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithms. Here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_ENCODER                         || 100%               || 100%&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_DECODER                         || 100%               || 100%&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented encoder / decoder ====&lt;br /&gt;
&lt;br /&gt;
===== Encoders =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Encoder                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Decoders =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Decoder                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on decoders&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider encoders for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3164</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3164"/>
		<updated>2021-03-17T10:39:30Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Using the FIPS module in SSL/TLS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
One of the standard providers available is the FIPS provider. This makes available FIPS validated cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
* The RAND_DRBG subsystem has been removed.  The new EVP_RAND is a partial replacement: the DRBG callback framework is absent.&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OSSL_LIB_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OSSL_LIB_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
'''Note:''' ''In alpha releases of OpenSSL 3.0.0 up until alpha6, the OSSL_LIB_CTX was called OPENSSL_CTX. It was renamed for OpenSSL 3.0.0 alpha7. If you are still using an alpha6 release or earlier, take a look at this [https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;amp;oldid=3119 older version of the wiki page].''&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OSSL_LIB_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OSSL_LIB_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OSSL_LIB_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OSSL_LIB_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the high level APIs a provider is selected. It is that provider implementation that actually does the required work. There are five providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The base provider. This contains a small sub-set of non-cryptographic algorithms available in the default provider. For example algorithms to encode and decode keys to files. If you do not load the default provider then you should always load this one instead (including if you are using the FIPS provider).&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any&lt;br /&gt;
legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the high level APIs, such as EVP, instead)&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
All of the above APIs are deprecated in OpenSSL 3.0 - so a simple rule is to&lt;br /&gt;
avoid using all deprecated functions.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they can automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
 base = base_sect&lt;br /&gt;
 &lt;br /&gt;
 [base_sect]&lt;br /&gt;
 activate = 1&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour. Note that this configuration also activates the &amp;quot;base&amp;quot; provider. The base provider does not include any cryptographic algorithms (and therefore does not impact the validation status of any cryptographic operations), but does include other supporting algorithms that may be required. It is designed to be used in conjunction with the FIPS module.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain deprecated APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot; (note that setting this value to 0 is not sufficient). This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
        OSSL_PROVIDER *base;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        base = OSSL_PROVIDER_load(NULL, &amp;quot;base&amp;quot;);&lt;br /&gt;
        if (base == NULL) {&lt;br /&gt;
            OSSL_PROVIDER_unload(fips);&lt;br /&gt;
            printf(&amp;quot;Failed to load base provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(base);&lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Also note that in this example we have additionally loaded the &amp;quot;base&amp;quot; provider. This loads a sub-set of algorithms that are also available in the default provider - specifically non cryptographic ones which may be used in conjunction with the FIPS provider. For example this contains algorithms for encoding and decoding keys. If you decide not to load the default provider then you will usually want to load the base provider instead.&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default and base providers that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the encoder and decoder algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The encoder and decoder algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;. Note that this config file does not load the &amp;quot;base&amp;quot; provider. All supporting algorithms that are in &amp;quot;base&amp;quot; are also in &amp;quot;default&amp;quot;, so it is unnecessary in this case:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS and base providers. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OSSL_LIB_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    nonfipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS and base providers so we&lt;br /&gt;
     * don't need to explicitly load them here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OSSL_LIB_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OSSL_LIB_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OSSL_LIB_CTX_free(fipslibctx);&lt;br /&gt;
    OSSL_LIB_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Encoders and Decoders with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Encoders and decoders are used to read and write keys or parameters from or to some external format (for example a PEM file). If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a encoder to do this. Similarly you need a decoder to read previously saved keys and parameters. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate encoder/decoder will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL encoder and decoder are implemented in both the default and base providers and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these encoder/decoder have the &amp;quot;fips=yes&amp;quot; property against them. You should ensure that either the default or base provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties and the default library context to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_ex(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use the same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_ex(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_ex(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as encoders from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_ex(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_ex(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithms. Here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_ENCODER                         || 100%               || 100%&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_DECODER                         || 100%               || 100%&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented encoder / decoder ====&lt;br /&gt;
&lt;br /&gt;
===== Encoders =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Encoder                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Decoders =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Decoder                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on decoders&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider encoders for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3163</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3163"/>
		<updated>2021-03-17T10:38:23Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Making all applications use the FIPS module by default */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
One of the standard providers available is the FIPS provider. This makes available FIPS validated cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
* The RAND_DRBG subsystem has been removed.  The new EVP_RAND is a partial replacement: the DRBG callback framework is absent.&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OSSL_LIB_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OSSL_LIB_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
'''Note:''' ''In alpha releases of OpenSSL 3.0.0 up until alpha6, the OSSL_LIB_CTX was called OPENSSL_CTX. It was renamed for OpenSSL 3.0.0 alpha7. If you are still using an alpha6 release or earlier, take a look at this [https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;amp;oldid=3119 older version of the wiki page].''&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OSSL_LIB_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OSSL_LIB_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OSSL_LIB_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OSSL_LIB_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the high level APIs a provider is selected. It is that provider implementation that actually does the required work. There are five providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The base provider. This contains a small sub-set of non-cryptographic algorithms available in the default provider. For example algorithms to encode and decode keys to files. If you do not load the default provider then you should always load this one instead (including if you are using the FIPS provider).&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any&lt;br /&gt;
legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the high level APIs, such as EVP, instead)&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
All of the above APIs are deprecated in OpenSSL 3.0 - so a simple rule is to&lt;br /&gt;
avoid using all deprecated functions.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they can automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
 base = base_sect&lt;br /&gt;
 &lt;br /&gt;
 [base_sect]&lt;br /&gt;
 activate = 1&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour. Note that this configuration also activates the &amp;quot;base&amp;quot; provider. The base provider does not include any cryptographic algorithms (and therefore does not impact the validation status of any cryptographic operations), but does include other supporting algorithms that may be required. It is designed to be used in conjunction with the FIPS module.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain deprecated APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot; (note that setting this value to 0 is not sufficient). This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
        OSSL_PROVIDER *base;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        base = OSSL_PROVIDER_load(NULL, &amp;quot;base&amp;quot;);&lt;br /&gt;
        if (base == NULL) {&lt;br /&gt;
            OSSL_PROVIDER_unload(fips);&lt;br /&gt;
            printf(&amp;quot;Failed to load base provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(base);&lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Also note that in this example we have additionally loaded the &amp;quot;base&amp;quot; provider. This loads a sub-set of algorithms that are also available in the default provider - specifically non cryptographic ones which may be used in conjunction with the FIPS provider. For example this contains algorithms for encoding and decoding keys. If you decide not to load the default provider then you will usually want to load the base provider instead.&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default and base providers that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the encoder and decoder algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The encoder and decoder algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;. Note that this config file does not load the &amp;quot;base&amp;quot; provider. All supporting algorithms that are in &amp;quot;base&amp;quot; are also in &amp;quot;default&amp;quot;, so it is unnecessary in this case:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS and base providers. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OSSL_LIB_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    nonfipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS and base providers so we&lt;br /&gt;
     * don't need to explicitly load them here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OSSL_LIB_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OSSL_LIB_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OSSL_LIB_CTX_free(fipslibctx);&lt;br /&gt;
    OSSL_LIB_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Encoders and Decoders with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Encoders and decoders are used to read and write keys or parameters from or to some external format (for example a PEM file). If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a encoder to do this. Similarly you need a decoder to read previously saved keys and parameters. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate encoder/decoder will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL encoder and decoder are implemented in both the default and base providers and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these encoder/decoder have the &amp;quot;fips=yes&amp;quot; property against them. You should ensure that either the default or base provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties and the default library context to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_ex(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_ex(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_ex(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as encoders from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_ex(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_ex(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithms. Here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_ENCODER                         || 100%               || 100%&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_DECODER                         || 100%               || 100%&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented encoder / decoder ====&lt;br /&gt;
&lt;br /&gt;
===== Encoders =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Encoder                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Decoders =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Decoder                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on decoders&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider encoders for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3162</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3162"/>
		<updated>2021-03-16T15:29:00Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Confirming that an algorithm is being provided by the FIPS module */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
One of the standard providers available is the FIPS provider. This makes available FIPS validated cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
* The RAND_DRBG subsystem has been removed.  The new EVP_RAND is a partial replacement: the DRBG callback framework is absent.&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OSSL_LIB_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OSSL_LIB_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
'''Note:''' ''In alpha releases of OpenSSL 3.0.0 up until alpha6, the OSSL_LIB_CTX was called OPENSSL_CTX. It was renamed for OpenSSL 3.0.0 alpha7. If you are still using an alpha6 release or earlier, take a look at this [https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;amp;oldid=3119 older version of the wiki page].''&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OSSL_LIB_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OSSL_LIB_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OSSL_LIB_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OSSL_LIB_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the high level APIs a provider is selected. It is that provider implementation that actually does the required work. There are five providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The base provider. This contains a small sub-set of non-cryptographic algorithms available in the default provider. For example algorithms to encode and decode keys to files. If you do not load the default provider then you should always load this one instead (including if you are using the FIPS provider).&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any&lt;br /&gt;
legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the high level APIs, such as EVP, instead)&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
All of the above APIs are deprecated in OpenSSL 3.0 - so a simple rule is to&lt;br /&gt;
avoid using all deprecated functions.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
 base = base_sect&lt;br /&gt;
 &lt;br /&gt;
 [base_sect]&lt;br /&gt;
 activate = 1&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour. Note that this configuration also activates the &amp;quot;base&amp;quot; provider. The base provider does not include any cryptographic algorithms (and therefore does not impact the validation status of any cryptographic operations), but does include other supporting algorithms that may be required. It is designed to be used in conjunction with the FIPS module.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain deprecated APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot; (note that setting this value to 0 is not sufficient). This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
        OSSL_PROVIDER *base;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        base = OSSL_PROVIDER_load(NULL, &amp;quot;base&amp;quot;);&lt;br /&gt;
        if (base == NULL) {&lt;br /&gt;
            OSSL_PROVIDER_unload(fips);&lt;br /&gt;
            printf(&amp;quot;Failed to load base provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(base);&lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Also note that in this example we have additionally loaded the &amp;quot;base&amp;quot; provider. This loads a sub-set of algorithms that are also available in the default provider - specifically non cryptographic ones which may be used in conjunction with the FIPS provider. For example this contains algorithms for encoding and decoding keys. If you decide not to load the default provider then you will usually want to load the base provider instead.&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default and base providers that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the encoder and decoder algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The encoder and decoder algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;. Note that this config file does not load the &amp;quot;base&amp;quot; provider. All supporting algorithms that are in &amp;quot;base&amp;quot; are also in &amp;quot;default&amp;quot;, so it is unnecessary in this case:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS and base providers. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OSSL_LIB_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    nonfipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS and base providers so we&lt;br /&gt;
     * don't need to explicitly load them here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OSSL_LIB_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OSSL_LIB_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OSSL_LIB_CTX_free(fipslibctx);&lt;br /&gt;
    OSSL_LIB_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Encoders and Decoders with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Encoders and decoders are used to read and write keys or parameters from or to some external format (for example a PEM file). If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a encoder to do this. Similarly you need a decoder to read previously saved keys and parameters. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate encoder/decoder will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL encoder and decoder are implemented in both the default and base providers and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these encoder/decoder have the &amp;quot;fips=yes&amp;quot; property against them. You should ensure that either the default or base provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties and the default library context to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_ex(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_ex(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_ex(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as encoders from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_ex(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_ex(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithms. Here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_ENCODER                         || 100%               || 100%&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_DECODER                         || 100%               || 100%&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented encoder / decoder ====&lt;br /&gt;
&lt;br /&gt;
===== Encoders =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Encoder                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Decoders =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Decoder                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on decoders&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider encoders for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3161</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3161"/>
		<updated>2021-03-16T15:21:56Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Programmatically loading the FIPS module (default library context) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
One of the standard providers available is the FIPS provider. This makes available FIPS validated cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
* The RAND_DRBG subsystem has been removed.  The new EVP_RAND is a partial replacement: the DRBG callback framework is absent.&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OSSL_LIB_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OSSL_LIB_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
'''Note:''' ''In alpha releases of OpenSSL 3.0.0 up until alpha6, the OSSL_LIB_CTX was called OPENSSL_CTX. It was renamed for OpenSSL 3.0.0 alpha7. If you are still using an alpha6 release or earlier, take a look at this [https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;amp;oldid=3119 older version of the wiki page].''&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OSSL_LIB_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OSSL_LIB_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OSSL_LIB_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OSSL_LIB_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the high level APIs a provider is selected. It is that provider implementation that actually does the required work. There are five providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The base provider. This contains a small sub-set of non-cryptographic algorithms available in the default provider. For example algorithms to encode and decode keys to files. If you do not load the default provider then you should always load this one instead (including if you are using the FIPS provider).&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any&lt;br /&gt;
legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the high level APIs, such as EVP, instead)&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
All of the above APIs are deprecated in OpenSSL 3.0 - so a simple rule is to&lt;br /&gt;
avoid using all deprecated functions.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
 base = base_sect&lt;br /&gt;
 &lt;br /&gt;
 [base_sect]&lt;br /&gt;
 activate = 1&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour. Note that this configuration also activates the &amp;quot;base&amp;quot; provider. The base provider does not include any cryptographic algorithms (and therefore does not impact the validation status of any cryptographic operations), but does include other supporting algorithms that may be required. It is designed to be used in conjunction with the FIPS module.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain deprecated APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot; (note that setting this value to 0 is not sufficient). This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
        OSSL_PROVIDER *base;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        base = OSSL_PROVIDER_load(NULL, &amp;quot;base&amp;quot;);&lt;br /&gt;
        if (base == NULL) {&lt;br /&gt;
            OSSL_PROVIDER_unload(fips);&lt;br /&gt;
            printf(&amp;quot;Failed to load base provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(base);&lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Also note that in this example we have additionally loaded the &amp;quot;base&amp;quot; provider. This loads a sub-set of algorithms that are also available in the default provider - specifically non cryptographic ones which may be used in conjunction with the FIPS provider. For example this contains algorithms for encoding and decoding keys. If you decide not to load the default provider then you will usually want to load the base provider instead.&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default and base providers that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the encoder and decoder algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The encoder and decoder algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;. Note that this config file does not load the &amp;quot;base&amp;quot; provider. All supporting algorithms that are in &amp;quot;base&amp;quot; are also in &amp;quot;default&amp;quot;, so it is unnecessary in this case:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS and base providers. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OSSL_LIB_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    nonfipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS and base providers so we&lt;br /&gt;
     * don't need to explicitly load them here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OSSL_LIB_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OSSL_LIB_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OSSL_LIB_CTX_free(fipslibctx);&lt;br /&gt;
    OSSL_LIB_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Encoders and Decoders with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Encoders and decoders are used to read and write keys or parameters from or to some external format (for example a PEM file). If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a encoder to do this. Similarly you need a decoder to read previously saved keys and parameters. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate encoder/decoder will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL encoder and decoder are implemented in both the default and base providers and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these encoder/decoder have the &amp;quot;fips=yes&amp;quot; property against them. You should ensure that either the default or base provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties and the default library context to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_ex(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_ex(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_ex(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as encoders from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_ex(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_ex(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithm, here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_ENCODER                         || 100%               || 100%&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_DECODER                         || 100%               || 100%&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented encoder / decoder ====&lt;br /&gt;
&lt;br /&gt;
===== Encoders =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Encoder                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Decoders =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Decoder                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on decoders&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider encoders for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3160</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3160"/>
		<updated>2021-03-16T15:12:24Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Using the FIPS module in SSL/TLS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
One of the standard providers available is the FIPS provider. This makes available FIPS validated cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
* The RAND_DRBG subsystem has been removed.  The new EVP_RAND is a partial replacement: the DRBG callback framework is absent.&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OSSL_LIB_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OSSL_LIB_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
'''Note:''' ''In alpha releases of OpenSSL 3.0.0 up until alpha6, the OSSL_LIB_CTX was called OPENSSL_CTX. It was renamed for OpenSSL 3.0.0 alpha7. If you are still using an alpha6 release or earlier, take a look at this [https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;amp;oldid=3119 older version of the wiki page].''&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OSSL_LIB_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OSSL_LIB_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OSSL_LIB_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OSSL_LIB_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the high level APIs a provider is selected. It is that provider implementation that actually does the required work. There are five providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The base provider. This contains a small sub-set of non-cryptographic algorithms available in the default provider. For example algorithms to encode and decode keys to files. If you do not load the default provider then you should always load this one instead (including if you are using the FIPS provider).&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any&lt;br /&gt;
legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the high level APIs, such as EVP, instead)&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
All of the above APIs are deprecated in OpenSSL 3.0 - so a simple rule is to&lt;br /&gt;
avoid using all deprecated functions.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
 base = base_sect&lt;br /&gt;
 &lt;br /&gt;
 [base_sect]&lt;br /&gt;
 activate = 1&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour. Note that this configuration also activates the &amp;quot;base&amp;quot; provider. The base provider does not include any cryptographic algorithms (and therefore does not impact the validation status of any cryptographic operations), but does include other supporting algorithms that may be required. It is designed to be used in conjunction with the FIPS module.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain deprecated APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
        OSSL_PROVIDER *base;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        base = OSSL_PROVIDER_load(NULL, &amp;quot;base&amp;quot;);&lt;br /&gt;
        if (base == NULL) {&lt;br /&gt;
            OSSL_PROVIDER_unload(fips);&lt;br /&gt;
            printf(&amp;quot;Failed to load base provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(base);&lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Also note that in this example we have additionally loaded the &amp;quot;base&amp;quot; provider. This loads a sub-set of algorithms that are also available in the default provider - specifically non cryptographic ones which may be used in conjunction with the FIPS provider. For example this contains algorithms for encoding and decoding keys. If you decide not to load the default provider then you will usually want to load the base provider instead.&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default and base providers that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the encoder and decoder algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The encoder and decoder algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;. Note that this config file does not load the &amp;quot;base&amp;quot; provider. All supporting algorithms that are in &amp;quot;base&amp;quot; are also in &amp;quot;default&amp;quot;, so it is unnecessary in this case:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS and base providers. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OSSL_LIB_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    nonfipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS and base providers so we&lt;br /&gt;
     * don't need to explicitly load them here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OSSL_LIB_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OSSL_LIB_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OSSL_LIB_CTX_free(fipslibctx);&lt;br /&gt;
    OSSL_LIB_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Encoders and Decoders with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Encoders and decoders are used to read and write keys or parameters from or to some external format (for example a PEM file). If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a encoder to do this. Similarly you need a decoder to read previously saved keys and parameters. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate encoder/decoder will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL encoder and decoder are implemented in both the default and base providers and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these encoder/decoder have the &amp;quot;fips=yes&amp;quot; property against them. You should ensure that either the default or base provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties and the default library context to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_ex(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_ex(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_ex(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as encoders from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_ex(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_ex(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithm, here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_ENCODER                         || 100%               || 100%&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_DECODER                         || 100%               || 100%&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented encoder / decoder ====&lt;br /&gt;
&lt;br /&gt;
===== Encoders =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Encoder                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Decoders =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Decoder                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on decoders&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider encoders for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3159</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3159"/>
		<updated>2021-03-16T15:08:00Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Using the FIPS module in SSL/TLS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
One of the standard providers available is the FIPS provider. This makes available FIPS validated cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
* The RAND_DRBG subsystem has been removed.  The new EVP_RAND is a partial replacement: the DRBG callback framework is absent.&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OSSL_LIB_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OSSL_LIB_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
'''Note:''' ''In alpha releases of OpenSSL 3.0.0 up until alpha6, the OSSL_LIB_CTX was called OPENSSL_CTX. It was renamed for OpenSSL 3.0.0 alpha7. If you are still using an alpha6 release or earlier, take a look at this [https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;amp;oldid=3119 older version of the wiki page].''&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OSSL_LIB_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OSSL_LIB_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OSSL_LIB_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OSSL_LIB_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the high level APIs a provider is selected. It is that provider implementation that actually does the required work. There are five providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The base provider. This contains a small sub-set of non-cryptographic algorithms available in the default provider. For example algorithms to encode and decode keys to files. If you do not load the default provider then you should always load this one instead (including if you are using the FIPS provider).&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any&lt;br /&gt;
legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the high level APIs, such as EVP, instead)&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
All of the above APIs are deprecated in OpenSSL 3.0 - so a simple rule is to&lt;br /&gt;
avoid using all deprecated functions.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
 base = base_sect&lt;br /&gt;
 &lt;br /&gt;
 [base_sect]&lt;br /&gt;
 activate = 1&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour. Note that this configuration also activates the &amp;quot;base&amp;quot; provider. The base provider does not include any cryptographic algorithms (and therefore does not impact the validation status of any cryptographic operations), but does include other supporting algorithms that may be required. It is designed to be used in conjunction with the FIPS module.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain deprecated APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
        OSSL_PROVIDER *base;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        base = OSSL_PROVIDER_load(NULL, &amp;quot;base&amp;quot;);&lt;br /&gt;
        if (base == NULL) {&lt;br /&gt;
            OSSL_PROVIDER_unload(fips);&lt;br /&gt;
            printf(&amp;quot;Failed to load base provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(base);&lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Also note that in this example we have additionally loaded the &amp;quot;base&amp;quot; provider. This loads a sub-set of algorithms that are also available in the default provider - specifically non cryptographic ones which may be used in conjunction with the FIPS provider. For example this contains algorithms for encoding and decoding keys. If you decide not to load the default provider then you will usually want to load the base provider instead.&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default and base providers that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the encoder and decoder algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The encoder and decoder algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;. Note that this config file does not load the &amp;quot;base&amp;quot; provider. All supporting algorithms that are in &amp;quot;base&amp;quot; are also in &amp;quot;default&amp;quot;, so it is unnecessary in this case:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS and base providers. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OSSL_LIB_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    nonfipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS and base providers so we&lt;br /&gt;
     * don't need to explicitly load them here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OSSL_LIB_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OSSL_LIB_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OSSL_LIB_CTX_free(fipslibctx);&lt;br /&gt;
    OSSL_LIB_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Encoders and Decoders with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Encoders and decoders are used to read and write keys or parameters from or to some external format (for example a PEM file). If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a encoder to do this. Similarly you need a decoder to read previously saved keys and parameters. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate encoder/decoder will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL encoder and decoder are implemented in both the default and base providers and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these encoder/decoder have the &amp;quot;fips=yes&amp;quot; property against them. You should ensure that either the default or base provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties and the default library context to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as encoders from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithm, here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_ENCODER                         || 100%               || 100%&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_DECODER                         || 100%               || 100%&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented encoder / decoder ====&lt;br /&gt;
&lt;br /&gt;
===== Encoders =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Encoder                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Decoders =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Decoder                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on decoders&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider encoders for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3158</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3158"/>
		<updated>2021-03-16T15:06:09Z</updated>

		<summary type="html">&lt;p&gt;Matt: Rename serializers/deserializers to encoders/decoders&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
One of the standard providers available is the FIPS provider. This makes available FIPS validated cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
* The RAND_DRBG subsystem has been removed.  The new EVP_RAND is a partial replacement: the DRBG callback framework is absent.&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OSSL_LIB_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OSSL_LIB_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
'''Note:''' ''In alpha releases of OpenSSL 3.0.0 up until alpha6, the OSSL_LIB_CTX was called OPENSSL_CTX. It was renamed for OpenSSL 3.0.0 alpha7. If you are still using an alpha6 release or earlier, take a look at this [https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;amp;oldid=3119 older version of the wiki page].''&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OSSL_LIB_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OSSL_LIB_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OSSL_LIB_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OSSL_LIB_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the high level APIs a provider is selected. It is that provider implementation that actually does the required work. There are five providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The base provider. This contains a small sub-set of non-cryptographic algorithms available in the default provider. For example algorithms to encode and decode keys to files. If you do not load the default provider then you should always load this one instead (including if you are using the FIPS provider).&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any&lt;br /&gt;
legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the high level APIs, such as EVP, instead)&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
All of the above APIs are deprecated in OpenSSL 3.0 - so a simple rule is to&lt;br /&gt;
avoid using all deprecated functions.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
 base = base_sect&lt;br /&gt;
 &lt;br /&gt;
 [base_sect]&lt;br /&gt;
 activate = 1&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour. Note that this configuration also activates the &amp;quot;base&amp;quot; provider. The base provider does not include any cryptographic algorithms (and therefore does not impact the validation status of any cryptographic operations), but does include other supporting algorithms that may be required. It is designed to be used in conjunction with the FIPS module.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain deprecated APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
        OSSL_PROVIDER *base;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        base = OSSL_PROVIDER_load(NULL, &amp;quot;base&amp;quot;);&lt;br /&gt;
        if (base == NULL) {&lt;br /&gt;
            OSSL_PROVIDER_unload(fips);&lt;br /&gt;
            printf(&amp;quot;Failed to load base provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(base);&lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Also note that in this example we have additionally loaded the &amp;quot;base&amp;quot; provider. This loads a sub-set of algorithms that are also available in the default provider - specifically non cryptographic ones which may be used in conjunction with the FIPS provider. For example this contains algorithms for encoding and decoding keys. If you decide not to load the default provider then you will usually want to load the base provider instead.&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default and base providers that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the encoder and decoder algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The encoder and decoder algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;. Note that this config file does not load the &amp;quot;base&amp;quot; provider. All supporting algorithms that are in &amp;quot;base&amp;quot; are also in &amp;quot;default&amp;quot;, so it is unnecessary in this case:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS and base providers. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OSSL_LIB_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    nonfipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS and base providers so we&lt;br /&gt;
     * don't need to explicitly load them here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OSSL_LIB_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OSSL_LIB_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OSSL_LIB_CTX_free(fipslibctx);&lt;br /&gt;
    OSSL_LIB_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Encoders and Decoders with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Encoders and decoders are used to read and write keys or parameters from or to some external format (for example a PEM file). If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a encoder to do this. Similarly you need a decoder to read previously saved keys and parameters. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate encoder/decoder will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL encoder and decoder are implemented in both the default and base providers and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these encoder/decoder have the &amp;quot;fips=yes&amp;quot; property against them. You should ensure that either the default or base provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as encoders from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithm, here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_ENCODER                         || 100%               || 100%&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_DECODER                         || 100%               || 100%&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented encoder / decoder ====&lt;br /&gt;
&lt;br /&gt;
===== Encoders =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Encoder                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Decoders =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Decoder                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on decoders&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider encoders for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3157</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3157"/>
		<updated>2021-03-16T14:46:32Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Using the FIPS Module in applications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
One of the standard providers available is the FIPS provider. This makes available FIPS validated cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
* The RAND_DRBG subsystem has been removed.  The new EVP_RAND is a partial replacement: the DRBG callback framework is absent.&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OSSL_LIB_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OSSL_LIB_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
'''Note:''' ''In alpha releases of OpenSSL 3.0.0 up until alpha6, the OSSL_LIB_CTX was called OPENSSL_CTX. It was renamed for OpenSSL 3.0.0 alpha7. If you are still using an alpha6 release or earlier, take a look at this [https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;amp;oldid=3119 older version of the wiki page].''&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OSSL_LIB_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OSSL_LIB_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OSSL_LIB_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OSSL_LIB_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the high level APIs a provider is selected. It is that provider implementation that actually does the required work. There are five providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The base provider. This contains a small sub-set of non-cryptographic algorithms available in the default provider. For example algorithms to serialize and deserialize keys to files. If you do not load the default provider then you should always load this one instead (including if you are using the FIPS provider).&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any&lt;br /&gt;
legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the high level APIs, such as EVP, instead)&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
All of the above APIs are deprecated in OpenSSL 3.0 - so a simple rule is to&lt;br /&gt;
avoid using all deprecated functions.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
 base = base_sect&lt;br /&gt;
 &lt;br /&gt;
 [base_sect]&lt;br /&gt;
 activate = 1&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour. Note that this configuration also activates the &amp;quot;base&amp;quot; provider. The base provider does not include any cryptographic algorithms (and therefore does not impact the validation status of any cryptographic operations), but does include other supporting algorithms that may be required. It is designed to be used in conjunction with the FIPS module.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain deprecated APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
        OSSL_PROVIDER *base;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        base = OSSL_PROVIDER_load(NULL, &amp;quot;base&amp;quot;);&lt;br /&gt;
        if (base == NULL) {&lt;br /&gt;
            OSSL_PROVIDER_unload(fips);&lt;br /&gt;
            printf(&amp;quot;Failed to load base provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(base);&lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Also note that in this example we have additionally loaded the &amp;quot;base&amp;quot; provider. This loads a sub-set of algorithms that are also available in the default provider - specifically non cryptographic ones which may be used in conjunction with the FIPS provider. For example this contains algorithms for serializing and de-serializing keys. If you decide not to load the default provider then you will usually want to load the base provider instead.&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default and base providers that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;. Note that this config file does not load the &amp;quot;base&amp;quot; provider. All supporting algorithms that are in &amp;quot;base&amp;quot; are also in &amp;quot;default&amp;quot;, so it is unnecessary in this case:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS and base providers. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OSSL_LIB_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    nonfipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS and base providers so we&lt;br /&gt;
     * don't need to explicitly load them here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OSSL_LIB_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OSSL_LIB_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OSSL_LIB_CTX_free(fipslibctx);&lt;br /&gt;
    OSSL_LIB_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers and Deserializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers and deserializers are used to read and write keys or parameters from or to some external format (for example a PEM file). If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. Similarly you need a deserializer to read previously saved keys and parameters. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer/deserializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers and deserializers are implemented in both the default and base providers and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers/deserializers have the &amp;quot;fips=yes&amp;quot; property against them. You should ensure that either the default or base provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithm, here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3156</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3156"/>
		<updated>2021-03-16T14:46:14Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Using the FIPS Module in applications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
One of the standard providers available is the FIPS provider. This makes available FIPS validated cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
* The RAND_DRBG subsystem has been removed.  The new EVP_RAND is a partial replacement: the DRBG callback framework is absent.&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OSSL_LIB_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OSSL_LIB_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
'''Note:''' ''In alpha releases of OpenSSL 3.0.0 up until alpha6, the OSSL_LIB_CTX was called OPENSSL_CTX. It was renamed for OpenSSL 3.0.0 alpha7. If you are still using an alpha6 release or earlier, take a look at this [https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;amp;oldid=3119 older version of the wiki page].''&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OSSL_LIB_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OSSL_LIB_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OSSL_LIB_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OSSL_LIB_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the high level APIs a provider is selected. It is that provider implementation that actually does the required work. There are five providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The base provider. This contains a small sub-set of non-cryptographic algorithms available in the default provider. For example algorithms to serialize and deserialize keys to files. If you do not load the default provider then you should always load this one instead (including if you are using the FIPS provider).&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any&lt;br /&gt;
legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the high level APIs, such as EVP, instead)&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example&lt;br /&gt;
  EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new,&lt;br /&gt;
  EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
All of the above APIs are deprecated in OpenSSL 3.0 - so a simple rule is to&lt;br /&gt;
avoid using all deprecated functions.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
 base = base_sect&lt;br /&gt;
 &lt;br /&gt;
 [base_sect]&lt;br /&gt;
 activate = 1&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour. Note that this configuration also activates the &amp;quot;base&amp;quot; provider. The base provider does not include any cryptographic algorithms (and therefore does not impact the validation status of any cryptographic operations), but does include other supporting algorithms that may be required. It is designed to be used in conjunction with the FIPS module.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain deprecated APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
        OSSL_PROVIDER *base;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        base = OSSL_PROVIDER_load(NULL, &amp;quot;base&amp;quot;);&lt;br /&gt;
        if (base == NULL) {&lt;br /&gt;
            OSSL_PROVIDER_unload(fips);&lt;br /&gt;
            printf(&amp;quot;Failed to load base provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(base);&lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Also note that in this example we have additionally loaded the &amp;quot;base&amp;quot; provider. This loads a sub-set of algorithms that are also available in the default provider - specifically non cryptographic ones which may be used in conjunction with the FIPS provider. For example this contains algorithms for serializing and de-serializing keys. If you decide not to load the default provider then you will usually want to load the base provider instead.&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default and base providers that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;. Note that this config file does not load the &amp;quot;base&amp;quot; provider. All supporting algorithms that are in &amp;quot;base&amp;quot; are also in &amp;quot;default&amp;quot;, so it is unnecessary in this case:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS and base providers. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OSSL_LIB_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    nonfipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS and base providers so we&lt;br /&gt;
     * don't need to explicitly load them here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OSSL_LIB_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OSSL_LIB_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OSSL_LIB_CTX_free(fipslibctx);&lt;br /&gt;
    OSSL_LIB_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers and Deserializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers and deserializers are used to read and write keys or parameters from or to some external format (for example a PEM file). If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. Similarly you need a deserializer to read previously saved keys and parameters. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer/deserializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers and deserializers are implemented in both the default and base providers and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers/deserializers have the &amp;quot;fips=yes&amp;quot; property against them. You should ensure that either the default or base provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithm, here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3155</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3155"/>
		<updated>2021-03-16T14:45:56Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Using the FIPS Module in applications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
One of the standard providers available is the FIPS provider. This makes available FIPS validated cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
* The RAND_DRBG subsystem has been removed.  The new EVP_RAND is a partial replacement: the DRBG callback framework is absent.&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OSSL_LIB_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OSSL_LIB_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
'''Note:''' ''In alpha releases of OpenSSL 3.0.0 up until alpha6, the OSSL_LIB_CTX was called OPENSSL_CTX. It was renamed for OpenSSL 3.0.0 alpha7. If you are still using an alpha6 release or earlier, take a look at this [https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;amp;oldid=3119 older version of the wiki page].''&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OSSL_LIB_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OSSL_LIB_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OSSL_LIB_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OSSL_LIB_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the high level APIs a provider is selected. It is that provider implementation that actually does the required work. There are five providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The base provider. This contains a small sub-set of non-cryptographic algorithms available in the default provider. For example algorithms to serialize and deserialize keys to files. If you do not load the default provider then you should always load this one instead (including if you are using the FIPS provider).&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any&lt;br /&gt;
legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
- Low level cryptographic APIs (use the high level APIs, such as EVP, instead)&lt;br /&gt;
- Engines&lt;br /&gt;
- Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example&lt;br /&gt;
  EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new,&lt;br /&gt;
  EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
All of the above APIs are deprecated in OpenSSL 3.0 - so a simple rule is to&lt;br /&gt;
avoid using all deprecated functions.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
 base = base_sect&lt;br /&gt;
 &lt;br /&gt;
 [base_sect]&lt;br /&gt;
 activate = 1&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour. Note that this configuration also activates the &amp;quot;base&amp;quot; provider. The base provider does not include any cryptographic algorithms (and therefore does not impact the validation status of any cryptographic operations), but does include other supporting algorithms that may be required. It is designed to be used in conjunction with the FIPS module.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain deprecated APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
        OSSL_PROVIDER *base;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        base = OSSL_PROVIDER_load(NULL, &amp;quot;base&amp;quot;);&lt;br /&gt;
        if (base == NULL) {&lt;br /&gt;
            OSSL_PROVIDER_unload(fips);&lt;br /&gt;
            printf(&amp;quot;Failed to load base provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(base);&lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Also note that in this example we have additionally loaded the &amp;quot;base&amp;quot; provider. This loads a sub-set of algorithms that are also available in the default provider - specifically non cryptographic ones which may be used in conjunction with the FIPS provider. For example this contains algorithms for serializing and de-serializing keys. If you decide not to load the default provider then you will usually want to load the base provider instead.&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default and base providers that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;. Note that this config file does not load the &amp;quot;base&amp;quot; provider. All supporting algorithms that are in &amp;quot;base&amp;quot; are also in &amp;quot;default&amp;quot;, so it is unnecessary in this case:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS and base providers. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OSSL_LIB_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    nonfipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS and base providers so we&lt;br /&gt;
     * don't need to explicitly load them here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OSSL_LIB_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OSSL_LIB_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OSSL_LIB_CTX_free(fipslibctx);&lt;br /&gt;
    OSSL_LIB_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers and Deserializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers and deserializers are used to read and write keys or parameters from or to some external format (for example a PEM file). If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. Similarly you need a deserializer to read previously saved keys and parameters. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer/deserializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers and deserializers are implemented in both the default and base providers and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers/deserializers have the &amp;quot;fips=yes&amp;quot; property against them. You should ensure that either the default or base provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithm, here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3154</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3154"/>
		<updated>2021-03-16T14:37:17Z</updated>

		<summary type="html">&lt;p&gt;Matt: Add warning about deprecated APIs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
One of the standard providers available is the FIPS provider. This makes available FIPS validated cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
* The RAND_DRBG subsystem has been removed.  The new EVP_RAND is a partial replacement: the DRBG callback framework is absent.&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OSSL_LIB_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OSSL_LIB_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
'''Note:''' ''In alpha releases of OpenSSL 3.0.0 up until alpha6, the OSSL_LIB_CTX was called OPENSSL_CTX. It was renamed for OpenSSL 3.0.0 alpha7. If you are still using an alpha6 release or earlier, take a look at this [https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;amp;oldid=3119 older version of the wiki page].''&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OSSL_LIB_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OSSL_LIB_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OSSL_LIB_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OSSL_LIB_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the high level APIs a provider is selected. It is that provider implementation that actually does the required work. There are five providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The base provider. This contains a small sub-set of non-cryptographic algorithms available in the default provider. For example algorithms to serialize and deserialize keys to files. If you do not load the default provider then you should always load this one instead (including if you are using the FIPS provider).&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
Some deprecated APIs avoid the usage of the FIPS module. It is recommended that applications needing to use the FIPS module should not use any deprecated APIs in order to avoid this problem.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
 base = base_sect&lt;br /&gt;
 &lt;br /&gt;
 [base_sect]&lt;br /&gt;
 activate = 1&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour. Note that this configuration also activates the &amp;quot;base&amp;quot; provider. The base provider does not include any cryptographic algorithms (and therefore does not impact the validation status of any cryptographic operations), but does include other supporting algorithms that may be required. It is designed to be used in conjunction with the FIPS module.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain deprecated APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
        OSSL_PROVIDER *base;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        base = OSSL_PROVIDER_load(NULL, &amp;quot;base&amp;quot;);&lt;br /&gt;
        if (base == NULL) {&lt;br /&gt;
            OSSL_PROVIDER_unload(fips);&lt;br /&gt;
            printf(&amp;quot;Failed to load base provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(base);&lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Also note that in this example we have additionally loaded the &amp;quot;base&amp;quot; provider. This loads a sub-set of algorithms that are also available in the default provider - specifically non cryptographic ones which may be used in conjunction with the FIPS provider. For example this contains algorithms for serializing and de-serializing keys. If you decide not to load the default provider then you will usually want to load the base provider instead.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the high level APIs, such as EVP, instead)&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
All of the above APIs are deprecated in OpenSSL 3.0 - so a simple rule is to avoid using all deprecated functions.&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default and base providers that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;. Note that this config file does not load the &amp;quot;base&amp;quot; provider. All supporting algorithms that are in &amp;quot;base&amp;quot; are also in &amp;quot;default&amp;quot;, so it is unnecessary in this case:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS and base providers. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OSSL_LIB_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    nonfipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS and base providers so we&lt;br /&gt;
     * don't need to explicitly load them here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OSSL_LIB_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OSSL_LIB_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OSSL_LIB_CTX_free(fipslibctx);&lt;br /&gt;
    OSSL_LIB_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers and Deserializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers and deserializers are used to read and write keys or parameters from or to some external format (for example a PEM file). If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. Similarly you need a deserializer to read previously saved keys and parameters. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer/deserializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers and deserializers are implemented in both the default and base providers and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers/deserializers have the &amp;quot;fips=yes&amp;quot; property against them. You should ensure that either the default or base provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithm, here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3153</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3153"/>
		<updated>2021-03-16T14:34:26Z</updated>

		<summary type="html">&lt;p&gt;Matt: Add the word &amp;quot;deprecated&amp;quot; to the phrase about avoiding use of the FIPS module&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
One of the standard providers available is the FIPS provider. This makes available FIPS validated cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
* The RAND_DRBG subsystem has been removed.  The new EVP_RAND is a partial replacement: the DRBG callback framework is absent.&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OSSL_LIB_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OSSL_LIB_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
'''Note:''' ''In alpha releases of OpenSSL 3.0.0 up until alpha6, the OSSL_LIB_CTX was called OPENSSL_CTX. It was renamed for OpenSSL 3.0.0 alpha7. If you are still using an alpha6 release or earlier, take a look at this [https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;amp;oldid=3119 older version of the wiki page].''&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OSSL_LIB_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OSSL_LIB_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OSSL_LIB_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OSSL_LIB_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the high level APIs a provider is selected. It is that provider implementation that actually does the required work. There are five providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The base provider. This contains a small sub-set of non-cryptographic algorithms available in the default provider. For example algorithms to serialize and deserialize keys to files. If you do not load the default provider then you should always load this one instead (including if you are using the FIPS provider).&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
 base = base_sect&lt;br /&gt;
 &lt;br /&gt;
 [base_sect]&lt;br /&gt;
 activate = 1&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour. Note that this configuration also activates the &amp;quot;base&amp;quot; provider. The base provider does not include any cryptographic algorithms (and therefore does not impact the validation status of any cryptographic operations), but does include other supporting algorithms that may be required. It is designed to be used in conjunction with the FIPS module.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain deprecated APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
        OSSL_PROVIDER *base;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        base = OSSL_PROVIDER_load(NULL, &amp;quot;base&amp;quot;);&lt;br /&gt;
        if (base == NULL) {&lt;br /&gt;
            OSSL_PROVIDER_unload(fips);&lt;br /&gt;
            printf(&amp;quot;Failed to load base provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(base);&lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Also note that in this example we have additionally loaded the &amp;quot;base&amp;quot; provider. This loads a sub-set of algorithms that are also available in the default provider - specifically non cryptographic ones which may be used in conjunction with the FIPS provider. For example this contains algorithms for serializing and de-serializing keys. If you decide not to load the default provider then you will usually want to load the base provider instead.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the high level APIs, such as EVP, instead)&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
All of the above APIs are deprecated in OpenSSL 3.0 - so a simple rule is to avoid using all deprecated functions.&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default and base providers that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;. Note that this config file does not load the &amp;quot;base&amp;quot; provider. All supporting algorithms that are in &amp;quot;base&amp;quot; are also in &amp;quot;default&amp;quot;, so it is unnecessary in this case:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS and base providers. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OSSL_LIB_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    nonfipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS and base providers so we&lt;br /&gt;
     * don't need to explicitly load them here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OSSL_LIB_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OSSL_LIB_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OSSL_LIB_CTX_free(fipslibctx);&lt;br /&gt;
    OSSL_LIB_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers and Deserializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers and deserializers are used to read and write keys or parameters from or to some external format (for example a PEM file). If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. Similarly you need a deserializer to read previously saved keys and parameters. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer/deserializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers and deserializers are implemented in both the default and base providers and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers/deserializers have the &amp;quot;fips=yes&amp;quot; property against them. You should ensure that either the default or base provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithm, here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=Diffie_Hellman&amp;diff=3142</id>
		<title>Diffie Hellman</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=Diffie_Hellman&amp;diff=3142"/>
		<updated>2021-02-13T14:34:57Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Working with Parameters and Generating Keys */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Diffie-Hellman algorithm provides the capability for two communicating parties to agree upon a shared secret between them. Its an agreement scheme because both parties add material used to derive the key (as opposed to transport, where one party selects the key). The shared secret can then be used as the basis for some encryption key to be used for further communication.&lt;br /&gt;
&lt;br /&gt;
If Alice and Bob wish to communicate with each other, they first agree between them a large prime number p, and a generator (or base) g (where 0 &amp;lt; g &amp;lt; p).&lt;br /&gt;
&lt;br /&gt;
Alice chooses a secret integer a (her private key) and then calculates g&amp;lt;sup&amp;gt;a&amp;lt;/sup&amp;gt; mod p (which is her public key).&lt;br /&gt;
Bob chooses his private key b, and calculates his public key in the same way.&lt;br /&gt;
&lt;br /&gt;
Alice and Bob then send each other their public keys. Alice now knows a and Bob's public key g&amp;lt;sup&amp;gt;b&amp;lt;/sup&amp;gt; mod p. She is not able to calculate the value b from Bob's public key as this is a hard mathematical problem (known as the discrete logarithm problem). She can however calculate (g&amp;lt;sup&amp;gt;b&amp;lt;/sup&amp;gt;)&amp;lt;sup&amp;gt;a&amp;lt;/sup&amp;gt; mod p = g&amp;lt;sup&amp;gt;ab&amp;lt;/sup&amp;gt; mod p.&lt;br /&gt;
&lt;br /&gt;
Bob knows b and g&amp;lt;sup&amp;gt;a&amp;lt;/sup&amp;gt;, so he can calculate (g&amp;lt;sup&amp;gt;a&amp;lt;/sup&amp;gt;)&amp;lt;sup&amp;gt;b&amp;lt;/sup&amp;gt; mod p = g&amp;lt;sup&amp;gt;ab&amp;lt;/sup&amp;gt; mod p. Therefore both Alice and Bob know a shared secret g&amp;lt;sup&amp;gt;ab&amp;lt;/sup&amp;gt; mod p. Eve who was listening in on the communication knows p, g, Alice's public key (g&amp;lt;sup&amp;gt;a&amp;lt;/sup&amp;gt; mod p) and Bob's public key (g&amp;lt;sup&amp;gt;b&amp;lt;/sup&amp;gt; mod p). She is unable to calculate the shared secret from these values.&lt;br /&gt;
&lt;br /&gt;
In static-static mode both Alice and Bob retain their private/public keys over multiple communications. Therefore the resulting shared secret will be the same every time. In ephemeral-static mode one party will generate a new private/public key every time, thus a new shared secret will be generated.&lt;br /&gt;
&lt;br /&gt;
==Diffie-Hellman Standards==&lt;br /&gt;
&lt;br /&gt;
There are a number of standards relevant to Diffie-Hellman key agreement. Some of the key ones are:&lt;br /&gt;
&lt;br /&gt;
* [ftp://ftp.rsasecurity.com/pub/pkcs/ascii/pkcs-3.asc PKCS 3] defines the basic algorithm and  data formats to be used.&lt;br /&gt;
* ANSI X9.42 is a later standard than PKCS 3 and provides further guidance on its use (note OpenSSL does not support ANSI X9.42 in the released versions - support is available in the as yet unreleased 1.0.2 and 1.1.0)&lt;br /&gt;
* [http://www.ietf.org/rfc/rfc2631.txt RFC 2631] summarizes the key points of ANSI X9.42&lt;br /&gt;
* [http://www.ietf.org/rfc/rfc5114.txt RFC 5114] defines 3 standard sets of parameters for use with Diffie-Hellman (OpenSSL will have built-in support for these parameters from OpenSSL 1.0.2 - not yet released) &lt;br /&gt;
* [http://csrc.nist.gov/publications/nistpubs/800-56A/SP800-56A_Revision1_Mar08-2007.pdf NIST SP 800-56A] is a NIST publication that provides recommendations on the implementation of X9.42&lt;br /&gt;
&lt;br /&gt;
==Diffie-Hellman in SSL/TLS==&lt;br /&gt;
&lt;br /&gt;
There are three versions of Diffie-Hellman used in SSL/TLS.&lt;br /&gt;
&lt;br /&gt;
* Anonymous Diffie-Hellman&lt;br /&gt;
* Fixed Diffie-Hellman&lt;br /&gt;
* Ephemeral Diffie-Hellman&lt;br /&gt;
&lt;br /&gt;
'''Anonymous Diffie-Hellman''' uses Diffie-Hellman, but without authentication. Because the keys used in the exchange are not authenticated, the protocol is susceptible to Man-in-the-Middle attacks. Note: if you use this scheme, a call to &amp;lt;tt&amp;gt;SSL_get_peer_certificate&amp;lt;/tt&amp;gt; will return &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt; because you have selected an anonymous protocol. This is the only time &amp;lt;tt&amp;gt;SSL_get_peer_certificate&amp;lt;/tt&amp;gt; is allowed to return &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt; under normal circumstances.&lt;br /&gt;
&lt;br /&gt;
You should not use Anonymous Diffie-Hellman. You can prohibit its use in your code by using &amp;lt;tt&amp;gt;&amp;quot;!ADH&amp;quot;&amp;lt;/tt&amp;gt; in your call to &amp;lt;tt&amp;gt;SSL_set_cipher_list&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Fixed Diffie-Hellman''' embeds the server's public parameter in the certificate, and the CA then signs the certificate. That is, the certificate contains the Diffie-Hellman public-key parameters, and those parameters never change.&lt;br /&gt;
&lt;br /&gt;
'''Ephemeral Diffie-Hellman''' uses temporary, public keys. Each instance or run of the protocol uses a different public key. The authenticity of the server's temporary key can be verified by checking the signature on the key. Because the public keys are temporary, a compromise of the server's long term signing key ''does not'' jeopardize the privacy of past sessions. This is known as ''Perfect Forward Secrecy (PFS)''.&lt;br /&gt;
&lt;br /&gt;
You should always use Ephemeral Diffie-Hellman because it provides PFS. You can specify ephemeral methods by providing &amp;lt;tt&amp;gt;&amp;quot;kEECDH:kEDH&amp;quot;&amp;lt;/tt&amp;gt; in your call to &amp;lt;tt&amp;gt;SSL_set_cipher_list&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Working with Parameters and Generating Keys==&lt;br /&gt;
&lt;br /&gt;
The first step with the Diffie-Hellman algorithm is to ensure that both parties are using the same set of parameters (i.e. the same values for p and g). Since parameter generation can be an expensive process this is normally done once in advance and then the same set of parameters are used over many key exchanges. A new set of parameters can be generated by OpenSSL, or alternatively there is support for built-in standard sets of parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/* Use built-in parameters */&lt;br /&gt;
if(NULL == (params = EVP_PKEY_new())) handleErrors();&lt;br /&gt;
if(1 != EVP_PKEY_assign(params, EVP_PKEY_DHX, DH_get_2048_256())) handleErrors();&lt;br /&gt;
&lt;br /&gt;
/* Create context for the key generation */&lt;br /&gt;
if(!(kctx = EVP_PKEY_CTX_new(params, NULL))) handleErrors();&lt;br /&gt;
&lt;br /&gt;
/* Generate a new key */&lt;br /&gt;
if(1 != EVP_PKEY_keygen_init(kctx)) handleErrors();&lt;br /&gt;
if(1 != EVP_PKEY_keygen(kctx, &amp;amp;dhkey)) handleErrors();&lt;br /&gt;
&lt;br /&gt;
/* Optional : useful if you want to check your private key*/&lt;br /&gt;
BIO* fp = BIO_new_fp(stdout, BIO_NOCLOSE);&lt;br /&gt;
EVP_PKEY_print_private(fp, dhkey, 0, NULL);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To generate your own parameters refer to [[EVP Key and Parameter Generation]].&lt;br /&gt;
&lt;br /&gt;
Note: The function &amp;lt;code&amp;gt;DH_get_2048_256&amp;lt;/code&amp;gt; is scheduled for release in OpenSSL 1.0.2; it is not available in 1.0.1e or earlier.&lt;br /&gt;
&lt;br /&gt;
==Generating a Shared Secret==&lt;br /&gt;
&lt;br /&gt;
Having obtained a private/public key pair you need to also obtain the public key of the other communicating party. Refer to [[EVP Key Agreement]] for information on how to agree a shared secret.&lt;br /&gt;
&lt;br /&gt;
==Using the Low Level APIs==&lt;br /&gt;
&lt;br /&gt;
Users of the OpenSSL library are expected to normally use the EVP method for working with Diffie Hellman as described above and on the [[EVP Key Agreement]] page. The EVP api is implemented by a lower level Diffie Hellman API. In some circumstances, expert users may need to use the low level api. '''This is not recommended for most users'''. However, if you need to use this then an example of use is shown below. The manual page for the low level API is available here: [[Manual:dh(3)]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;DH *privkey;&lt;br /&gt;
int codes;&lt;br /&gt;
int secret_size;&lt;br /&gt;
&lt;br /&gt;
/* Generate the parameters to be used */&lt;br /&gt;
if(NULL == (privkey = DH_new())) handleErrors();&lt;br /&gt;
if(1 != DH_generate_parameters_ex(privkey, 2048, DH_GENERATOR_2, NULL)) handleErrors();&lt;br /&gt;
&lt;br /&gt;
if(1 != DH_check(privkey, &amp;amp;codes)) handleErrors();&lt;br /&gt;
if(codes != 0)&lt;br /&gt;
{&lt;br /&gt;
    /* Problems have been found with the generated parameters */&lt;br /&gt;
    /* Handle these here - we'll just abort for this example */&lt;br /&gt;
    printf(&amp;quot;DH_check failed\n&amp;quot;);&lt;br /&gt;
    abort();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Generate the public and private key pair */&lt;br /&gt;
if(1 != DH_generate_key(privkey)) handleErrors();&lt;br /&gt;
&lt;br /&gt;
/* Send the public key to the peer.&lt;br /&gt;
 * How this occurs will be specific to your situation (see main text below) */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/* Receive the public key from the peer. In this example we're just hard coding a value */&lt;br /&gt;
BIGNUM *pubkey = NULL;&lt;br /&gt;
if(0 == (BN_dec2bn(&amp;amp;pubkey, &amp;quot;01234567890123456789012345678901234567890123456789&amp;quot;))) handleErrors();&lt;br /&gt;
&lt;br /&gt;
/* Compute the shared secret */&lt;br /&gt;
unsigned char *secret;&lt;br /&gt;
if(NULL == (secret = OPENSSL_malloc(sizeof(unsigned char) * (DH_size(privkey))))) handleErrors();&lt;br /&gt;
&lt;br /&gt;
if(0 &amp;gt; (secret_size = DH_compute_key(secret, pubkey, privkey))) handleErrors();&lt;br /&gt;
&lt;br /&gt;
/* Do something with the shared secret */&lt;br /&gt;
/* Note secret_size may be less than DH_size(privkey) */&lt;br /&gt;
printf(&amp;quot;The shared secret is:\n&amp;quot;);&lt;br /&gt;
BIO_dump_fp(stdout, secret, secret_size);&lt;br /&gt;
&lt;br /&gt;
/* Clean up */&lt;br /&gt;
OPENSSL_free(secret);&lt;br /&gt;
BN_free(pubkey);&lt;br /&gt;
DH_free(privkey);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are (currently) no DH_ level routines to read and write&lt;br /&gt;
a public OR private key, but the generic PUBKEY and&lt;br /&gt;
PrivateKey routines do so as an X.509 SubjectPublickKeyInfo structure (aka SPKI or PKCS#8). This includes the parameters plus the public key (and the private key for the PrivateKey routines) (see [[Manual:Pem(3)]]).&lt;br /&gt;
&lt;br /&gt;
There are three possible cases:&lt;br /&gt;
* ephemeral parameters: A must send new parameters AND the public key to the peer (B), who needs to send back only their public key (although it may be convenient to embed it in an SPKI structure)&lt;br /&gt;
* static but undistributed parameters: effectively the same&lt;br /&gt;
* pre-distributed parameters: A only needs to send their public key, but may embed in an SPKI structure; B doesn't need to wait for A to get parameters but may wait anyway, and only needs to send B's public key but may embed it in an SPKI structure.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[EVP Key Agreement]]&lt;br /&gt;
* [[Elliptic Curve Diffie Hellman]]&lt;br /&gt;
* [[EVP]]&lt;br /&gt;
* [[Libcrypto API]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Cryptographic Algorithm]]&lt;br /&gt;
[[Category:C level]]&lt;br /&gt;
[[Category:Examples]]&lt;br /&gt;
[[Category:Public Key Algorithm]]&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=Diffie_Hellman&amp;diff=3141</id>
		<title>Diffie Hellman</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=Diffie_Hellman&amp;diff=3141"/>
		<updated>2021-02-13T14:29:39Z</updated>

		<summary type="html">&lt;p&gt;Matt: Undo revision 3139 by L.Habib (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Diffie-Hellman algorithm provides the capability for two communicating parties to agree upon a shared secret between them. Its an agreement scheme because both parties add material used to derive the key (as opposed to transport, where one party selects the key). The shared secret can then be used as the basis for some encryption key to be used for further communication.&lt;br /&gt;
&lt;br /&gt;
If Alice and Bob wish to communicate with each other, they first agree between them a large prime number p, and a generator (or base) g (where 0 &amp;lt; g &amp;lt; p).&lt;br /&gt;
&lt;br /&gt;
Alice chooses a secret integer a (her private key) and then calculates g&amp;lt;sup&amp;gt;a&amp;lt;/sup&amp;gt; mod p (which is her public key).&lt;br /&gt;
Bob chooses his private key b, and calculates his public key in the same way.&lt;br /&gt;
&lt;br /&gt;
Alice and Bob then send each other their public keys. Alice now knows a and Bob's public key g&amp;lt;sup&amp;gt;b&amp;lt;/sup&amp;gt; mod p. She is not able to calculate the value b from Bob's public key as this is a hard mathematical problem (known as the discrete logarithm problem). She can however calculate (g&amp;lt;sup&amp;gt;b&amp;lt;/sup&amp;gt;)&amp;lt;sup&amp;gt;a&amp;lt;/sup&amp;gt; mod p = g&amp;lt;sup&amp;gt;ab&amp;lt;/sup&amp;gt; mod p.&lt;br /&gt;
&lt;br /&gt;
Bob knows b and g&amp;lt;sup&amp;gt;a&amp;lt;/sup&amp;gt;, so he can calculate (g&amp;lt;sup&amp;gt;a&amp;lt;/sup&amp;gt;)&amp;lt;sup&amp;gt;b&amp;lt;/sup&amp;gt; mod p = g&amp;lt;sup&amp;gt;ab&amp;lt;/sup&amp;gt; mod p. Therefore both Alice and Bob know a shared secret g&amp;lt;sup&amp;gt;ab&amp;lt;/sup&amp;gt; mod p. Eve who was listening in on the communication knows p, g, Alice's public key (g&amp;lt;sup&amp;gt;a&amp;lt;/sup&amp;gt; mod p) and Bob's public key (g&amp;lt;sup&amp;gt;b&amp;lt;/sup&amp;gt; mod p). She is unable to calculate the shared secret from these values.&lt;br /&gt;
&lt;br /&gt;
In static-static mode both Alice and Bob retain their private/public keys over multiple communications. Therefore the resulting shared secret will be the same every time. In ephemeral-static mode one party will generate a new private/public key every time, thus a new shared secret will be generated.&lt;br /&gt;
&lt;br /&gt;
==Diffie-Hellman Standards==&lt;br /&gt;
&lt;br /&gt;
There are a number of standards relevant to Diffie-Hellman key agreement. Some of the key ones are:&lt;br /&gt;
&lt;br /&gt;
* [ftp://ftp.rsasecurity.com/pub/pkcs/ascii/pkcs-3.asc PKCS 3] defines the basic algorithm and  data formats to be used.&lt;br /&gt;
* ANSI X9.42 is a later standard than PKCS 3 and provides further guidance on its use (note OpenSSL does not support ANSI X9.42 in the released versions - support is available in the as yet unreleased 1.0.2 and 1.1.0)&lt;br /&gt;
* [http://www.ietf.org/rfc/rfc2631.txt RFC 2631] summarizes the key points of ANSI X9.42&lt;br /&gt;
* [http://www.ietf.org/rfc/rfc5114.txt RFC 5114] defines 3 standard sets of parameters for use with Diffie-Hellman (OpenSSL will have built-in support for these parameters from OpenSSL 1.0.2 - not yet released) &lt;br /&gt;
* [http://csrc.nist.gov/publications/nistpubs/800-56A/SP800-56A_Revision1_Mar08-2007.pdf NIST SP 800-56A] is a NIST publication that provides recommendations on the implementation of X9.42&lt;br /&gt;
&lt;br /&gt;
==Diffie-Hellman in SSL/TLS==&lt;br /&gt;
&lt;br /&gt;
There are three versions of Diffie-Hellman used in SSL/TLS.&lt;br /&gt;
&lt;br /&gt;
* Anonymous Diffie-Hellman&lt;br /&gt;
* Fixed Diffie-Hellman&lt;br /&gt;
* Ephemeral Diffie-Hellman&lt;br /&gt;
&lt;br /&gt;
'''Anonymous Diffie-Hellman''' uses Diffie-Hellman, but without authentication. Because the keys used in the exchange are not authenticated, the protocol is susceptible to Man-in-the-Middle attacks. Note: if you use this scheme, a call to &amp;lt;tt&amp;gt;SSL_get_peer_certificate&amp;lt;/tt&amp;gt; will return &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt; because you have selected an anonymous protocol. This is the only time &amp;lt;tt&amp;gt;SSL_get_peer_certificate&amp;lt;/tt&amp;gt; is allowed to return &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt; under normal circumstances.&lt;br /&gt;
&lt;br /&gt;
You should not use Anonymous Diffie-Hellman. You can prohibit its use in your code by using &amp;lt;tt&amp;gt;&amp;quot;!ADH&amp;quot;&amp;lt;/tt&amp;gt; in your call to &amp;lt;tt&amp;gt;SSL_set_cipher_list&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Fixed Diffie-Hellman''' embeds the server's public parameter in the certificate, and the CA then signs the certificate. That is, the certificate contains the Diffie-Hellman public-key parameters, and those parameters never change.&lt;br /&gt;
&lt;br /&gt;
'''Ephemeral Diffie-Hellman''' uses temporary, public keys. Each instance or run of the protocol uses a different public key. The authenticity of the server's temporary key can be verified by checking the signature on the key. Because the public keys are temporary, a compromise of the server's long term signing key ''does not'' jeopardize the privacy of past sessions. This is known as ''Perfect Forward Secrecy (PFS)''.&lt;br /&gt;
&lt;br /&gt;
You should always use Ephemeral Diffie-Hellman because it provides PFS. You can specify ephemeral methods by providing &amp;lt;tt&amp;gt;&amp;quot;kEECDH:kEDH&amp;quot;&amp;lt;/tt&amp;gt; in your call to &amp;lt;tt&amp;gt;SSL_set_cipher_list&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Working with Parameters and Generating Keys==&lt;br /&gt;
&lt;br /&gt;
The first step with the Diffie-Hellman algorithm is to ensure that both parties are using the same set of parameters (i.e. the same values for p and g). Since parameter generation can be an expensive process this is normally done once in advance and then the same set of parameters are used over many key exchanges. A new set of parameters can be generated by OpenSSL, or alternatively there is support for built-in standard sets of parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/* Use built-in parameters */&lt;br /&gt;
if(NULL == (params = EVP_PKEY_new())) handleErrors();&lt;br /&gt;
if(1 != EVP_PKEY_set1_DH(params,DH_get_2048_256())) handleErrors();&lt;br /&gt;
&lt;br /&gt;
/* Create context for the key generation */&lt;br /&gt;
if(!(kctx = EVP_PKEY_CTX_new(params, NULL))) handleErrors();&lt;br /&gt;
&lt;br /&gt;
/* Generate a new key */&lt;br /&gt;
if(1 != EVP_PKEY_keygen_init(kctx)) handleErrors();&lt;br /&gt;
if(1 != EVP_PKEY_keygen(kctx, &amp;amp;dhkey)) handleErrors();&lt;br /&gt;
&lt;br /&gt;
/* Optional : useful if you want to check your private key*/&lt;br /&gt;
BIO* fp = BIO_new_fp(stdout, BIO_NOCLOSE);&lt;br /&gt;
EVP_PKEY_print_private(fp, dhkey, 0, NULL);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To generate your own parameters refer to [[EVP Key and Parameter Generation]].&lt;br /&gt;
&lt;br /&gt;
Note: The function &amp;lt;code&amp;gt;DH_get_2048_256&amp;lt;/code&amp;gt; is scheduled for release in OpenSSL 1.0.2; it is not available in 1.0.1e or earlier.&lt;br /&gt;
&lt;br /&gt;
==Generating a Shared Secret==&lt;br /&gt;
&lt;br /&gt;
Having obtained a private/public key pair you need to also obtain the public key of the other communicating party. Refer to [[EVP Key Agreement]] for information on how to agree a shared secret.&lt;br /&gt;
&lt;br /&gt;
==Using the Low Level APIs==&lt;br /&gt;
&lt;br /&gt;
Users of the OpenSSL library are expected to normally use the EVP method for working with Diffie Hellman as described above and on the [[EVP Key Agreement]] page. The EVP api is implemented by a lower level Diffie Hellman API. In some circumstances, expert users may need to use the low level api. '''This is not recommended for most users'''. However, if you need to use this then an example of use is shown below. The manual page for the low level API is available here: [[Manual:dh(3)]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;DH *privkey;&lt;br /&gt;
int codes;&lt;br /&gt;
int secret_size;&lt;br /&gt;
&lt;br /&gt;
/* Generate the parameters to be used */&lt;br /&gt;
if(NULL == (privkey = DH_new())) handleErrors();&lt;br /&gt;
if(1 != DH_generate_parameters_ex(privkey, 2048, DH_GENERATOR_2, NULL)) handleErrors();&lt;br /&gt;
&lt;br /&gt;
if(1 != DH_check(privkey, &amp;amp;codes)) handleErrors();&lt;br /&gt;
if(codes != 0)&lt;br /&gt;
{&lt;br /&gt;
    /* Problems have been found with the generated parameters */&lt;br /&gt;
    /* Handle these here - we'll just abort for this example */&lt;br /&gt;
    printf(&amp;quot;DH_check failed\n&amp;quot;);&lt;br /&gt;
    abort();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Generate the public and private key pair */&lt;br /&gt;
if(1 != DH_generate_key(privkey)) handleErrors();&lt;br /&gt;
&lt;br /&gt;
/* Send the public key to the peer.&lt;br /&gt;
 * How this occurs will be specific to your situation (see main text below) */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/* Receive the public key from the peer. In this example we're just hard coding a value */&lt;br /&gt;
BIGNUM *pubkey = NULL;&lt;br /&gt;
if(0 == (BN_dec2bn(&amp;amp;pubkey, &amp;quot;01234567890123456789012345678901234567890123456789&amp;quot;))) handleErrors();&lt;br /&gt;
&lt;br /&gt;
/* Compute the shared secret */&lt;br /&gt;
unsigned char *secret;&lt;br /&gt;
if(NULL == (secret = OPENSSL_malloc(sizeof(unsigned char) * (DH_size(privkey))))) handleErrors();&lt;br /&gt;
&lt;br /&gt;
if(0 &amp;gt; (secret_size = DH_compute_key(secret, pubkey, privkey))) handleErrors();&lt;br /&gt;
&lt;br /&gt;
/* Do something with the shared secret */&lt;br /&gt;
/* Note secret_size may be less than DH_size(privkey) */&lt;br /&gt;
printf(&amp;quot;The shared secret is:\n&amp;quot;);&lt;br /&gt;
BIO_dump_fp(stdout, secret, secret_size);&lt;br /&gt;
&lt;br /&gt;
/* Clean up */&lt;br /&gt;
OPENSSL_free(secret);&lt;br /&gt;
BN_free(pubkey);&lt;br /&gt;
DH_free(privkey);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are (currently) no DH_ level routines to read and write&lt;br /&gt;
a public OR private key, but the generic PUBKEY and&lt;br /&gt;
PrivateKey routines do so as an X.509 SubjectPublickKeyInfo structure (aka SPKI or PKCS#8). This includes the parameters plus the public key (and the private key for the PrivateKey routines) (see [[Manual:Pem(3)]]).&lt;br /&gt;
&lt;br /&gt;
There are three possible cases:&lt;br /&gt;
* ephemeral parameters: A must send new parameters AND the public key to the peer (B), who needs to send back only their public key (although it may be convenient to embed it in an SPKI structure)&lt;br /&gt;
* static but undistributed parameters: effectively the same&lt;br /&gt;
* pre-distributed parameters: A only needs to send their public key, but may embed in an SPKI structure; B doesn't need to wait for A to get parameters but may wait anyway, and only needs to send B's public key but may embed it in an SPKI structure.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[EVP Key Agreement]]&lt;br /&gt;
* [[Elliptic Curve Diffie Hellman]]&lt;br /&gt;
* [[EVP]]&lt;br /&gt;
* [[Libcrypto API]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Cryptographic Algorithm]]&lt;br /&gt;
[[Category:C level]]&lt;br /&gt;
[[Category:Examples]]&lt;br /&gt;
[[Category:Public Key Algorithm]]&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3133</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3133"/>
		<updated>2021-01-07T16:43:25Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Loading the FIPS module at the same time as other providers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
One of the standard providers available is the FIPS provider. This makes available FIPS validated cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
* The RAND_DRBG subsystem has been removed.  The new EVP_RAND is a partial replacement: the DRBG callback framework is absent.&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OSSL_LIB_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OSSL_LIB_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
'''Note:''' ''In alpha releases of OpenSSL 3.0.0 up until alpha6, the OSSL_LIB_CTX was called OPENSSL_CTX. It was renamed for OpenSSL 3.0.0 alpha7. If you are still using an alpha6 release or earlier, take a look at this [https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;amp;oldid=3119 older version of the wiki page].''&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OSSL_LIB_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OSSL_LIB_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OSSL_LIB_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OSSL_LIB_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the high level APIs a provider is selected. It is that provider implementation that actually does the required work. There are five providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The base provider. This contains a small sub-set of non-cryptographic algorithms available in the default provider. For example algorithms to serialize and deserialize keys to files. If you do not load the default provider then you should always load this one instead (including if you are using the FIPS provider).&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
 base = base_sect&lt;br /&gt;
 &lt;br /&gt;
 [base_sect]&lt;br /&gt;
 activate = 1&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour. Note that this configuration also activates the &amp;quot;base&amp;quot; provider. The base provider does not include any cryptographic algorithms (and therefore does not impact the validation status of any cryptographic operations), but does include other supporting algorithms that may be required. It is designed to be used in conjunction with the FIPS module.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
        OSSL_PROVIDER *base;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        base = OSSL_PROVIDER_load(NULL, &amp;quot;base&amp;quot;);&lt;br /&gt;
        if (base == NULL) {&lt;br /&gt;
            OSSL_PROVIDER_unload(fips);&lt;br /&gt;
            printf(&amp;quot;Failed to load base provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(base);&lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Also note that in this example we have additionally loaded the &amp;quot;base&amp;quot; provider. This loads a sub-set of algorithms that are also available in the default provider - specifically non cryptographic ones which may be used in conjunction with the FIPS provider. For example this contains algorithms for serializing and de-serializing keys. If you decide not to load the default provider then you will usually want to load the base provider instead.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the high level APIs, such as EVP, instead)&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
All of the above APIs are deprecated in OpenSSL 3.0 - so a simple rule is to avoid using all deprecated functions.&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default and base providers that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;. Note that this config file does not load the &amp;quot;base&amp;quot; provider. All supporting algorithms that are in &amp;quot;base&amp;quot; are also in &amp;quot;default&amp;quot;, so it is unnecessary in this case:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS and base providers. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OSSL_LIB_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    nonfipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS and base providers so we&lt;br /&gt;
     * don't need to explicitly load them here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OSSL_LIB_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OSSL_LIB_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OSSL_LIB_CTX_free(fipslibctx);&lt;br /&gt;
    OSSL_LIB_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers and Deserializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers and deserializers are used to read and write keys or parameters from or to some external format (for example a PEM file). If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. Similarly you need a deserializer to read previously saved keys and parameters. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer/deserializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers and deserializers are implemented in both the default and base providers and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers/deserializers have the &amp;quot;fips=yes&amp;quot; property against them. You should ensure that either the default or base provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithm, here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3132</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3132"/>
		<updated>2021-01-07T16:41:36Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Making all applications use the FIPS module by default */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
One of the standard providers available is the FIPS provider. This makes available FIPS validated cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
* The RAND_DRBG subsystem has been removed.  The new EVP_RAND is a partial replacement: the DRBG callback framework is absent.&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OSSL_LIB_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OSSL_LIB_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
'''Note:''' ''In alpha releases of OpenSSL 3.0.0 up until alpha6, the OSSL_LIB_CTX was called OPENSSL_CTX. It was renamed for OpenSSL 3.0.0 alpha7. If you are still using an alpha6 release or earlier, take a look at this [https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;amp;oldid=3119 older version of the wiki page].''&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OSSL_LIB_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OSSL_LIB_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OSSL_LIB_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OSSL_LIB_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the high level APIs a provider is selected. It is that provider implementation that actually does the required work. There are five providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The base provider. This contains a small sub-set of non-cryptographic algorithms available in the default provider. For example algorithms to serialize and deserialize keys to files. If you do not load the default provider then you should always load this one instead (including if you are using the FIPS provider).&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
 base = base_sect&lt;br /&gt;
 &lt;br /&gt;
 [base_sect]&lt;br /&gt;
 activate = 1&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour. Note that this configuration also activates the &amp;quot;base&amp;quot; provider. The base provider does not include any cryptographic algorithms (and therefore does not impact the validation status of any cryptographic operations), but does include other supporting algorithms that may be required. It is designed to be used in conjunction with the FIPS module.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
        OSSL_PROVIDER *base;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        base = OSSL_PROVIDER_load(NULL, &amp;quot;base&amp;quot;);&lt;br /&gt;
        if (base == NULL) {&lt;br /&gt;
            OSSL_PROVIDER_unload(fips);&lt;br /&gt;
            printf(&amp;quot;Failed to load base provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(base);&lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Also note that in this example we have additionally loaded the &amp;quot;base&amp;quot; provider. This loads a sub-set of algorithms that are also available in the default provider - specifically non cryptographic ones which may be used in conjunction with the FIPS provider. For example this contains algorithms for serializing and de-serializing keys. If you decide not to load the default provider then you will usually want to load the base provider instead.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the high level APIs, such as EVP, instead)&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
All of the above APIs are deprecated in OpenSSL 3.0 - so a simple rule is to avoid using all deprecated functions.&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default and base providers that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS and base providers. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OSSL_LIB_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    nonfipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS and base providers so we&lt;br /&gt;
     * don't need to explicitly load them here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OSSL_LIB_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OSSL_LIB_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OSSL_LIB_CTX_free(fipslibctx);&lt;br /&gt;
    OSSL_LIB_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers and Deserializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers and deserializers are used to read and write keys or parameters from or to some external format (for example a PEM file). If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. Similarly you need a deserializer to read previously saved keys and parameters. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer/deserializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers and deserializers are implemented in both the default and base providers and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers/deserializers have the &amp;quot;fips=yes&amp;quot; property against them. You should ensure that either the default or base provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithm, here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3131</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3131"/>
		<updated>2021-01-07T16:41:22Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Making all applications use the FIPS module by default */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
One of the standard providers available is the FIPS provider. This makes available FIPS validated cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
* The RAND_DRBG subsystem has been removed.  The new EVP_RAND is a partial replacement: the DRBG callback framework is absent.&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OSSL_LIB_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OSSL_LIB_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
'''Note:''' ''In alpha releases of OpenSSL 3.0.0 up until alpha6, the OSSL_LIB_CTX was called OPENSSL_CTX. It was renamed for OpenSSL 3.0.0 alpha7. If you are still using an alpha6 release or earlier, take a look at this [https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;amp;oldid=3119 older version of the wiki page].''&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OSSL_LIB_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OSSL_LIB_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OSSL_LIB_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OSSL_LIB_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the high level APIs a provider is selected. It is that provider implementation that actually does the required work. There are five providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The base provider. This contains a small sub-set of non-cryptographic algorithms available in the default provider. For example algorithms to serialize and deserialize keys to files. If you do not load the default provider then you should always load this one instead (including if you are using the FIPS provider).&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
 base = base_sect&lt;br /&gt;
&lt;br /&gt;
 [base_sect]&lt;br /&gt;
 activate = 1&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour. Note that this configuration also activates the &amp;quot;base&amp;quot; provider. The base provider does not include any cryptographic algorithms (and therefore does not impact the validation status of any cryptographic operations), but does include other supporting algorithms that may be required. It is designed to be used in conjunction with the FIPS module.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
        OSSL_PROVIDER *base;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        base = OSSL_PROVIDER_load(NULL, &amp;quot;base&amp;quot;);&lt;br /&gt;
        if (base == NULL) {&lt;br /&gt;
            OSSL_PROVIDER_unload(fips);&lt;br /&gt;
            printf(&amp;quot;Failed to load base provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(base);&lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Also note that in this example we have additionally loaded the &amp;quot;base&amp;quot; provider. This loads a sub-set of algorithms that are also available in the default provider - specifically non cryptographic ones which may be used in conjunction with the FIPS provider. For example this contains algorithms for serializing and de-serializing keys. If you decide not to load the default provider then you will usually want to load the base provider instead.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the high level APIs, such as EVP, instead)&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
All of the above APIs are deprecated in OpenSSL 3.0 - so a simple rule is to avoid using all deprecated functions.&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default and base providers that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS and base providers. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OSSL_LIB_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    nonfipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS and base providers so we&lt;br /&gt;
     * don't need to explicitly load them here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OSSL_LIB_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OSSL_LIB_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OSSL_LIB_CTX_free(fipslibctx);&lt;br /&gt;
    OSSL_LIB_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers and Deserializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers and deserializers are used to read and write keys or parameters from or to some external format (for example a PEM file). If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. Similarly you need a deserializer to read previously saved keys and parameters. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer/deserializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers and deserializers are implemented in both the default and base providers and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers/deserializers have the &amp;quot;fips=yes&amp;quot; property against them. You should ensure that either the default or base provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithm, here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=Library_Initialization&amp;diff=3128</id>
		<title>Library Initialization</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=Library_Initialization&amp;diff=3128"/>
		<updated>2020-10-16T14:30:41Z</updated>

		<summary type="html">&lt;p&gt;Matt: Correct OPENSSL_init_crypto line&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page discusses OpenSSL library initialization when using the &amp;lt;tt&amp;gt;libssl&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;libcrypto&amp;lt;/tt&amp;gt; components.&lt;br /&gt;
&lt;br /&gt;
There are two ways to initialize the OpenSSL library, and they depend on the version of the library you are using. If you are using OpenSSL 1.0.2 or below, then you would use &amp;lt;tt&amp;gt;SSL_library_init&amp;lt;/tt&amp;gt;. If you are using OpenSSL 1.1.0 or above, then the library will initialize itself automatically. Optionally you can explicitly initialise it using &amp;lt;tt&amp;gt;OPENSSL_init_ssl&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;OPENSSL_init_crypto&amp;lt;/tt&amp;gt;. A compatibility macro exists in &amp;lt;tt&amp;gt;ssl.h&amp;lt;/tt&amp;gt; that maps &amp;lt;tt&amp;gt;SSL_library_init&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;OPENSSL_init_ssl&amp;lt;/tt&amp;gt;, so you can continue to use &amp;lt;tt&amp;gt;SSL_library_init&amp;lt;/tt&amp;gt; if desired. Also see ''[http://mta.openssl.org/pipermail/openssl-dev/2016-February/005491.html SSL_library_init]'' on the OpenSSL-dev mailing list.&lt;br /&gt;
&lt;br /&gt;
The rest of this page discusses initializing the library in 1.0.2. If you are using 1.1.0 or above then you don't need to take any further steps.&lt;br /&gt;
&lt;br /&gt;
If you fail to initialize the library in 1.0.2, then you will experience unexplained errors like &amp;lt;tt&amp;gt;SSL_CTX_new&amp;lt;/tt&amp;gt; returning &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt;, error messages like &amp;lt;tt&amp;gt;SSL_CTX_new:library has no ciphers&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;alert handshake failure&amp;lt;/tt&amp;gt; with no shared ciphers.&lt;br /&gt;
&lt;br /&gt;
Below is a list of some initialization calls you might encounter in code or documentation. Unfortunately, all the initialization function return a useless values (for example, always 1) or are void functions. There is no way to determine if a failure occurred.&lt;br /&gt;
&lt;br /&gt;
* SSL_library_init&lt;br /&gt;
* OpenSSL_add_ssl_algorithms&lt;br /&gt;
* OpenSSL_add_all_algorithms&lt;br /&gt;
* SSL_load_error_strings&lt;br /&gt;
* ERR_load_crypto_strings&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== libssl Initialization ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;libssl&amp;lt;/tt&amp;gt; should be initialized with calls to &amp;lt;tt&amp;gt;SSL_library_init&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;SSL_load_error_strings&amp;lt;/tt&amp;gt;. If your program is multi-threaded, you should install the static locks. If you need (or don't need) configuration from &amp;lt;tt&amp;gt;openssl.cnf&amp;lt;/tt&amp;gt;, then you should call &amp;lt;tt&amp;gt;OPENSSL_config&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;OPENSSL_noconfig&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are supporting both pre-1.1.0 and post-1.1.0 version of the OpenSSL library and you want to take control of &amp;lt;tt&amp;gt;SSL_library_init&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;OPENSSL_init_ssl&amp;lt;/tt&amp;gt;, then you can perform:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;openssl/opensslv.h&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
#if OPENSSL_VERSION_NUMBER &amp;lt; 0x10100000L&lt;br /&gt;
SSL_library_init();&lt;br /&gt;
#else&lt;br /&gt;
OPENSSL_init_ssl(0, NULL);&lt;br /&gt;
#endif&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you call &amp;lt;tt&amp;gt;libssl&amp;lt;/tt&amp;gt;, the function will also initialize &amp;lt;tt&amp;gt;libcrypto&amp;lt;/tt&amp;gt; components. There are two corner cases discussed in later sections. The first corner case is static locks, and second is &amp;lt;tt&amp;gt;OPENSSL_config&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;OpenSSL_add_ssl_algorithms&amp;lt;/tt&amp;gt; is a &amp;lt;tt&amp;gt;#define&amp;lt;/tt&amp;gt; for &amp;lt;tt&amp;gt;SSL_library_init&amp;lt;/tt&amp;gt;. You only need to call one or the other. If you want to print error strings using OpenSSL's built in functions, then call &amp;lt;tt&amp;gt;SSL_load_error_strings&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;SSL_library_init&amp;lt;/tt&amp;gt; function loads the algorithms use by &amp;lt;tt&amp;gt;libssl&amp;lt;/tt&amp;gt;. Below is an excerpt from &amp;lt;tt&amp;gt;ssl_algs.c&amp;lt;/tt&amp;gt; (with some additional formatting for clarity).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;int SSL_library_init(void)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
#ifndef OPENSSL_NO_DES&lt;br /&gt;
    EVP_add_cipher(EVP_des_cbc());&lt;br /&gt;
    EVP_add_cipher(EVP_des_ede3_cbc());&lt;br /&gt;
#endif&lt;br /&gt;
#ifndef OPENSSL_NO_IDEA&lt;br /&gt;
    EVP_add_cipher(EVP_idea_cbc());&lt;br /&gt;
#endif&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
#ifndef OPENSSL_NO_COMP&lt;br /&gt;
    (void)SSL_COMP_get_compression_methods();&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
    /* initialize cipher/digest methods table */&lt;br /&gt;
    ssl_load_ciphers();&lt;br /&gt;
&lt;br /&gt;
    return(1);&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The call to &amp;lt;tt&amp;gt;ssl_load_ciphers&amp;lt;/tt&amp;gt; simply builds a table for use in the library. The following is from &amp;lt;tt&amp;gt;ssl_ciph.c&amp;lt;/tt&amp;gt; (with some additional formatting for clarity).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;void ssl_load_ciphers(void)&lt;br /&gt;
{&lt;br /&gt;
    ssl_cipher_methods[SSL_ENC_DES_IDX] = EVP_get_cipherbyname(SN_des_cbc);&lt;br /&gt;
    ssl_cipher_methods[SSL_ENC_3DES_IDX] = EVP_get_cipherbyname(SN_des_ede3_cbc);&lt;br /&gt;
    ...&lt;br /&gt;
    ssl_digest_methods[SSL_MD_MD5_IDX] = EVP_get_digestbyname(SN_md5);&lt;br /&gt;
    ssl_mac_secret_size[SSL_MD_MD5_IDX] = EVP_MD_size(ssl_digest_methods[SSL_MD_MD5_IDX]);&lt;br /&gt;
    ...&lt;br /&gt;
    ssl_digest_methods[SSL_MD_SHA384_IDX] = EVP_get_digestbyname(SN_sha384);&lt;br /&gt;
    ssl_mac_secret_size[SSL_MD_SHA384_IDX] = EVP_MD_size(ssl_digest_methods[SSL_MD_SHA384_IDX]);&lt;br /&gt;
    ...&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Library Apps ===&lt;br /&gt;
&lt;br /&gt;
The following examines how the OpenSSL development team uses initialization in the OpenSSL utilities.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;s_client&amp;lt;/tt&amp;gt; initializes itself with the following calls:&lt;br /&gt;
* OpenSSL_add_ssl_algorithms&lt;br /&gt;
* SSL_load_error_strings&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;s_server&amp;lt;/tt&amp;gt; initializes itself with the following calls:&lt;br /&gt;
* SSL_load_error_strings();&lt;br /&gt;
* OpenSSL_add_ssl_algorithms();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;s_time&amp;lt;/tt&amp;gt; initializes itself with the following calls:&lt;br /&gt;
* OpenSSL_add_ssl_algorithms();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;state_machine&amp;lt;/tt&amp;gt; initializes itself with the following calls:&lt;br /&gt;
* SSL_library_init();&lt;br /&gt;
* OpenSSL_add_ssl_algorithms();&lt;br /&gt;
* SSL_load_error_strings();&lt;br /&gt;
* ERR_load_crypto_strings();&lt;br /&gt;
&lt;br /&gt;
== libcrypto Initialization ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;libcrypto&amp;lt;/tt&amp;gt; should be initialized with calls to &amp;lt;tt&amp;gt;OpenSSL_add_all_algorithms&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ERR_load_crypto_strings&amp;lt;/tt&amp;gt;. If your program is multi-threaded, you should install the static locks. If you need (or don't need) configuration from &amp;lt;tt&amp;gt;openssl.cnf&amp;lt;/tt&amp;gt;, then you should call &amp;lt;tt&amp;gt;OPENSSL_config&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;OPENSSL_noconfig&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;OPENSSL_add_all_algorithms&amp;lt;/tt&amp;gt; function is &amp;lt;tt&amp;gt;#define&amp;lt;/tt&amp;gt;'d to either &amp;lt;tt&amp;gt;OPENSSL_add_all_algorithms_conf&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;OPENSSL_add_all_algorithms_noconf&amp;lt;/tt&amp;gt; depending upon the value of &amp;lt;tt&amp;gt;OPENSSL_LOAD_CONF&amp;lt;/tt&amp;gt;. A typical installation does ''not'' define &amp;lt;tt&amp;gt;OPENSSL_LOAD_CONF&amp;lt;/tt&amp;gt;, which means &amp;lt;tt&amp;gt;OPENSSL_add_all_algorithms_noconf&amp;lt;/tt&amp;gt; is used. Below is an excerpt from &amp;lt;tt&amp;gt;c_all.c&amp;lt;/tt&amp;gt; (with some additional formatting for clarity).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;void OPENSSL_add_all_algorithms_noconf(void)&lt;br /&gt;
{&lt;br /&gt;
    /*&lt;br /&gt;
     * For the moment OPENSSL_cpuid_setup does something&lt;br /&gt;
     * only on IA-32, but we reserve the option for all&lt;br /&gt;
     * platforms...&lt;br /&gt;
     */&lt;br /&gt;
    OPENSSL_cpuid_setup();&lt;br /&gt;
    OpenSSL_add_all_ciphers();&lt;br /&gt;
    OpenSSL_add_all_digests();&lt;br /&gt;
    ...&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;OpenSSL_add_all_ciphers&amp;lt;/tt&amp;gt; looks a lot like &amp;lt;tt&amp;gt;SSL_library_init&amp;lt;/tt&amp;gt; from the &amp;lt;tt&amp;gt;libssl&amp;lt;/tt&amp;gt; initialization routines (sans the call to &amp;lt;tt&amp;gt;ssl_load_ciphers&amp;lt;/tt&amp;gt;). Below is an excerpt from &amp;lt;tt&amp;gt;c_allc.c&amp;lt;/tt&amp;gt; (with some additional formatting for clarity).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;void OpenSSL_add_all_ciphers(void)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
#ifndef OPENSSL_NO_DES&lt;br /&gt;
    EVP_add_cipher(EVP_des_cfb());&lt;br /&gt;
    EVP_add_cipher(EVP_des_cfb1());&lt;br /&gt;
    EVP_add_cipher(EVP_des_cfb8());&lt;br /&gt;
    EVP_add_cipher(EVP_des_ede_cfb());&lt;br /&gt;
    EVP_add_cipher(EVP_des_ede3_cfb());&lt;br /&gt;
    EVP_add_cipher(EVP_des_ede3_cfb1());&lt;br /&gt;
    EVP_add_cipher(EVP_des_ede3_cfb8());&lt;br /&gt;
    ...&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
#ifndef OPENSSL_NO_RC4&lt;br /&gt;
    EVP_add_cipher(EVP_rc4());&lt;br /&gt;
    EVP_add_cipher(EVP_rc4_40());&lt;br /&gt;
# ifndef OPENSSL_NO_MD5&lt;br /&gt;
    EVP_add_cipher(EVP_rc4_hmac_md5());&lt;br /&gt;
# endif&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
    /* Note: there is no call to ssl_load_ciphers() here */&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, [http://www.openssl.org/docs/crypto/OpenSSL_add_all_algorithms.html &amp;lt;tt&amp;gt;OpenSSL_add_all_algorithms(3)&amp;lt;/tt&amp;gt;] offers the following advice:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Calling OpenSSL_add_all_algorithms() links in all algorithms: as a result a statically linked executable can be quite large. If this is important it is possible to just add the required ciphers and digests.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want the small footprint, then call &amp;lt;tt&amp;gt;EVP_add_cipher&amp;lt;/tt&amp;gt; with the ciphers and algorithms you need (and nothing more).&lt;br /&gt;
&lt;br /&gt;
=== Library Apps ===&lt;br /&gt;
&lt;br /&gt;
The following examines how the OpenSSL development team uses initialization in the OpenSSL utilities.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;enc&amp;lt;/tt&amp;gt; initializes itself with the following calls:&lt;br /&gt;
* OpenSSL_add_all_algorithms();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;dec&amp;lt;/tt&amp;gt; initializes itself with the following calls:&lt;br /&gt;
* OpenSSL_add_all_algorithms();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;pkcs8&amp;lt;/tt&amp;gt; initializes itself with the following calls:&lt;br /&gt;
* ERR_load_crypto_strings();&lt;br /&gt;
* OpenSSL_add_all_algorithms();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cms_sign&amp;lt;/tt&amp;gt; initializes itself with the following calls:&lt;br /&gt;
* OpenSSL_add_all_algorithms();&lt;br /&gt;
* ERR_load_crypto_strings();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cms_ver&amp;lt;/tt&amp;gt; initializes itself with the following calls:&lt;br /&gt;
* OpenSSL_add_all_algorithms();&lt;br /&gt;
* ERR_load_crypto_strings();&lt;br /&gt;
&lt;br /&gt;
== OpenSSL_config ==&lt;br /&gt;
&lt;br /&gt;
If you are supporting early and late versions of the library and need to call &amp;lt;tt&amp;gt;OpenSSL_config&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;OPENSSL_init_crypto&amp;lt;/tt&amp;gt;, then the following is roughly equivalent.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;openssl/crypto.h&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
#if OPENSSL_VERSION_NUMBER &amp;lt; 0x10001000L&lt;br /&gt;
    OPENSSL_config(NULL);&lt;br /&gt;
#else&lt;br /&gt;
    OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);&lt;br /&gt;
#endif&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ENGINEs and RDRAND ==&lt;br /&gt;
&lt;br /&gt;
A call to &amp;lt;tt&amp;gt;ENGINE_load_builtin_engines&amp;lt;/tt&amp;gt; loads all built-in engines, including those for &amp;lt;tt&amp;gt;AES_NI&amp;lt;/tt&amp;gt; instructions and &amp;lt;tt&amp;gt;RDRAND&amp;lt;/tt&amp;gt;. After the call, OpenSSL will use the engines for AES encryption and random number generation, if available. In this case, &amp;lt;tt&amp;gt;RDRAND&amp;lt;/tt&amp;gt; will be the only source of random numbers.&lt;br /&gt;
&lt;br /&gt;
If you are concerned over possible &amp;lt;tt&amp;gt;RDRAND&amp;lt;/tt&amp;gt; tampering, then you should explicitly call &amp;lt;tt&amp;gt;RAND_set_rand_engine(NULL)&amp;lt;/tt&amp;gt; after loading all engines. If another module in the program happens to call &amp;lt;tt&amp;gt;ENGINE_load_builtin_engines&amp;lt;/tt&amp;gt; again, then you will go back to using &amp;lt;tt&amp;gt;RDRAND&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You can also call &amp;lt;tt&amp;gt;ENGINE_unregister_RAND&amp;lt;/tt&amp;gt; followed by &amp;lt;tt&amp;gt;ENGINE_register_all_complete&amp;lt;/tt&amp;gt; to unregister &amp;lt;tt&amp;gt;RDRAND&amp;lt;/tt&amp;gt; as default random number generator implementation.&lt;br /&gt;
&lt;br /&gt;
To avoid accidental use of &amp;lt;tt&amp;gt;RDRAND&amp;lt;/tt&amp;gt;, you can build OpenSSL with &amp;lt;tt&amp;gt;OPENSSL_NO_RDRAND&amp;lt;/tt&amp;gt; defined. This is the preferred method to avoid all use of &amp;lt;tt&amp;gt;RDRAND&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Future version of the library will change the default behavior. That is, in the future, you will have to explicitly call &amp;lt;tt&amp;gt;ENGINE_load_rdrand&amp;lt;/tt&amp;gt; if you want to use &amp;lt;tt&amp;gt;RDRAND&amp;lt;/tt&amp;gt;. The change has been checked in, but its only available through &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; at the moment.&lt;br /&gt;
&lt;br /&gt;
For the full discussion, see coderman's ''[http://seclists.org/fulldisclosure/2013/Dec/99 RDRAND used directly when default engines loaded in openssl-1.0.1-beta1 through openssl-1.0.1e]''.&lt;br /&gt;
&lt;br /&gt;
== Static Locks ==&lt;br /&gt;
&lt;br /&gt;
If your program is multi-threaded, then you will need to install the static locks. The static locks are used for extensively for &amp;lt;tt&amp;gt;libssl&amp;lt;/tt&amp;gt;, and used in the random number generator for &amp;lt;tt&amp;gt;libcrypto&amp;lt;/tt&amp;gt;. The locks should be installed '''''after''''' the calling:&lt;br /&gt;
&lt;br /&gt;
* SSL_library_init&lt;br /&gt;
* OpenSSL_add_ssl_algorithms&lt;br /&gt;
* OpenSSL_add_all_algorithms&lt;br /&gt;
* SSL_load_error_strings&lt;br /&gt;
* ERR_load_crypto_strings&lt;br /&gt;
&lt;br /&gt;
See [http://stackoverflow.com/a/42856544/608639 Multithreaded program using OpenSSL and locks randomly crashes] on Stack Overflow and [http://www.openssl.org/docs/crypto/threads.html threads(3)] for details until the wiki is updated with an example.&lt;br /&gt;
&lt;br /&gt;
== OPENSSL_config ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;OPENSSL_config&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;OPENSSL_noconfig&amp;lt;/tt&amp;gt; loads and unloads &amp;lt;tt&amp;gt;openssl.cnf&amp;lt;/tt&amp;gt;. More correctly, a call to &amp;lt;tt&amp;gt;OPENSSL_config(NULL)&amp;lt;/tt&amp;gt; loads the default configuration in &amp;lt;tt&amp;gt;openssl.cnf&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;OPENSSL_config(filename)&amp;lt;/tt&amp;gt; loads another configuration, and &amp;lt;tt&amp;gt;OPENSSL_noconfig&amp;lt;/tt&amp;gt; unlods a configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;OPENSSL_config&amp;lt;/tt&amp;gt; may (or may not) be called depending upon how the OpenSSL library was configured, and it depends on whether &amp;lt;tt&amp;gt;OPENSSL_LOAD_CONF&amp;lt;/tt&amp;gt; was defined. Because &amp;lt;tt&amp;gt;OPENSSL_config&amp;lt;/tt&amp;gt; may (or may not) be called, your program may or may not need to make the call to &amp;lt;tt&amp;gt;OPENSSL_config&amp;lt;/tt&amp;gt;. If, for example, your program is dynamically loading an ENGINE from &amp;lt;tt&amp;gt;OPENSSL_config&amp;lt;/tt&amp;gt;, then you will need to ensure a call to &amp;lt;tt&amp;gt;OPENSSL_config&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You can check the value of &amp;lt;tt&amp;gt;OPENSSL_LOAD_CONF&amp;lt;/tt&amp;gt; by &amp;lt;tt&amp;gt;cat&amp;lt;/tt&amp;gt;'ing you&amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;openssl/opensslconf.h&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;. You can then decide to call &amp;lt;tt&amp;gt;OPENSSL_config&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;OPENSSL_noconfig&amp;lt;/tt&amp;gt; based upon the definition (or lack threof) for &amp;lt;tt&amp;gt;OPENSSL_LOAD_CONF&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ cat /usr/local/ssl/include/openssl/opensslconf.h | grep -i load&lt;br /&gt;
$&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here are the rules you should observe. In either case, your program should not depend upon the OpenSSL library and get into a known state.&lt;br /&gt;
&lt;br /&gt;
* If you need something from &amp;lt;tt&amp;gt;openssl.cnf&amp;lt;/tt&amp;gt;, then call &amp;lt;tt&amp;gt;OPENSSL_config&amp;lt;/tt&amp;gt;. Don't depend on the library to do it for you.&lt;br /&gt;
* If you don't need something from &amp;lt;tt&amp;gt;openssl.cnf&amp;lt;/tt&amp;gt; (or its mucking up you program), then call &amp;lt;tt&amp;gt;OPENSSL_noconfig&amp;lt;/tt&amp;gt;. The library may have called &amp;lt;tt&amp;gt;OPENSSL_config&amp;lt;/tt&amp;gt; for you.&lt;br /&gt;
&lt;br /&gt;
== Engines ==&lt;br /&gt;
&lt;br /&gt;
If your application needs to use engines, then it should either call call &amp;lt;tt&amp;gt;ENGINE_load_builtin_engines&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;OPENSSL_config&amp;lt;/tt&amp;gt; to load the built-in engines (including dynamically configured engines from &amp;lt;tt&amp;gt;openssl.cnf&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Engines are are automatically loaded (or not loaded) based on the definition of &amp;lt;tt&amp;gt;OPENSSL_LOAD_CONF&amp;lt;/tt&amp;gt; (or lack of definition). You should not depend on library behavior, so you should call &amp;lt;tt&amp;gt;OPENSSL_config&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;ENGINE_load_builtin_engines&amp;lt;/tt&amp;gt; if you need engines.&lt;br /&gt;
&lt;br /&gt;
You can also load a particular engine if you know what you want to use. &amp;lt;tt&amp;gt;eng_all.c&amp;lt;/tt&amp;gt; lists the built-in engines you can load. For example, the following loads the &amp;lt;tt&amp;gt;rdrand&amp;lt;/tt&amp;gt; engine provided for some Intel CPUs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;unsigned long err = 0;&lt;br /&gt;
int rc = 0;&lt;br /&gt;
&lt;br /&gt;
OPENSSL_cpuid_setup();&lt;br /&gt;
ENGINE_load_rdrand();&lt;br /&gt;
&lt;br /&gt;
ENGINE* eng = ENGINE_by_id(&amp;quot;rdrand&amp;quot;);&lt;br /&gt;
if(NULL == eng) handleFailure();&lt;br /&gt;
&lt;br /&gt;
rc = ENGINE_init(eng);&lt;br /&gt;
if(1 != rc) handleFailure();&lt;br /&gt;
&lt;br /&gt;
rc = ENGINE_set_default(eng, ENGINE_METHOD_RAND);&lt;br /&gt;
if(1 != rc) handleFailure();&lt;br /&gt;
&lt;br /&gt;
/* OK to proceed */&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
ENGINE_finish(eng);&lt;br /&gt;
ENGINE_free(eng);&lt;br /&gt;
ENGINE_cleanup();&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want an engine to provide all incumbent functionality for the OpenSSL library, then then call &amp;lt;tt&amp;gt;ENGINE_register_complete&amp;lt;/tt&amp;gt; after loading the engine. Incumbent functionality is determined by the manufacturer and includes includes RSA, DSA, DH, ECDH, MD, and RAND operations. See &amp;lt;tt&amp;gt;eng_all.c&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;eng_fat.c&amp;lt;/tt&amp;gt;, and [http://www.openssl.org/docs/crypto/engine.html engine(3)] for details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ENGINE* eng = ENGINE_by_id(&amp;quot;XXX&amp;quot;);&lt;br /&gt;
if(!(eng-&amp;gt;flags &amp;amp; ENGINE_FLAGS_NO_REGISTER_ALL))&lt;br /&gt;
    ENGINE_register_complete(eng);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cleanup ==&lt;br /&gt;
&lt;br /&gt;
How to cleanup the library arises on occasion. Its often in the context of running a program under a memory checker like Valgrind.&lt;br /&gt;
&lt;br /&gt;
OpenSSL does not provide a &amp;lt;tt&amp;gt;SSL_library_uninit&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;SSL_library_cleanup&amp;lt;/tt&amp;gt; function (also see [http://rt.openssl.org/Ticket/Display.html?id=3824&amp;amp;user=guest&amp;amp;pass=guest Issue #3824, FEATURE: Please provide a function to unintialize the library]). To cleanup the library the library call the following functions:&lt;br /&gt;
&lt;br /&gt;
* FIPS_mode_set(0);&lt;br /&gt;
* ENGINE_cleanup();&lt;br /&gt;
* CONF_modules_unload(1);&lt;br /&gt;
* EVP_cleanup();&lt;br /&gt;
* CRYPTO_cleanup_all_ex_data();&lt;br /&gt;
* ERR_remove_state();&lt;br /&gt;
* ERR_free_strings();&lt;br /&gt;
&lt;br /&gt;
'''Note:''' ERR_remove_state() was deprecated in OpenSSL 1.0.0 when ERR_remove_thread_state() was introduced. ERR_remove_thread_state() was deprecated in OpenSSL 1.1.0 when the thread handling functionality was entirely rewritten.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;CRYPTO_cleanup_all_ex_data&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ERR_remove_state&amp;lt;/tt&amp;gt; should be called on each thread, and not just the main thread.&lt;br /&gt;
&lt;br /&gt;
The above list is a minimum to call. You will still need to cleanup Diffie-Hellman parameters, server contexts, static locks, etc.&lt;br /&gt;
&lt;br /&gt;
After cleanup, you may have some memory leaks due to dynamic allocation of private static variables like &amp;lt;tt&amp;gt;ssl_comp_methods&amp;lt;/tt&amp;gt;. This is a well known issue (see [http://rt.openssl.org/Ticket/Display.html?id=2561&amp;amp;user=guest&amp;amp;pass=guest Issue #2561, Memory leak with SSL built-in compressions]).&lt;br /&gt;
&lt;br /&gt;
==Autoconf==&lt;br /&gt;
&lt;br /&gt;
OpenSSL uses its own configuration system, and does not use Autoconf. However, a number of popular projects use both OpenSSL and Autoconf, and it would be usful to detect either &amp;lt;tt&amp;gt;OPENSSL_init_ssl&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;SSL_library_init&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;libssl&amp;lt;/tt&amp;gt;. To craft a feature test for OpenSSL that recognizes both &amp;lt;tt&amp;gt;OPENSSL_init_ssl&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;SSL_library_init&amp;lt;/tt&amp;gt;, you can use the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if test &amp;quot;$with_openssl&amp;quot; = yes ; then&lt;br /&gt;
  dnl Order matters!&lt;br /&gt;
  if test &amp;quot;$PORTNAME&amp;quot; != &amp;quot;win32&amp;quot;; then&lt;br /&gt;
     AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])])&lt;br /&gt;
     FOUND_SSL_LIB=&amp;quot;no&amp;quot;&lt;br /&gt;
     AC_CHECK_LIB(ssl, OPENSSL_init_ssl, [FOUND_SSL_LIB=&amp;quot;yes&amp;quot;])&lt;br /&gt;
     AC_CHECK_LIB(ssl, SSL_library_init, [FOUND_SSL_LIB=&amp;quot;yes&amp;quot;])&lt;br /&gt;
     AS_IF([test &amp;quot;x$FOUND_SSL_LIB&amp;quot; = xno], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])])&lt;br /&gt;
  else&lt;br /&gt;
     AC_SEARCH_LIBS(CRYPTO_new_ex_data, eay32 crypto, [], [AC_MSG_ERROR([library 'eay32' or 'crypto' is required for OpenSSL])])&lt;br /&gt;
     FOUND_SSL_LIB=&amp;quot;no&amp;quot;&lt;br /&gt;
     AC_SEARCH_LIBS(OPENSSL_init_ssl, ssleay32 ssl, [FOUND_SSL_LIB=&amp;quot;yes&amp;quot;])&lt;br /&gt;
     AC_SEARCH_LIBS(SSL_library_init, ssleay32 ssl, [FOUND_SSL_LIB=&amp;quot;yes&amp;quot;])&lt;br /&gt;
     AS_IF([test &amp;quot;x$FOUND_SSL_LIB&amp;quot; = xno], [AC_MSG_ERROR([library 'ssleay32' or 'ssl' is required for OpenSSL])])&lt;br /&gt;
  fi&lt;br /&gt;
fi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many thanks to the Postgres folks for donating part of their &amp;lt;tt&amp;gt;configure.in&amp;lt;/tt&amp;gt;. Also see [http://stackoverflow.com/q/39285733 How to tell Autoconf “require symbol A or B” from LIB?] on Stack Overflow.&lt;br /&gt;
&lt;br /&gt;
[[Category:Examples]]&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3127</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3127"/>
		<updated>2020-10-15T12:59:42Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Library Contexts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
One of the standard providers available is the FIPS provider. This makes available FIPS validated cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
* The RAND_DRBG subsystem has been removed.  The new EVP_RAND is a partial replacement: the DRBG callback framework is absent.&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OSSL_LIB_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OSSL_LIB_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
'''Note:''' ''In alpha releases of OpenSSL 3.0.0 up until alpha6, the OSSL_LIB_CTX was called OPENSSL_CTX. It was renamed for OpenSSL 3.0.0 alpha7. If you are still using an alpha6 release or earlier, take a look at this [https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;amp;oldid=3119 older version of the wiki page].''&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OSSL_LIB_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OSSL_LIB_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OSSL_LIB_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OSSL_LIB_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the high level APIs a provider is selected. It is that provider implementation that actually does the required work. There are five providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The base provider. This contains a small sub-set of non-cryptographic algorithms available in the default provider. For example algorithms to serialize and deserialize keys to files. If you do not load the default provider then you should always load this one instead (including if you are using the FIPS provider).&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
        OSSL_PROVIDER *base;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        base = OSSL_PROVIDER_load(NULL, &amp;quot;base&amp;quot;);&lt;br /&gt;
        if (base == NULL) {&lt;br /&gt;
            OSSL_PROVIDER_unload(fips);&lt;br /&gt;
            printf(&amp;quot;Failed to load base provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(base);&lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Also note that in this example we have additionally loaded the &amp;quot;base&amp;quot; provider. This loads a sub-set of algorithms that are also available in the default provider - specifically non cryptographic ones which may be used in conjunction with the FIPS provider. For example this contains algorithms for serializing and de-serializing keys. If you decide not to load the default provider then you will usually want to load the base provider instead.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the high level APIs, such as EVP, instead)&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
All of the above APIs are deprecated in OpenSSL 3.0 - so a simple rule is to avoid using all deprecated functions.&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default and base providers that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS and base providers. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OSSL_LIB_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    nonfipslibctx = OSSL_LIB_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS and base providers so we&lt;br /&gt;
     * don't need to explicitly load them here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OSSL_LIB_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OSSL_LIB_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OSSL_LIB_CTX_free(fipslibctx);&lt;br /&gt;
    OSSL_LIB_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers and Deserializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers and deserializers are used to read and write keys or parameters from or to some external format (for example a PEM file). If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. Similarly you need a deserializer to read previously saved keys and parameters. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer/deserializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers and deserializers are implemented in both the default and base providers and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers/deserializers have the &amp;quot;fips=yes&amp;quot; property against them. You should ensure that either the default or base provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithm, here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3118</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3118"/>
		<updated>2020-08-06T12:13:28Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Using Serializers with the FIPS module */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
One of the standard providers available is the FIPS provider. This makes available FIPS validated cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so -provider_name fips -mac_name HMAC -macopt digest:SHA256 -section_name fips_sect&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OPENSSL_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OPENSSL_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OPENSSL_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OPENSSL_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OPENSSL_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OPENSSL_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the high level APIs a provider is selected. It is that provider implementation that actually does the required work. There are five providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The base provider. This contains a small sub-set of non-cryptographic algorithms available in the default provider. For example algorithms to serialize and deserialize keys to files. If you do not load the default provider then you should always load this one instead (including if you are using the FIPS provider).&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
        OSSL_PROVIDER *base;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        base = OSSL_PROVIDER_load(NULL, &amp;quot;base&amp;quot;);&lt;br /&gt;
        if (base == NULL) {&lt;br /&gt;
            OSSL_PROVIDER_unload(fips);&lt;br /&gt;
            printf(&amp;quot;Failed to load base provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(base);&lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Also note that in this example we have additionally loaded the &amp;quot;base&amp;quot; provider. This loads a sub-set of algorithms that are also available in the default provider - specifically non cryptographic ones which may be used in conjunction with the FIPS provider. For example this contains algorithms for serializing and de-serializing keys. If you decide not to load the default provider then you will usually want to load the base provider instead.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the high level APIs, such as EVP, instead)&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
All of the above APIs are deprecated in OpenSSL 3.0 - so a simple rule is to avoid using all deprecated functions.&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default and base providers that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS and base providers. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OPENSSL_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    nonfipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS and base providers so we&lt;br /&gt;
     * don't need to explicitly load them here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OPENSSL_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OPENSSL_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OPENSSL_CTX_free(fipslibctx);&lt;br /&gt;
    OPENSSL_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers and Deserializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers and deserializers are used to read and write keys or parameters from or to some external format (for example a PEM file). If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. Similarly you need a deserializer to read previously saved keys and parameters. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer/deserializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers and deserializers are implemented in both the default and base providers and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers/deserializers have the &amp;quot;fips=yes&amp;quot; property against them. You should ensure that either the default or base provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithm, here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3117</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3117"/>
		<updated>2020-08-06T12:10:04Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Programmatically loading the FIPS module (non-default library context) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
One of the standard providers available is the FIPS provider. This makes available FIPS validated cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so -provider_name fips -mac_name HMAC -macopt digest:SHA256 -section_name fips_sect&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OPENSSL_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OPENSSL_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OPENSSL_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OPENSSL_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OPENSSL_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OPENSSL_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the high level APIs a provider is selected. It is that provider implementation that actually does the required work. There are five providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The base provider. This contains a small sub-set of non-cryptographic algorithms available in the default provider. For example algorithms to serialize and deserialize keys to files. If you do not load the default provider then you should always load this one instead (including if you are using the FIPS provider).&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
        OSSL_PROVIDER *base;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        base = OSSL_PROVIDER_load(NULL, &amp;quot;base&amp;quot;);&lt;br /&gt;
        if (base == NULL) {&lt;br /&gt;
            OSSL_PROVIDER_unload(fips);&lt;br /&gt;
            printf(&amp;quot;Failed to load base provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(base);&lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Also note that in this example we have additionally loaded the &amp;quot;base&amp;quot; provider. This loads a sub-set of algorithms that are also available in the default provider - specifically non cryptographic ones which may be used in conjunction with the FIPS provider. For example this contains algorithms for serializing and de-serializing keys. If you decide not to load the default provider then you will usually want to load the base provider instead.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the high level APIs, such as EVP, instead)&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
All of the above APIs are deprecated in OpenSSL 3.0 - so a simple rule is to avoid using all deprecated functions.&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default and base providers that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS and base providers. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OPENSSL_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    nonfipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS and base providers so we&lt;br /&gt;
     * don't need to explicitly load them here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OPENSSL_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OPENSSL_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OPENSSL_CTX_free(fipslibctx);&lt;br /&gt;
    OPENSSL_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers are used to read and write keys or parameters from or to some external format (for example a PEM file). In the OpenSSL 3.0 alpha 1 and alpha 2 releases only the &amp;quot;write&amp;quot; serializers have been implemented. Reading will come in a later alpha release. If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers are implemented in the default provider and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers have the &amp;quot;fips=yes&amp;quot; property against them. You must ensure that the default provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithm, here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3116</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3116"/>
		<updated>2020-08-06T12:09:49Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Programmatically loading the FIPS module (non-default library context) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
One of the standard providers available is the FIPS provider. This makes available FIPS validated cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so -provider_name fips -mac_name HMAC -macopt digest:SHA256 -section_name fips_sect&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OPENSSL_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OPENSSL_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OPENSSL_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OPENSSL_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OPENSSL_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OPENSSL_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the high level APIs a provider is selected. It is that provider implementation that actually does the required work. There are five providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The base provider. This contains a small sub-set of non-cryptographic algorithms available in the default provider. For example algorithms to serialize and deserialize keys to files. If you do not load the default provider then you should always load this one instead (including if you are using the FIPS provider).&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
        OSSL_PROVIDER *base;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        base = OSSL_PROVIDER_load(NULL, &amp;quot;base&amp;quot;);&lt;br /&gt;
        if (base == NULL) {&lt;br /&gt;
            OSSL_PROVIDER_unload(fips);&lt;br /&gt;
            printf(&amp;quot;Failed to load base provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(base);&lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Also note that in this example we have additionally loaded the &amp;quot;base&amp;quot; provider. This loads a sub-set of algorithms that are also available in the default provider - specifically non cryptographic ones which may be used in conjunction with the FIPS provider. For example this contains algorithms for serializing and de-serializing keys. If you decide not to load the default provider then you will usually want to load the base provider instead.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the high level APIs, such as EVP, instead)&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
All of the above APIs are deprecated in OpenSSL 3.0 - so a simple rule is to avoid using all deprecated functions.&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default and base providers that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS and base providers. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OPENSSL_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    nonfipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS and base provider so we&lt;br /&gt;
     * don't need to explicitly load them here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OPENSSL_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OPENSSL_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OPENSSL_CTX_free(fipslibctx);&lt;br /&gt;
    OPENSSL_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers are used to read and write keys or parameters from or to some external format (for example a PEM file). In the OpenSSL 3.0 alpha 1 and alpha 2 releases only the &amp;quot;write&amp;quot; serializers have been implemented. Reading will come in a later alpha release. If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers are implemented in the default provider and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers have the &amp;quot;fips=yes&amp;quot; property against them. You must ensure that the default provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithm, here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3115</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3115"/>
		<updated>2020-08-06T12:07:01Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Loading the FIPS module at the same time as other providers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
One of the standard providers available is the FIPS provider. This makes available FIPS validated cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so -provider_name fips -mac_name HMAC -macopt digest:SHA256 -section_name fips_sect&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OPENSSL_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OPENSSL_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OPENSSL_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OPENSSL_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OPENSSL_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OPENSSL_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the high level APIs a provider is selected. It is that provider implementation that actually does the required work. There are five providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The base provider. This contains a small sub-set of non-cryptographic algorithms available in the default provider. For example algorithms to serialize and deserialize keys to files. If you do not load the default provider then you should always load this one instead (including if you are using the FIPS provider).&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
        OSSL_PROVIDER *base;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        base = OSSL_PROVIDER_load(NULL, &amp;quot;base&amp;quot;);&lt;br /&gt;
        if (base == NULL) {&lt;br /&gt;
            OSSL_PROVIDER_unload(fips);&lt;br /&gt;
            printf(&amp;quot;Failed to load base provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(base);&lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Also note that in this example we have additionally loaded the &amp;quot;base&amp;quot; provider. This loads a sub-set of algorithms that are also available in the default provider - specifically non cryptographic ones which may be used in conjunction with the FIPS provider. For example this contains algorithms for serializing and de-serializing keys. If you decide not to load the default provider then you will usually want to load the base provider instead.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the high level APIs, such as EVP, instead)&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
All of the above APIs are deprecated in OpenSSL 3.0 - so a simple rule is to avoid using all deprecated functions.&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default and base providers that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS provider. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OPENSSL_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    nonfipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS provider so we don't&lt;br /&gt;
     * need to explicitly load it here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OPENSSL_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OPENSSL_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OPENSSL_CTX_free(fipslibctx);&lt;br /&gt;
    OPENSSL_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers are used to read and write keys or parameters from or to some external format (for example a PEM file). In the OpenSSL 3.0 alpha 1 and alpha 2 releases only the &amp;quot;write&amp;quot; serializers have been implemented. Reading will come in a later alpha release. If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers are implemented in the default provider and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers have the &amp;quot;fips=yes&amp;quot; property against them. You must ensure that the default provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithm, here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3114</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3114"/>
		<updated>2020-08-06T12:03:58Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Programmatically loading the FIPS module (default library context) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
One of the standard providers available is the FIPS provider. This makes available FIPS validated cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so -provider_name fips -mac_name HMAC -macopt digest:SHA256 -section_name fips_sect&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OPENSSL_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OPENSSL_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OPENSSL_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OPENSSL_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OPENSSL_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OPENSSL_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the high level APIs a provider is selected. It is that provider implementation that actually does the required work. There are five providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The base provider. This contains a small sub-set of non-cryptographic algorithms available in the default provider. For example algorithms to serialize and deserialize keys to files. If you do not load the default provider then you should always load this one instead (including if you are using the FIPS provider).&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
        OSSL_PROVIDER *base;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        base = OSSL_PROVIDER_load(NULL, &amp;quot;base&amp;quot;);&lt;br /&gt;
        if (base == NULL) {&lt;br /&gt;
            OSSL_PROVIDER_unload(fips);&lt;br /&gt;
            printf(&amp;quot;Failed to load base provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(base);&lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Also note that in this example we have additionally loaded the &amp;quot;base&amp;quot; provider. This loads a sub-set of algorithms that are also available in the default provider - specifically non cryptographic ones which may be used in conjunction with the FIPS provider. For example this contains algorithms for serializing and de-serializing keys. If you decide not to load the default provider then you will usually want to load the base provider instead.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the high level APIs, such as EVP, instead)&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
All of the above APIs are deprecated in OpenSSL 3.0 - so a simple rule is to avoid using all deprecated functions.&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default provider that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS provider. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OPENSSL_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    nonfipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS provider so we don't&lt;br /&gt;
     * need to explicitly load it here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OPENSSL_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OPENSSL_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OPENSSL_CTX_free(fipslibctx);&lt;br /&gt;
    OPENSSL_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers are used to read and write keys or parameters from or to some external format (for example a PEM file). In the OpenSSL 3.0 alpha 1 and alpha 2 releases only the &amp;quot;write&amp;quot; serializers have been implemented. Reading will come in a later alpha release. If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers are implemented in the default provider and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers have the &amp;quot;fips=yes&amp;quot; property against them. You must ensure that the default provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithm, here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3113</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3113"/>
		<updated>2020-08-06T11:59:25Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Programmatically loading the FIPS module (default library context) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
One of the standard providers available is the FIPS provider. This makes available FIPS validated cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so -provider_name fips -mac_name HMAC -macopt digest:SHA256 -section_name fips_sect&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OPENSSL_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OPENSSL_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OPENSSL_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OPENSSL_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OPENSSL_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OPENSSL_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the high level APIs a provider is selected. It is that provider implementation that actually does the required work. There are five providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The base provider. This contains a small sub-set of non-cryptographic algorithms available in the default provider. For example algorithms to serialize and deserialize keys to files. If you do not load the default provider then you should always load this one instead (including if you are using the FIPS provider).&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
        OSSL_PROVIDER *base;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        base = OSSL_PROVIDER_load(NULL, &amp;quot;base&amp;quot;);&lt;br /&gt;
        if (base == NULL) {&lt;br /&gt;
            OSSL_PROVIDER_unload(fips);&lt;br /&gt;
            printf(&amp;quot;Failed to load base provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(base);&lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the EVP APIs instead). All such APIs are deprecated in OpenSSL 3.0 - so a simple rule is to avoid using all deprecated functions.&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default provider that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS provider. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OPENSSL_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    nonfipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS provider so we don't&lt;br /&gt;
     * need to explicitly load it here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OPENSSL_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OPENSSL_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OPENSSL_CTX_free(fipslibctx);&lt;br /&gt;
    OPENSSL_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers are used to read and write keys or parameters from or to some external format (for example a PEM file). In the OpenSSL 3.0 alpha 1 and alpha 2 releases only the &amp;quot;write&amp;quot; serializers have been implemented. Reading will come in a later alpha release. If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers are implemented in the default provider and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers have the &amp;quot;fips=yes&amp;quot; property against them. You must ensure that the default provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithm, here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3112</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3112"/>
		<updated>2020-08-05T14:30:55Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Providers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
One of the standard providers available is the FIPS provider. This makes available FIPS validated cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so -provider_name fips -mac_name HMAC -macopt digest:SHA256 -section_name fips_sect&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OPENSSL_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OPENSSL_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OPENSSL_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OPENSSL_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OPENSSL_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OPENSSL_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the high level APIs a provider is selected. It is that provider implementation that actually does the required work. There are five providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The base provider. This contains a small sub-set of non-cryptographic algorithms available in the default provider. For example algorithms to serialize and deserialize keys to files. If you do not load the default provider then you should always load this one instead (including if you are using the FIPS provider).&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the EVP APIs instead). All such APIs are deprecated in OpenSSL 3.0 - so a simple rule is to avoid using all deprecated functions.&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default provider that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS provider. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OPENSSL_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    nonfipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS provider so we don't&lt;br /&gt;
     * need to explicitly load it here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OPENSSL_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OPENSSL_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OPENSSL_CTX_free(fipslibctx);&lt;br /&gt;
    OPENSSL_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers are used to read and write keys or parameters from or to some external format (for example a PEM file). In the OpenSSL 3.0 alpha 1 and alpha 2 releases only the &amp;quot;write&amp;quot; serializers have been implemented. Reading will come in a later alpha release. If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers are implemented in the default provider and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers have the &amp;quot;fips=yes&amp;quot; property against them. You must ensure that the default provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithm, here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3111</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3111"/>
		<updated>2020-08-05T14:25:25Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Completing the installation of the FIPS Module */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
One of the standard providers available is the FIPS provider. This makes available FIPS validated cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so -provider_name fips -mac_name HMAC -macopt digest:SHA256 -section_name fips_sect&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OPENSSL_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OPENSSL_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OPENSSL_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OPENSSL_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OPENSSL_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OPENSSL_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the EVP APIs a provider is selected. It is that provider implementation that actually does the required work. There are four providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the EVP APIs instead). All such APIs are deprecated in OpenSSL 3.0 - so a simple rule is to avoid using all deprecated functions.&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default provider that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS provider. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OPENSSL_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    nonfipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS provider so we don't&lt;br /&gt;
     * need to explicitly load it here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OPENSSL_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OPENSSL_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OPENSSL_CTX_free(fipslibctx);&lt;br /&gt;
    OPENSSL_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers are used to read and write keys or parameters from or to some external format (for example a PEM file). In the OpenSSL 3.0 alpha 1 and alpha 2 releases only the &amp;quot;write&amp;quot; serializers have been implemented. Reading will come in a later alpha release. If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers are implemented in the default provider and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers have the &amp;quot;fips=yes&amp;quot; property against them. You must ensure that the default provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithm, here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3110</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3110"/>
		<updated>2020-08-05T14:23:18Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
One of the standard providers available is the FIPS provider. This makes available FIPS validated cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so -provider_name fips -mac_name HMAC -macopt digest:SHA256 -macopt hexkey:00 -section_name fips_sect&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OPENSSL_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OPENSSL_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OPENSSL_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OPENSSL_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OPENSSL_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OPENSSL_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the EVP APIs a provider is selected. It is that provider implementation that actually does the required work. There are four providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the EVP APIs instead). All such APIs are deprecated in OpenSSL 3.0 - so a simple rule is to avoid using all deprecated functions.&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default provider that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS provider. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OPENSSL_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    nonfipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS provider so we don't&lt;br /&gt;
     * need to explicitly load it here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OPENSSL_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OPENSSL_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OPENSSL_CTX_free(fipslibctx);&lt;br /&gt;
    OPENSSL_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers are used to read and write keys or parameters from or to some external format (for example a PEM file). In the OpenSSL 3.0 alpha 1 and alpha 2 releases only the &amp;quot;write&amp;quot; serializers have been implemented. Reading will come in a later alpha release. If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers are implemented in the default provider and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers have the &amp;quot;fips=yes&amp;quot; property against them. You must ensure that the default provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithm, here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3109</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3109"/>
		<updated>2020-08-05T14:22:36Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Installation and Compilation of OpenSSL 3.0 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
One of the standard providers available is the FIPS provider. This makes available FIPS validated cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the EVP APIs instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so -provider_name fips -mac_name HMAC -macopt digest:SHA256 -macopt hexkey:00 -section_name fips_sect&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OPENSSL_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OPENSSL_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OPENSSL_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OPENSSL_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OPENSSL_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OPENSSL_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the EVP APIs a provider is selected. It is that provider implementation that actually does the required work. There are four providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the EVP APIs instead). All such APIs are deprecated in OpenSSL 3.0 - so a simple rule is to avoid using all deprecated functions.&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default provider that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS provider. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OPENSSL_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    nonfipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS provider so we don't&lt;br /&gt;
     * need to explicitly load it here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OPENSSL_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OPENSSL_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OPENSSL_CTX_free(fipslibctx);&lt;br /&gt;
    OPENSSL_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers are used to read and write keys or parameters from or to some external format (for example a PEM file). In the OpenSSL 3.0 alpha 1 and alpha 2 releases only the &amp;quot;write&amp;quot; serializers have been implemented. Reading will come in a later alpha release. If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers are implemented in the default provider and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers have the &amp;quot;fips=yes&amp;quot; property against them. You must ensure that the default provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithm, here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3108</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3108"/>
		<updated>2020-08-05T14:20:49Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Providers and FIPS support */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
One of the standard providers available is the FIPS provider. This makes available FIPS validated cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
NOTE: The OpenSSL 3.0 alpha 1 release contains an error introduced during the release process which results in a failed compilation. There are two workarounds to choose between:&lt;br /&gt;
&lt;br /&gt;
* apply [https://github.com/openssl/openssl/pull/11624/files the patch from github PR #11624].&lt;br /&gt;
* edit the VERSION file in the top of the distribution to remove the quotes around the date on the RELEASE_DATE line, i.e. make that line look like this:&lt;br /&gt;
&lt;br /&gt;
    RELEASE_DATE=23 Apr 2020&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the EVP APIs instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so -provider_name fips -mac_name HMAC -macopt digest:SHA256 -macopt hexkey:00 -section_name fips_sect&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OPENSSL_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OPENSSL_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OPENSSL_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OPENSSL_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OPENSSL_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OPENSSL_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the EVP APIs a provider is selected. It is that provider implementation that actually does the required work. There are four providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the EVP APIs instead). All such APIs are deprecated in OpenSSL 3.0 - so a simple rule is to avoid using all deprecated functions.&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default provider that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS provider. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OPENSSL_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    nonfipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS provider so we don't&lt;br /&gt;
     * need to explicitly load it here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OPENSSL_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OPENSSL_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OPENSSL_CTX_free(fipslibctx);&lt;br /&gt;
    OPENSSL_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers are used to read and write keys or parameters from or to some external format (for example a PEM file). In the OpenSSL 3.0 alpha 1 and alpha 2 releases only the &amp;quot;write&amp;quot; serializers have been implemented. Reading will come in a later alpha release. If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers are implemented in the default provider and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers have the &amp;quot;fips=yes&amp;quot; property against them. You must ensure that the default provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithm, here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3107</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3107"/>
		<updated>2020-08-05T14:17:54Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Low Level APIs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;high level&amp;quot; APIs (such as the &amp;quot;EVP&amp;quot; APIs) and the &amp;quot;low level&amp;quot; APIs. The high level APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the high level APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
NOTE: The OpenSSL 3.0 alpha 1 release contains an error introduced during the release process which results in a failed compilation. There are two workarounds to choose between:&lt;br /&gt;
&lt;br /&gt;
* apply [https://github.com/openssl/openssl/pull/11624/files the patch from github PR #11624].&lt;br /&gt;
* edit the VERSION file in the top of the distribution to remove the quotes around the date on the RELEASE_DATE line, i.e. make that line look like this:&lt;br /&gt;
&lt;br /&gt;
    RELEASE_DATE=23 Apr 2020&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the EVP APIs instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so -provider_name fips -mac_name HMAC -macopt digest:SHA256 -macopt hexkey:00 -section_name fips_sect&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OPENSSL_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OPENSSL_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OPENSSL_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OPENSSL_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OPENSSL_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OPENSSL_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the EVP APIs a provider is selected. It is that provider implementation that actually does the required work. There are four providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the EVP APIs instead). All such APIs are deprecated in OpenSSL 3.0 - so a simple rule is to avoid using all deprecated functions.&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default provider that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS provider. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OPENSSL_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    nonfipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS provider so we don't&lt;br /&gt;
     * need to explicitly load it here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OPENSSL_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OPENSSL_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OPENSSL_CTX_free(fipslibctx);&lt;br /&gt;
    OPENSSL_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers are used to read and write keys or parameters from or to some external format (for example a PEM file). In the OpenSSL 3.0 alpha 1 and alpha 2 releases only the &amp;quot;write&amp;quot; serializers have been implemented. Reading will come in a later alpha release. If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers are implemented in the default provider and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers have the &amp;quot;fips=yes&amp;quot; property against them. You must ensure that the default provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithm, here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3106</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3106"/>
		<updated>2020-08-05T14:16:23Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Providers and FIPS support */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 5 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;high&amp;quot; level APIs (for example those functions prefixed with &amp;quot;EVP&amp;quot;). They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;EVP&amp;quot; APIs and the &amp;quot;low level&amp;quot; APIs. The EVP APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the EVP APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
NOTE: The OpenSSL 3.0 alpha 1 release contains an error introduced during the release process which results in a failed compilation. There are two workarounds to choose between:&lt;br /&gt;
&lt;br /&gt;
* apply [https://github.com/openssl/openssl/pull/11624/files the patch from github PR #11624].&lt;br /&gt;
* edit the VERSION file in the top of the distribution to remove the quotes around the date on the RELEASE_DATE line, i.e. make that line look like this:&lt;br /&gt;
&lt;br /&gt;
    RELEASE_DATE=23 Apr 2020&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the EVP APIs instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so -provider_name fips -mac_name HMAC -macopt digest:SHA256 -macopt hexkey:00 -section_name fips_sect&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OPENSSL_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OPENSSL_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OPENSSL_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OPENSSL_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OPENSSL_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OPENSSL_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the EVP APIs a provider is selected. It is that provider implementation that actually does the required work. There are four providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the EVP APIs instead). All such APIs are deprecated in OpenSSL 3.0 - so a simple rule is to avoid using all deprecated functions.&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default provider that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS provider. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OPENSSL_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    nonfipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS provider so we don't&lt;br /&gt;
     * need to explicitly load it here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OPENSSL_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OPENSSL_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OPENSSL_CTX_free(fipslibctx);&lt;br /&gt;
    OPENSSL_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers are used to read and write keys or parameters from or to some external format (for example a PEM file). In the OpenSSL 3.0 alpha 1 and alpha 2 releases only the &amp;quot;write&amp;quot; serializers have been implemented. Reading will come in a later alpha release. If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers are implemented in the default provider and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers have the &amp;quot;fips=yes&amp;quot; property against them. You must ensure that the default provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithm, here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3105</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3105"/>
		<updated>2020-07-31T09:15:28Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Fetching algorithms and property queries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 4 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;EVP&amp;quot; set of APIs. They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;EVP&amp;quot; APIs and the &amp;quot;low level&amp;quot; APIs. The EVP APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the EVP APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
NOTE: The OpenSSL 3.0 alpha 1 release contains an error introduced during the release process which results in a failed compilation. There are two workarounds to choose between:&lt;br /&gt;
&lt;br /&gt;
* apply [https://github.com/openssl/openssl/pull/11624/files the patch from github PR #11624].&lt;br /&gt;
* edit the VERSION file in the top of the distribution to remove the quotes around the date on the RELEASE_DATE line, i.e. make that line look like this:&lt;br /&gt;
&lt;br /&gt;
    RELEASE_DATE=23 Apr 2020&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the EVP APIs instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so -provider_name fips -mac_name HMAC -macopt digest:SHA256 -macopt hexkey:00 -section_name fips_sect&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OPENSSL_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OPENSSL_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OPENSSL_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OPENSSL_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OPENSSL_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OPENSSL_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the EVP APIs a provider is selected. It is that provider implementation that actually does the required work. There are four providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the EVP APIs instead). All such APIs are deprecated in OpenSSL 3.0 - so a simple rule is to avoid using all deprecated functions.&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default provider that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS provider. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OPENSSL_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    nonfipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS provider so we don't&lt;br /&gt;
     * need to explicitly load it here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OPENSSL_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OPENSSL_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OPENSSL_CTX_free(fipslibctx);&lt;br /&gt;
    OPENSSL_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers are used to read and write keys or parameters from or to some external format (for example a PEM file). In the OpenSSL 3.0 alpha 1 and alpha 2 releases only the &amp;quot;write&amp;quot; serializers have been implemented. Reading will come in a later alpha release. If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers are implemented in the default provider and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers have the &amp;quot;fips=yes&amp;quot; property against them. You must ensure that the default provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithm, here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3104</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3104"/>
		<updated>2020-07-31T09:14:46Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Loading the FIPS module at the same time as other providers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 4 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;EVP&amp;quot; set of APIs. They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;EVP&amp;quot; APIs and the &amp;quot;low level&amp;quot; APIs. The EVP APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the EVP APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
NOTE: The OpenSSL 3.0 alpha 1 release contains an error introduced during the release process which results in a failed compilation. There are two workarounds to choose between:&lt;br /&gt;
&lt;br /&gt;
* apply [https://github.com/openssl/openssl/pull/11624/files the patch from github PR #11624].&lt;br /&gt;
* edit the VERSION file in the top of the distribution to remove the quotes around the date on the RELEASE_DATE line, i.e. make that line look like this:&lt;br /&gt;
&lt;br /&gt;
    RELEASE_DATE=23 Apr 2020&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the EVP APIs instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so -provider_name fips -mac_name HMAC -macopt digest:SHA256 -macopt hexkey:00 -section_name fips_sect&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OPENSSL_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OPENSSL_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OPENSSL_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OPENSSL_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OPENSSL_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OPENSSL_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the EVP APIs a provider is selected. It is that provider implementation that actually does the required work. There are four providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
Note that default properties are not currently functional in the OpenSSL 3.0 alpha 1 or alpha 2 releases.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the EVP APIs instead). All such APIs are deprecated in OpenSSL 3.0 - so a simple rule is to avoid using all deprecated functions.&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default provider that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default_sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS provider. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OPENSSL_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    nonfipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS provider so we don't&lt;br /&gt;
     * need to explicitly load it here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OPENSSL_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OPENSSL_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OPENSSL_CTX_free(fipslibctx);&lt;br /&gt;
    OPENSSL_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers are used to read and write keys or parameters from or to some external format (for example a PEM file). In the OpenSSL 3.0 alpha 1 and alpha 2 releases only the &amp;quot;write&amp;quot; serializers have been implemented. Reading will come in a later alpha release. If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers are implemented in the default provider and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers have the &amp;quot;fips=yes&amp;quot; property against them. You must ensure that the default provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithm, here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - aarch64                    ||  Yes   ||  Yes      || Tested on 13.0-CURRENT&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - amd64                      ||  Yes   ||  Yes      || Tested on 12.1-STABLE and 11.3-STABLE&lt;br /&gt;
|-&lt;br /&gt;
| FreeBSD - i386                       ||  Yes   ||  Yes      || Had to run &amp;lt;code&amp;gt;./config no-pic&amp;lt;/code&amp;gt; due to lack of CAST PIC support&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=Configuration_%22packages%22&amp;diff=3103</id>
		<title>Configuration &quot;packages&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=Configuration_%22packages%22&amp;diff=3103"/>
		<updated>2020-07-31T08:47:33Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Files to add */ Apply changed suggested in https://github.com/openssl/openssl/issues/12542&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you're missing a configuration for you platform, you may find a &amp;quot;package&amp;quot; here, which may be drop in files just as well as suggestions on what to change in the OpenSSL source to accommodate it.&lt;br /&gt;
&lt;br /&gt;
== z/OS [OpenSSL 1.1.1] ==&lt;br /&gt;
&lt;br /&gt;
OpenSSL 1.1.1 isn't supported on z/OS.&lt;br /&gt;
&lt;br /&gt;
However, if you want to build OpenSSL on z/OS anyway, here are a few hints on how to do that. Though these hints are intended to be helpful, they might not work for you at all, depending on your build environment.&lt;br /&gt;
&lt;br /&gt;
=== Files to add ===&lt;br /&gt;
&lt;br /&gt;
These files can be added in the OpenSSL source tree, in &amp;lt;tt&amp;gt;Configurations/&amp;lt;/tt&amp;gt; or in a separate directory.  In the latter case, set the environment variable &amp;lt;tt&amp;gt;OPENSSL_LOCAL_CONFIG_DIR&amp;lt;/tt&amp;gt; to that directory's name to tell OpenSSL's Configure where they are.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;00-base-zos.conf&amp;lt;/tt&amp;gt;:&lt;br /&gt;
 # Feel free to experiment by uncommenting&lt;br /&gt;
 zos_asm =&amp;gt; {&lt;br /&gt;
     template             =&amp;gt; 1,&lt;br /&gt;
     # cpuid_asm_src      =&amp;gt; &amp;quot;s390xcap.c # s390xcpuid.s&amp;quot;,&lt;br /&gt;
     bn_asm_src           =&amp;gt; &amp;quot;bn_asm.c&amp;quot;, # s390x-gf2m.s&lt;br /&gt;
     # ec_asm_src         =&amp;gt; &amp;quot;ecp_s390x_nistp.c&amp;quot;,&lt;br /&gt;
     # aes_asm_src        =&amp;gt; &amp;quot;aes-s390x.s aes-ctr.fake aes-xts.fake&amp;quot;,&lt;br /&gt;
     # sha1_asm_src       =&amp;gt; &amp;quot;sha1-s390x.s sha256-s390x.s sha512-s390x.s&amp;quot;,&lt;br /&gt;
     # rc4_asm_src        =&amp;gt; &amp;quot;rc4-s390x.s&amp;quot;,&lt;br /&gt;
     # modes_asm_src      =&amp;gt; &amp;quot;ghash-s390x.s&amp;quot;,&lt;br /&gt;
     # chacha_asm_src     =&amp;gt; &amp;quot;chacha-s390x.s&amp;quot;,&lt;br /&gt;
     # poly1305_asm_src   =&amp;gt; &amp;quot;poly1305-s390x.s&amp;quot;,&lt;br /&gt;
     # keccak1600_asm_src =&amp;gt; &amp;quot;keccak1600-s390x.s&amp;quot;,&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;zos-unix.conf&amp;lt;/tt&amp;gt;&lt;br /&gt;
 &amp;quot;OS390-Unix&amp;quot; =&amp;gt; {&lt;br /&gt;
     inherit_from     =&amp;gt; [ &amp;quot;BASE_unix&amp;quot;, asm(&amp;quot;zos_asm&amp;quot;) ],&lt;br /&gt;
     cc               =&amp;gt; &amp;quot;/PATH/TO/c99.sh&amp;quot;,&lt;br /&gt;
     cflags           =&amp;gt; &amp;quot;-O -Wc,dll,XPLINK,exportall,hgpr,lp64 -Wa,'GOFF,SYSPARM(USE_XPLINK)' -qlongname -qlanglvl=extc99 -DB_ENDIAN -DCHARSET_EBCDIC -DNO_SYS_PARAM_H -D_ALL_SOURCE -D_OPEN_THREADS=2 -D_POSIX_SOURCE  -D_OPEN_MSGQ_EXT&amp;quot;,&lt;br /&gt;
     module_ldflags   =&amp;gt; &amp;quot;-Wl,XPLINK,LP64&amp;quot;,&lt;br /&gt;
     shared_ldflags   =&amp;gt; &amp;quot;-Wl,dll,XPLINK,LP64&amp;quot;,&lt;br /&gt;
     shared_target    =&amp;gt; &amp;quot;OS390-shared&amp;quot;,&lt;br /&gt;
     bn_ops           =&amp;gt; &amp;quot;THIRTY_TWO_BIT RC4_CHAR&amp;quot;,&lt;br /&gt;
     thread_scheme    =&amp;gt; &amp;quot;(unknown)&amp;quot;,&lt;br /&gt;
     perlasm_scheme   =&amp;gt; &amp;quot;zOS64&amp;quot;,&lt;br /&gt;
 },&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;/PATH/TO/c99.sh&amp;lt;/tt&amp;gt;&lt;br /&gt;
 #!/bin/sh -k&lt;br /&gt;
 #&lt;br /&gt;
 # Re-order arguments so that -L comes first.&lt;br /&gt;
 #&lt;br /&gt;
 opts=&amp;quot;&amp;quot;&lt;br /&gt;
 lopts=&amp;quot;&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 for arg in $* ; do&lt;br /&gt;
   case $arg in&lt;br /&gt;
     -L*) lopts=&amp;quot;$lopts $arg&amp;quot; ;;&lt;br /&gt;
     *) opts=&amp;quot;$opts $arg&amp;quot; ;;&lt;br /&gt;
   esac&lt;br /&gt;
 done&lt;br /&gt;
 &lt;br /&gt;
 c99 -Wl,dll $lopts $opts&lt;br /&gt;
&lt;br /&gt;
Note that if you add &amp;lt;tt&amp;gt;c99.sh&amp;lt;/tt&amp;gt; in OpenSSL's &amp;lt;tt&amp;gt;util/&amp;lt;/tt&amp;gt; directory, you can set the following in &amp;lt;tt&amp;gt;zos-unix.conf&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
     cc               =&amp;gt; &amp;quot;\$(SRCDIR)/util/c99.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
=== Building OpenSSL 1.1.1 ===&lt;br /&gt;
&lt;br /&gt;
(with xplink linkage, 64 bit, from EBCDIC sources)&lt;br /&gt;
&lt;br /&gt;
# get a working EBCDIC perl version.&lt;br /&gt;
# gunzip the .tar file.&lt;br /&gt;
# use pax to extract from .tar. Example: &amp;lt;tt&amp;gt;pax -ofrom=ISO8859-1,to=IBM-1047 -rvf openssl-1.1.1e.tar&amp;lt;/tt&amp;gt;&lt;br /&gt;
# Configure: &amp;lt;tt&amp;gt;./Configure OS390-Unix&amp;lt;/tt&amp;gt;&lt;br /&gt;
# Build: &amp;lt;tt&amp;gt;make&amp;lt;/tt&amp;gt;&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=Enc&amp;diff=3101</id>
		<title>Enc</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=Enc&amp;diff=3101"/>
		<updated>2020-07-20T07:58:24Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Cipher alogorithms */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the command line tools for encryption and decryption. [[enc|Enc]] is used for various block and stream ciphers using keys based on passwords or explicitly provided. It can also be used for Base64 encoding or decoding.&lt;br /&gt;
&lt;br /&gt;
===Synopsis===&lt;br /&gt;
&lt;br /&gt;
The basic usage is to specify a ciphername and various options describing the actual task.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openssl enc -ciphername [options]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can obtain an incomplete help message by using an invalid option, eg. '''-help'''. &lt;br /&gt;
&lt;br /&gt;
===Cipher alogorithms===&lt;br /&gt;
&lt;br /&gt;
To get a list of available ciphers you can use the '''list -cipher-algorithms''' command&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openssl list -cipher-algorithms&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output gives you a list of ciphers with its variations in [[key size]] and [[mode of operation]]. For example '''AES-256-CBC''' for [[AES]] with key size 256 bits in [[CBC|CBC-mode]]. Some ciphers also have short names, for example the one just mentioned is also known as '''aes256'''. These names are case insensitive. In addition '''none''' is a valid ciphername. This algorithms does nothing at all.&lt;br /&gt;
&lt;br /&gt;
===Options===&lt;br /&gt;
The list of options is rather long.&lt;br /&gt;
&lt;br /&gt;
;-in ''filename''&lt;br /&gt;
:This specifies the input file.&lt;br /&gt;
&lt;br /&gt;
;-out ''filename''&lt;br /&gt;
:This specifies the output file. It will be created or overwritten if it already exists.&lt;br /&gt;
&lt;br /&gt;
;-e or -d&lt;br /&gt;
: This specifies whether to encrypt ('''-e''') or to decrypt ('''-d'''). Encryption is the default. Of course you have to get all the other options right in order for it to function properly. In particular it is necessary to give the correct cipher-name as well as '''-a''', '''-A''' or '''-z''' options.&lt;br /&gt;
&lt;br /&gt;
;-a, -A, -base64&lt;br /&gt;
: These flags tell OpenSSL to apply [[Base64]]-encoding before or after the cryptographic operation. The '''-a''' and '''-base64''' are equivalent. If you want to decode a base64 file it is necessary to use the '''-d''' option. By default the encoded file has a line break every 64 characters. To suppress this you can use ''in addition'' to '''-base64''' the '''-A''' flag. This will produce a file with no line breaks at all. You can use these flags just for [[#Base64 Encoding|encoding Base64]] without any ciphers involved.&lt;br /&gt;
&lt;br /&gt;
;-bufsize ''n''&lt;br /&gt;
: Specify the buffer size. This concerns only internal buffers. It has nothing to do with the cryptographic algorithms in question.&lt;br /&gt;
&lt;br /&gt;
;-debug&lt;br /&gt;
: Enable debugging output. This does not include any sensitive information. See also '''-P'''.&lt;br /&gt;
&lt;br /&gt;
;-engine ''id''&lt;br /&gt;
: Specify an [[engine]] for example to use special hardware.&lt;br /&gt;
&lt;br /&gt;
;-iv ''IV''&lt;br /&gt;
: This specifies the [[initialization vector]] ''IV'' as hexadecimal number. If not explicitly given it will be derived from the password. See key derivation for details.&lt;br /&gt;
&lt;br /&gt;
;-k ''password'',  -kfile ''filename''&lt;br /&gt;
: Both option are used to specify a password or a file containing the password which is used for key derivation. However '''they are deprecated'''. You should use the ''-pass'' option instead. The equivalents are '''-pass pass:'''''password'' and '''-pass file:'''''filename'' respectively. &lt;br /&gt;
&lt;br /&gt;
;-K ''key''&lt;br /&gt;
: This option allows you to set the ''key'' used for encryption or decryption. This is the key directly used by the cipher algorithm. If no key is given OpenSSL will derive it from a password. This process is described in PKCS5#5 (RFC-2898).&lt;br /&gt;
&lt;br /&gt;
;-md ''messagedigest''&lt;br /&gt;
: This specifies the message digest which is used for key derivation. It can take one of the values '''md2''', '''md5''', '''sha''' or '''sha1'''.&lt;br /&gt;
&lt;br /&gt;
;-nopad&lt;br /&gt;
: This disables standard padding.&lt;br /&gt;
&lt;br /&gt;
;-salt, -nosalt, -S ''salt''&lt;br /&gt;
: These options allow to switch [[Salt|salting]] on or off. With '''-S''' ''salt'' it is possible to explicitly give its value (in hexadecimal).   &lt;br /&gt;
&lt;br /&gt;
;-p, -P&lt;br /&gt;
: Additionally to any encryption tasks, this prints the key, initialization vector and salt value (if used). If '''-P''' is used just these values are printed, no encryption will take place.&lt;br /&gt;
&lt;br /&gt;
;-pass ''arg''&lt;br /&gt;
: This specifies the password source. Possible values for ''arg'' are '''pass:'''''password'' or '''file:'''''filename'', where ''password'' is your password and ''filename'' file containing the password.&lt;br /&gt;
&lt;br /&gt;
;-z&lt;br /&gt;
: Use this flag to enable [http://www.zlib.net/ zlib-compression]. After a file is encrypted (and maybe base64 encoded) it will be compressed via zlib. Vice versa while decrypting, zlib will be applied first.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
====Base64 Encoding====&lt;br /&gt;
To encode a file ''text.plain'' you can use&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openssl enc -base64 -in text.plain -out text.base64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To decode a file the the decrypt option ('''-d''') has to be used&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openssl enc -d -base64 -in text.base64 -out text.plain&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Encryption====&lt;br /&gt;
&lt;br /&gt;
=====Basic Usage=====&lt;br /&gt;
The most basic way to encrypt a file is this&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openssl enc -aes256 -base64 -in some.secret -out some.secret.enc&lt;br /&gt;
enter aes-256-cbc encryption password :&lt;br /&gt;
Verifying - enter aes-256-cbc encryption password :&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It will encrypt the file ''some.secret'' using the [[AES|AES-cipher]] in [[CBC|CBC-mode]]. The result will be Base64 encoded and written to ''some.secret.enc''. OpenSSL will ask for password which is used to derive a key as well the initialization vector.&lt;br /&gt;
Since encryption is the default, it is not necessary to use the '''-e''' option.&lt;br /&gt;
&lt;br /&gt;
=====Use a given Key=====&lt;br /&gt;
&lt;br /&gt;
It also possible to specify the key directly. For most [[modes of operations]] (i.e. all non-ECB modes) it is then necessary to specify an initialization vector. Usually it is derived together with the key form a password. And as there is no password, also all salting options are obsolete.&lt;br /&gt;
&lt;br /&gt;
The key and the IV are given in hex. Their length depending on the cipher and key size in question.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ openssl enc -des-ecb -K e0e0e0e0f1f1f1f1 -in mesg.plain -out mesg.enc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The key above is one of 16 [http://en.wikipedia.org/wiki/Weak_key weak DES keys]. It should not be used in practice.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Shell level]]&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3092</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3092"/>
		<updated>2020-05-22T07:48:18Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Confirming that an algorithm is being provided by the FIPS module */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 4 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;EVP&amp;quot; set of APIs. They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;EVP&amp;quot; APIs and the &amp;quot;low level&amp;quot; APIs. The EVP APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the EVP APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
NOTE: The OpenSSL 3.0 alpha 1 release contains an error introduced during the release process which results in a failed compilation. There are two workarounds to choose between:&lt;br /&gt;
&lt;br /&gt;
* apply [https://github.com/openssl/openssl/pull/11624/files the patch from github PR #11624].&lt;br /&gt;
* edit the VERSION file in the top of the distribution to remove the quotes around the date on the RELEASE_DATE line, i.e. make that line look like this:&lt;br /&gt;
&lt;br /&gt;
    RELEASE_DATE=23 Apr 2020&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the EVP APIs instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so -provider_name fips -mac_name HMAC -macopt digest:SHA256 -macopt hexkey:00 -section_name fips_sect&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OPENSSL_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OPENSSL_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OPENSSL_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OPENSSL_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OPENSSL_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OPENSSL_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the EVP APIs a provider is selected. It is that provider implementation that actually does the required work. There are four providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
Note that default properties are not currently functional in the OpenSSL 3.0 alpha 1 or alpha 2 releases.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the EVP APIs instead). All such APIs are deprecated in OpenSSL 3.0 - so a simple rule is to avoid using all deprecated functions.&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
NOTE: Default properties are currently not functional in the OpenSSL 3.0 alpha 1 and alpha 2 releases - see the known issues below&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default provider that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS provider. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OPENSSL_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    nonfipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS provider so we don't&lt;br /&gt;
     * need to explicitly load it here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OPENSSL_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OPENSSL_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OPENSSL_CTX_free(fipslibctx);&lt;br /&gt;
    OPENSSL_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers are used to read and write keys or parameters from or to some external format (for example a PEM file). In the OpenSSL 3.0 alpha 1 and alpha 2 releases only the &amp;quot;write&amp;quot; serializers have been implemented. Reading will come in a later alpha release. If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers are implemented in the default provider and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers have the &amp;quot;fips=yes&amp;quot; property against them. You must ensure that the default provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
=== Confirming that an algorithm is being provided by the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
A chain of links needs to be followed to go from an algorithm instance to the provider that implements it.  The process is similar for all algorithm, here the example of a digest is used.&lt;br /&gt;
&lt;br /&gt;
# To go from an ''EVP_MD_CTX'' to an ''EVP_MD'', use the '''EVP_MD_CTX_md()''' call.&lt;br /&gt;
# To go from the ''EVP_MD'' to its ''OSSL_PROVIDER'', use the '''EVP_MD_provider()''' call.&lt;br /&gt;
# To extract the name from the ''OSSL_PROVIDER'', use the '''OSSL_PROVIDER_name()''' call.&lt;br /&gt;
# Finally, use strcmp(3) or printf(3) on the name.&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3090</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3090"/>
		<updated>2020-05-15T11:33:09Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Serializers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 4 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;EVP&amp;quot; set of APIs. They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;EVP&amp;quot; APIs and the &amp;quot;low level&amp;quot; APIs. The EVP APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the EVP APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
NOTE: The OpenSSL 3.0 alpha 1 release contains an error introduced during the release process which results in a failed compilation. There are two workarounds to choose between:&lt;br /&gt;
&lt;br /&gt;
* apply [https://github.com/openssl/openssl/pull/11624/files the patch from github PR #11624].&lt;br /&gt;
* edit the VERSION file in the top of the distribution to remove the quotes around the date on the RELEASE_DATE line, i.e. make that line look like this:&lt;br /&gt;
&lt;br /&gt;
    RELEASE_DATE=23 Apr 2020&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the EVP APIs instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so -provider_name fips -mac_name HMAC -macopt digest:SHA256 -macopt hexkey:00 -section_name fips_sect&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OPENSSL_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OPENSSL_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OPENSSL_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OPENSSL_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OPENSSL_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OPENSSL_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the EVP APIs a provider is selected. It is that provider implementation that actually does the required work. There are four providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
Note that default properties are not currently functional in the OpenSSL 3.0 alpha 1 or alpha 2 releases.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the EVP APIs instead). All such APIs are deprecated in OpenSSL 3.0 - so a simple rule is to avoid using all deprecated functions.&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
NOTE: Default properties are currently not functional in the OpenSSL 3.0 alpha 1 and alpha 2 releases - see the known issues below&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default provider that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS provider. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OPENSSL_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    nonfipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS provider so we don't&lt;br /&gt;
     * need to explicitly load it here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OPENSSL_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OPENSSL_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OPENSSL_CTX_free(fipslibctx);&lt;br /&gt;
    OPENSSL_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers are used to read and write keys or parameters from or to some external format (for example a PEM file). In the OpenSSL 3.0 alpha 1 and alpha 2 releases only the &amp;quot;write&amp;quot; serializers have been implemented. Reading will come in a later alpha release. If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers are implemented in the default provider and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers have the &amp;quot;fips=yes&amp;quot; property against them. You must ensure that the default provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3089</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3089"/>
		<updated>2020-05-15T11:32:45Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Provider implemented signature */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 4 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;EVP&amp;quot; set of APIs. They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;EVP&amp;quot; APIs and the &amp;quot;low level&amp;quot; APIs. The EVP APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the EVP APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
NOTE: The OpenSSL 3.0 alpha 1 release contains an error introduced during the release process which results in a failed compilation. There are two workarounds to choose between:&lt;br /&gt;
&lt;br /&gt;
* apply [https://github.com/openssl/openssl/pull/11624/files the patch from github PR #11624].&lt;br /&gt;
* edit the VERSION file in the top of the distribution to remove the quotes around the date on the RELEASE_DATE line, i.e. make that line look like this:&lt;br /&gt;
&lt;br /&gt;
    RELEASE_DATE=23 Apr 2020&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the EVP APIs instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so -provider_name fips -mac_name HMAC -macopt digest:SHA256 -macopt hexkey:00 -section_name fips_sect&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OPENSSL_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OPENSSL_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OPENSSL_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OPENSSL_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OPENSSL_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OPENSSL_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the EVP APIs a provider is selected. It is that provider implementation that actually does the required work. There are four providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
Note that default properties are not currently functional in the OpenSSL 3.0 alpha 1 or alpha 2 releases.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the EVP APIs instead). All such APIs are deprecated in OpenSSL 3.0 - so a simple rule is to avoid using all deprecated functions.&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
NOTE: Default properties are currently not functional in the OpenSSL 3.0 alpha 1 and alpha 2 releases - see the known issues below&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default provider that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS provider. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OPENSSL_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    nonfipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS provider so we don't&lt;br /&gt;
     * need to explicitly load it here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OPENSSL_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OPENSSL_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OPENSSL_CTX_free(fipslibctx);&lt;br /&gt;
    OPENSSL_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers are used to read and write keys or parameters from or to some external format (for example a PEM file). In the OpenSSL 3.0 alpha 1 and alpha 2 releases only the &amp;quot;write&amp;quot; serializers have been implemented. Reading will come in a later alpha release. If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers are implemented in the default provider and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers have the &amp;quot;fips=yes&amp;quot; property against them. You must ensure that the default provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default, FIPS  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3088</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3088"/>
		<updated>2020-05-15T11:31:53Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Provider implemented asymmetric key types */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 4 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;EVP&amp;quot; set of APIs. They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;EVP&amp;quot; APIs and the &amp;quot;low level&amp;quot; APIs. The EVP APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the EVP APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
NOTE: The OpenSSL 3.0 alpha 1 release contains an error introduced during the release process which results in a failed compilation. There are two workarounds to choose between:&lt;br /&gt;
&lt;br /&gt;
* apply [https://github.com/openssl/openssl/pull/11624/files the patch from github PR #11624].&lt;br /&gt;
* edit the VERSION file in the top of the distribution to remove the quotes around the date on the RELEASE_DATE line, i.e. make that line look like this:&lt;br /&gt;
&lt;br /&gt;
    RELEASE_DATE=23 Apr 2020&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the EVP APIs instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so -provider_name fips -mac_name HMAC -macopt digest:SHA256 -macopt hexkey:00 -section_name fips_sect&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OPENSSL_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OPENSSL_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OPENSSL_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OPENSSL_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OPENSSL_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OPENSSL_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the EVP APIs a provider is selected. It is that provider implementation that actually does the required work. There are four providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
Note that default properties are not currently functional in the OpenSSL 3.0 alpha 1 or alpha 2 releases.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the EVP APIs instead). All such APIs are deprecated in OpenSSL 3.0 - so a simple rule is to avoid using all deprecated functions.&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
NOTE: Default properties are currently not functional in the OpenSSL 3.0 alpha 1 and alpha 2 releases - see the known issues below&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default provider that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS provider. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OPENSSL_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    nonfipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS provider so we don't&lt;br /&gt;
     * need to explicitly load it here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OPENSSL_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OPENSSL_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OPENSSL_CTX_free(fipslibctx);&lt;br /&gt;
    OPENSSL_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers are used to read and write keys or parameters from or to some external format (for example a PEM file). In the OpenSSL 3.0 alpha 1 and alpha 2 releases only the &amp;quot;write&amp;quot; serializers have been implemented. Reading will come in a later alpha release. If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers are implemented in the default provider and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers have the &amp;quot;fips=yes&amp;quot; property against them. You must ensure that the default provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default        || 80%                || ??                          || RSASSA-PSS support untested&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3087</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3087"/>
		<updated>2020-05-15T11:31:34Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Provider implemented asymmetric key types */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 4 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;EVP&amp;quot; set of APIs. They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;EVP&amp;quot; APIs and the &amp;quot;low level&amp;quot; APIs. The EVP APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the EVP APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
NOTE: The OpenSSL 3.0 alpha 1 release contains an error introduced during the release process which results in a failed compilation. There are two workarounds to choose between:&lt;br /&gt;
&lt;br /&gt;
* apply [https://github.com/openssl/openssl/pull/11624/files the patch from github PR #11624].&lt;br /&gt;
* edit the VERSION file in the top of the distribution to remove the quotes around the date on the RELEASE_DATE line, i.e. make that line look like this:&lt;br /&gt;
&lt;br /&gt;
    RELEASE_DATE=23 Apr 2020&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the EVP APIs instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so -provider_name fips -mac_name HMAC -macopt digest:SHA256 -macopt hexkey:00 -section_name fips_sect&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OPENSSL_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OPENSSL_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OPENSSL_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OPENSSL_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OPENSSL_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OPENSSL_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the EVP APIs a provider is selected. It is that provider implementation that actually does the required work. There are four providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
Note that default properties are not currently functional in the OpenSSL 3.0 alpha 1 or alpha 2 releases.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the EVP APIs instead). All such APIs are deprecated in OpenSSL 3.0 - so a simple rule is to avoid using all deprecated functions.&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
NOTE: Default properties are currently not functional in the OpenSSL 3.0 alpha 1 and alpha 2 releases - see the known issues below&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default provider that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS provider. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OPENSSL_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    nonfipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS provider so we don't&lt;br /&gt;
     * need to explicitly load it here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OPENSSL_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OPENSSL_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OPENSSL_CTX_free(fipslibctx);&lt;br /&gt;
    OPENSSL_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers are used to read and write keys or parameters from or to some external format (for example a PEM file). In the OpenSSL 3.0 alpha 1 and alpha 2 releases only the &amp;quot;write&amp;quot; serializers have been implemented. Reading will come in a later alpha release. If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers are implemented in the default provider and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers have the &amp;quot;fips=yes&amp;quot; property against them. You must ensure that the default provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 100%               || ??                          || Scheduled for alpha 2&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default        || 80%                || ??                          || RSASSA-PSS support untested&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3086</id>
		<title>OpenSSL 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_3.0&amp;diff=3086"/>
		<updated>2020-05-15T11:29:45Z</updated>

		<summary type="html">&lt;p&gt;Matt: /* Using the FIPS module in SSL/TLS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NUMBEREDHEADINGS__ &amp;lt;!-- https://www.mediawiki.org/wiki/Extension:NumberedHeadings --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is the next release of OpenSSL that is currently in development. This page is intended as a collection of notes for people downloading the alpha/beta releases or who are planning to upgrade from a previous version of OpenSSL to 3.0.&lt;br /&gt;
&lt;br /&gt;
== Main Changes in OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
=== Major Release ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL 3.0 is a major release and consequently any application that currently uses an older version of OpenSSL will at the very least need to be recompiled in order to work with the new version. It is the intention that the large majority of applications will work unchanged with OpenSSL 3.0 if those applications previously worked with OpenSSL 1.1.1. However this is not guaranteed and some changes may be required in some cases. Changes may also be required if applications need to take advantage of some of the new features available in OpenSSL 3.0 such as the availability of the FIPS module.&lt;br /&gt;
&lt;br /&gt;
=== License Change ===&lt;br /&gt;
&lt;br /&gt;
In previous versions, OpenSSL was licensed under the dual [https://www.openssl.org/source/license-openssl-ssleay.txt OpenSSL and SSLeay licenses] (both licenses apply). From OpenSSL 3.0 this is replaced by the [https://www.openssl.org/source/apache-license-2.0.txt Apache License v2].&lt;br /&gt;
&lt;br /&gt;
=== Providers and FIPS support ===&lt;br /&gt;
&lt;br /&gt;
One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider concept. Providers collect together and make available algorithm implementations. With OpenSSL 3.0 it is possible to specify, either programmatically or via a config file, which providers you want to use for any given application. OpenSSL 3.0 comes with 4 different providers as standard. Over time third parties may distribute additional providers that can be plugged into OpenSSL. All algorithm implementations available via providers are accessed through the &amp;quot;EVP&amp;quot; set of APIs. They cannot be accessed using the &amp;quot;low level&amp;quot; APIs (see below).&lt;br /&gt;
&lt;br /&gt;
=== Low Level APIs ===&lt;br /&gt;
&lt;br /&gt;
OpenSSL has historically provided two sets of APIs for invoking cryptographic algorithms: the &amp;quot;EVP&amp;quot; APIs and the &amp;quot;low level&amp;quot; APIs. The EVP APIs are typically designed to work across all algorithm types. The &amp;quot;low level&amp;quot; APIs are targeted at a specific algorithm implementation. For example, the EVP APIs provide the functions `EVP_EncryptInit_ex`, `EVP_EncryptUpdate` and `EVP_EncryptFinal` to perform symmetric encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc. On the other hand to do AES encryption using the low level APIs you would have to call AES specific functions such as `AES_set_encrypt_key`, `AES_encrypt`, and so on. The functions for 3DES are different.&lt;br /&gt;
&lt;br /&gt;
Use of the low level APIs has been informally discouraged by the OpenSSL development team for a long time. However in OpenSSL 3.0 this is made more formal. All such low level APIs have been deprecated. You may still ''use'' them in your applications, but you may start to see deprecation warnings during compilation (dependent on compiler support for this). Deprecated APIs may be removed from future versions of OpenSSL so you are strongly encouraged to update your code to use the EVP APIs instead.&lt;br /&gt;
&lt;br /&gt;
=== Legacy Algorithms ===&lt;br /&gt;
&lt;br /&gt;
Some cryptographic algorithms that were available via the EVP APIs are now considered legacy and their use is strongly discouraged. These legacy EVP algorithms are still available in OpenSSL 3.0 but not by default. If you want to use them then you must load the legacy provider. This can be as simple as a config file change, or can be done programmatically (see below).&lt;br /&gt;
&lt;br /&gt;
=== Engines and &amp;quot;METHOD&amp;quot; APIs ===&lt;br /&gt;
&lt;br /&gt;
The refactoring to support Providers conflicts internally with the APIs used to support engines, including the ENGINE API and any function that creates or modifies custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.). These functions are being deprecated in OpenSSL 3.0, and users of these APIs should know that their use can likely bypass provider selection and configuration, with unintended consequences. This is particularly relevant for applications written to use the OpenSSL 3.0 FIPS module, as detailed below.&lt;br /&gt;
Authors and maintainers of external engines are strongly encouraged to refactor their code transforming engines into providers using the new Provider API and avoiding deprecated methods.&lt;br /&gt;
&lt;br /&gt;
=== Versioning Scheme ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL versioning scheme has changed with the 3.0 release. The new versioning scheme has this format:&lt;br /&gt;
&lt;br /&gt;
MAJOR.MINOR.PATCH&lt;br /&gt;
&lt;br /&gt;
For version 1.1.1 and below different patch levels were indicated by a letter at the end of the release version number. This will no longer be used and instead the patch level is indicated by the final number in the version. A change in the second (MINOR) number indicates that new features may have been added. OpenSSL versions with the same major number are API and ABI compatible. If the major number changes then API and ABI compatibility is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Other major new features ===&lt;br /&gt;
&lt;br /&gt;
* Implementation of the Certificate Management Protocol (CMP, RFC 4210) also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712)&lt;br /&gt;
* A proper HTTP(S) client in libcrypto supporting GET and POST, redirection, plain and ASN.1-encoded contents, proxies, and timeouts&lt;br /&gt;
* EVP_KDF APIs have been introduced for working with Key Derivation Functions&lt;br /&gt;
* EVP_MAC APIs have been introduced for working with MACs&lt;br /&gt;
* Support for Linux Kernel TLS&lt;br /&gt;
&lt;br /&gt;
=== Other notable deprecations and changes ===&lt;br /&gt;
&lt;br /&gt;
* The function code part of an OpenSSL error code is no longer relevant and is always set to zero. Related functions are deprecated.&lt;br /&gt;
&lt;br /&gt;
* The STACK and HASH macro's have been cleaned up, so that the type-safe wrappers are declared everywhere and implemented once.  See the manpage at https://www.openssl.org/docs/manmaster/man3/DEFINE_STACK_OF.html for stack, and hopefully soon once the PR is merged, https://www.openssl.org/docs/manmaster/man3/DECLARE_LHASH_OF.html (but not yet as of this writing).&lt;br /&gt;
&lt;br /&gt;
== Installation and Compilation of OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the INSTALL.md file in the top of the distribution for instructions on how to build and install OpenSSL 3.0. Please also refer to the various platform specific NOTES files for your specific platform.&lt;br /&gt;
&lt;br /&gt;
NOTE: The OpenSSL 3.0 alpha 1 release contains an error introduced during the release process which results in a failed compilation. There are two workarounds to choose between:&lt;br /&gt;
&lt;br /&gt;
* apply [https://github.com/openssl/openssl/pull/11624/files the patch from github PR #11624].&lt;br /&gt;
* edit the VERSION file in the top of the distribution to remove the quotes around the date on the RELEASE_DATE line, i.e. make that line look like this:&lt;br /&gt;
&lt;br /&gt;
    RELEASE_DATE=23 Apr 2020&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight forward in most cases. The most likely area where you will encounter problems is if you have used low level APIs in your code (as discussed above). In that case you are likely to start seeing deprecation warnings when compiling your application. If this happens you have 3 options:&lt;br /&gt;
&lt;br /&gt;
1) Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
2) Suppress the warnings. Refer to your compiler documentation on how to do this.&lt;br /&gt;
&lt;br /&gt;
3) Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the EVP APIs instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more difficult. In addition to the issues discussed above in the section about upgrading from 1.1.1, the main things to be aware of are:&lt;br /&gt;
&lt;br /&gt;
1) The build and installation procedure has changed significantly since OpenSSL 1.0.2. Check the file INSTALL.md in the top of the installation for instructions on how to build and install OpenSSL for your platform. Also checkout the various NOTES files in the same directory, as applicable for your platform.&lt;br /&gt;
&lt;br /&gt;
2) Many structures have been made opaque in OpenSSL 3.0. The structure definitions have been removed from the public header files and moved to internal header files. In practice this means that you can no longer stack allocate some structures. Instead they must be heap allocated through some function call (typically those function names have a `_new` suffix to them). Additionally you must use &amp;quot;setter&amp;quot; or &amp;quot;getter&amp;quot; functions to access the fields within those structures.&lt;br /&gt;
&lt;br /&gt;
For example code that previously looked like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_init(&amp;amp;md_ctx);&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
&lt;br /&gt;
will now generate compiler errors. For example:&lt;br /&gt;
&lt;br /&gt;
 md_ctx.c:6:16: error: storage size of ‘md_ctx’ isn’t known&lt;br /&gt;
&lt;br /&gt;
The code needs to be amended to look like this:&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *md_ctx;&lt;br /&gt;
 &lt;br /&gt;
 md_ctx = EVP_MD_CTX_new();&lt;br /&gt;
 if (md_ctx == NULL)&lt;br /&gt;
    /* Error */;&lt;br /&gt;
 &lt;br /&gt;
 /* Do something with the md_ctx */&lt;br /&gt;
 &lt;br /&gt;
 EVP_MD_CTX_free(md_ctx);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Support for TLSv1.3 has been added which has a number of implications for SSL/TLS applications. See the [[TLS1.3]] page for further details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0 can be found on the [[OpenSSL_1.1.0_Changes|OpenSSL 1.1.0 Changes]] page.&lt;br /&gt;
&lt;br /&gt;
=== Upgrading from the OpenSSL 2.0 FIPS Object Module ===&lt;br /&gt;
&lt;br /&gt;
The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built separately and then integrated into your main OpenSSL 1.0.2 build. In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of OpenSSL and is no longer a separate download. You do not need to take separate build steps to add the FIPS support - it is built by default. You ''do'' need to take steps to ensure that your application is ''using'' the FIPS module in OpenSSL 3.0. See the further notes below on configuring this.&lt;br /&gt;
&lt;br /&gt;
The function calls 'FIPS_mode()' and 'FIPS_mode_set()' have been removed from OpenSSL 3.0. You should rewrite your application to not use them. See the sections below on how to write applications to use the FIPS Module in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
== Completing the installation of the FIPS Module ==&lt;br /&gt;
&lt;br /&gt;
Once OpenSSL has been built and installed you will need to take explicit steps to complete the installation of the FIPS module (if you wish to use it). The OpenSSL 3.0 FIPS support is in the form of the FIPS provider which, on Unix, is in a `fips.so` file. On Windows this will be called `fips.dll`. Following installation of OpenSSL 3.0 the default location for this file is '/usr/local/lib/ossl-modules/fips.so' on Unix or 'C:\Program Files\OpenSSL\lib\ossl-modules\fips.dll' on Windows.&lt;br /&gt;
&lt;br /&gt;
To complete the installation you need to run the 'fipsinstall' command line application. This does 2 things:&lt;br /&gt;
&lt;br /&gt;
* Runs the FIPS module self tests&lt;br /&gt;
* Generates FIPS module config file output containing information about the module such as the self test status, and the module checksum&lt;br /&gt;
&lt;br /&gt;
The FIPS module ''must'' have the self tests run, and the FIPS module config file output generated on ''every'' machine that it is to be used on. You '''must not''' copy the FIPS module config file output data from one machine to another.&lt;br /&gt;
&lt;br /&gt;
For example, to install the FIPS module to its default location:&lt;br /&gt;
&lt;br /&gt;
 $ openssl fipsinstall -out /usr/local/ssl/fipsmodule.cnf -module /usr/local/lib/ossl-modules/fips.so -provider_name fips -mac_name HMAC -macopt digest:SHA256 -macopt hexkey:00 -section_name fips_sect&lt;br /&gt;
&lt;br /&gt;
If you installed OpenSSL to a different location, you need to adjust the output and module path accordingly.&lt;br /&gt;
&lt;br /&gt;
== Programming in OpenSSL 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Applications written to work with OpenSSL 1.1.1 will mostly just work with OpenSSL 3.0. However changes will be required if you want to take advantage of some of the new features that OpenSSL 3.0 makes available. In order to do that you need to understand some new concepts introduced in OpenSSL 3.0.&lt;br /&gt;
&lt;br /&gt;
=== Library Contexts ===&lt;br /&gt;
&lt;br /&gt;
A library context can be thought of as a &amp;quot;scope&amp;quot; for OpenSSL operations. All functionality operates with the scope of a library context. Multiple library contexts may exist at the same time, and they each may be configured differently. A library context is represented by the newly introduced OPENSSL_CTX type. See the man page [https://www.openssl.org/docs/manmaster/man3/OPENSSL_CTX.html here].&lt;br /&gt;
&lt;br /&gt;
Many new functions have been introduced into OpenSSL that take an OPENSSL_CTX parameter. In many cases these are variants of some other function that existed in 1.1.1 and work in much the same way - except that they now operate within the scope of the given library context.&lt;br /&gt;
&lt;br /&gt;
All applications have available to them the &amp;quot;default library context&amp;quot;. This library context always exists and, if you don't otherwise specify one, this is the library context that will be used. Any function that takes an OPENSSL_CTX value as a parameter will accept the value NULL for that parameter in order to refer to the default library context. You can also explicitly create new ones via the OPENSSL_CTX_new() function. See the man page for further details.&lt;br /&gt;
&lt;br /&gt;
Config files affect a given library context. It is quite possible to have multiple library contexts in use, with each one having been configured with a different config file (see the OPENSSL_CTX_load_config() function described on the man page).&lt;br /&gt;
&lt;br /&gt;
=== Providers ===&lt;br /&gt;
&lt;br /&gt;
Providers are containers for algorithm implementations. Whenever a cryptographic algorithm is used via the EVP APIs a provider is selected. It is that provider implementation that actually does the required work. There are four providers distributed with OpenSSL. In the future we expect third parties to distribute their own providers which can be added to OpenSSL dynamically. Documentation about writing providers is available on the man page [https://www.openssl.org/docs/manmaster/man7/provider.html here].&lt;br /&gt;
&lt;br /&gt;
The standard providers are:&lt;br /&gt;
&lt;br /&gt;
* The default provider. This collects together all of the standard built-in OpenSSL algorithm implementations. If an application doesn't specify anything else explicitly (e.g. in the application or via config), then this is the provider that will be used. It is loaded automatically the first time that we try to get an algorithm from a provider if no other provider has been loaded yet. If another provider has already been loaded then it won't be loaded automatically. Therefore if you want to use it in conjunction with other providers then you must load it explicitly. This is a &amp;quot;built-in&amp;quot; provider which means that it is built into libcrypto and does not exist as a separate standalone module.&lt;br /&gt;
&lt;br /&gt;
* The legacy provider. This is a collection of legacy algorithms that are either no longer in common use or strongly discouraged from use. However some applications may need to use these algorithms for backwards compatibility reasons. This provider is NOT loaded by default. This may mean that some applications upgrading from earlier versions of OpenSSL may find that some algorithms are no longer available unless they load the legacy provider explicitly. Algorithms in the legacy provider include MD2, MD4, MDC2, RMD160, CAST5, BF (Blowfish), IDEA, SEED, RC2, RC4, RC5 and DES (but not 3DES).&lt;br /&gt;
&lt;br /&gt;
* The FIPS provider. This contains a sub-set of the algorithm implementations available from the default provider. Algorithms available in this provider conform to FIPS standards. It is intended that this provider will be FIPS140-2 validated. In some cases there may be minor behavioural differences between algorithm implementations in this provider compared to the equivalent algorithm in the default provider. This is typically in order to conform to FIPS standards.&lt;br /&gt;
&lt;br /&gt;
* The null provider. This provider is &amp;quot;built-in&amp;quot; to libcrypto and contains no algorithm implementations. In order to guarantee that the default provider is not automatically loaded, the null provider can be loaded instead. This can be useful if you are using non-default library contexts and want to ensure that the default library context is never used &amp;quot;by accident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Providers to be loaded can be specified in the OpenSSL config file. See the man page [https://www.openssl.org/docs/manmaster/man5/config.html here]for information about how to configure providers via the config file, and how to automatically activate them.&lt;br /&gt;
This is a minimal config file example to load and activate both the legacy and the default provider in the default library context.&lt;br /&gt;
&lt;br /&gt;
    openssl_conf = openssl_init&lt;br /&gt;
    &lt;br /&gt;
    [openssl_init]&lt;br /&gt;
    providers = provider_sect&lt;br /&gt;
    &lt;br /&gt;
    [provider_sect]&lt;br /&gt;
    default = default_sect&lt;br /&gt;
    legacy = legacy_sect&lt;br /&gt;
    &lt;br /&gt;
    [default_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
    [legacy_sect]&lt;br /&gt;
    activate = 1&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
It is also possible to load them programmatically. For example you can load the legacy provider into the default library context as shown below. Note that once you have explicitly loaded a provider into the library context the default provider will no longer be automatically loaded. Therefore you will often also want to explicitly load the default provider, as is done here:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *legacy;&lt;br /&gt;
        OSSL_PROVIDER *deflt;&lt;br /&gt;
    &lt;br /&gt;
        /* Load Multiple providers into the default (NULL) library context */&lt;br /&gt;
        legacy = OSSL_PROVIDER_load(NULL, &amp;quot;legacy&amp;quot;);&lt;br /&gt;
        if (legacy == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Legacy provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
        deflt = OSSL_PROVIDER_load(NULL, &amp;quot;default&amp;quot;);&lt;br /&gt;
        if (deflt == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load Default provider\n&amp;quot;);&lt;br /&gt;
            OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(legacy);&lt;br /&gt;
        OSSL_PROVIDER_unload(deflt);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Fetching algorithms and property queries ===&lt;br /&gt;
&lt;br /&gt;
In order to use a cryptographic algorithm (such as AES) then an implementation for it must first be &amp;quot;fetched&amp;quot; from the available providers that have been loaded into the library context being used. This can be done either implicitly or explicitly.&lt;br /&gt;
&lt;br /&gt;
With implicit fetching the application does not need to do anything special. Algorithms implementations will be fetched automatically by the relevant APIs. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
&lt;br /&gt;
In this code we are initialising a digest operation to use the SHA256 algorithm. The EVP_DigestInit_ex() function will automatically fetch an implementation of the SHA256 algorithm from the available providers when it needs to. It will do so using the default library context and the default property query string (see below).&lt;br /&gt;
&lt;br /&gt;
With explicit fetching an application fetches the implementation to be used up front, and then passes that to the relevant EVP API. For example:&lt;br /&gt;
&lt;br /&gt;
    EVP_MD_CTX *mdctx;&lt;br /&gt;
    EVP_MD *sha256;&lt;br /&gt;
    &lt;br /&gt;
    mdctx = EVP_MD_CTX_new();&lt;br /&gt;
    if (mdctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Setting the library ctx to NULL here fetches the algorithm from the providers loaded&lt;br /&gt;
     * into the default library context&lt;br /&gt;
     */&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (sha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    if (EVP_DigestInit_ex(mdctx, sha256, NULL) != 1)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Explicit fetches return a dynamic object that must be freed */&lt;br /&gt;
    EVP_MD_free(sha256);&lt;br /&gt;
&lt;br /&gt;
In this example we have explicitly fetched an implementation of SHA256 from the set of available providers loaded into the default library context.&lt;br /&gt;
&lt;br /&gt;
With an explicit fetch we can additionally supply a property query to further specify which implementation we wish to obtain. For example:&lt;br /&gt;
&lt;br /&gt;
    sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Here we are explicitly fetching a FIPS validated implementation of the SHA256 algorithm. Such an implementation exists in the FIPS provider, so we would need to have ensured that the FIPS provider was loaded into the default library context in order for this to be successful. If no algorithm implementation that matches the criteria can be located then the fetch will fail.&lt;br /&gt;
&lt;br /&gt;
See the section on fetching algorithms in the provider man page for further details: [https://www.openssl.org/docs/manmaster/man7/provider.html#Fetching-algorithms].&lt;br /&gt;
&lt;br /&gt;
If no specific property query is required then NULL can be passed for the last argument. In any case any supplied property query is combined with the default property query. If nothing else is specified then the default property query is empty. However this can be changed so that every fetch automatically inherits these default properties. Default properties can either be set programmatically or via a config file. See the section [[OpenSSL 3.0#Loading the FIPS module at the same time as other providers|Loading the FIPS module at the same time as other providers]] for an example of how to do this.&lt;br /&gt;
&lt;br /&gt;
Note that default properties are not currently functional in the OpenSSL 3.0 alpha 1 or alpha 2 releases.&lt;br /&gt;
&lt;br /&gt;
== Using the FIPS Module in applications ==&lt;br /&gt;
&lt;br /&gt;
There are a number of different ways that OpenSSL can be used in conjunction with the FIPS module. Which is the correct approach to use will depend on your own specific circumstances and what you are attempting to achieve. Note that the old functions FIPS_mode() and FIPS_mode_set() are no longer present so you must remove them from your application if you use them.&lt;br /&gt;
&lt;br /&gt;
=== Making all applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
One simple approach is to cause all applications that are using OpenSSL to only use the FIPS module for cryptographic algorithms by default.&lt;br /&gt;
&lt;br /&gt;
This approach can be done purely via configuration. As long as applications are built and linked against OpenSSL 3.0 and do not override the loading of the default config file or its settings then they will automatically start using the FIPS module without the need for any further code changes.&lt;br /&gt;
&lt;br /&gt;
To do this the default OpenSSL config file will have to be modified. The location of this config file will depend on the platform, and any options that were given during the build process. You can check the location of the config file by running this command:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -d&lt;br /&gt;
 OPENSSLDIR: &amp;quot;/usr/local/ssl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Caution: Many Operating Systems install OpenSSL by default. It is a common error to not have the correct version of OpenSSL on your $PATH. Check that you are running an OpenSSL 3.0 version like this:&lt;br /&gt;
&lt;br /&gt;
 $ openssl version -v&lt;br /&gt;
 OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)&lt;br /&gt;
&lt;br /&gt;
The OPENSSLDIR value above gives the directory name for where the default config file is stored. So in this case the default config file will be called /usr/local/ssl/openssl.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the config file to add the following lines near the beginning:&lt;br /&gt;
&lt;br /&gt;
 openssl_conf = openssl_init&lt;br /&gt;
 &lt;br /&gt;
 .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
 &lt;br /&gt;
 [openssl_init]&lt;br /&gt;
 providers = provider_sect&lt;br /&gt;
 &lt;br /&gt;
 [provider_sect]&lt;br /&gt;
 fips = fips_sect&lt;br /&gt;
&lt;br /&gt;
Obviously the include file location above should match the name of the FIPS module config file that you installed earlier.&lt;br /&gt;
&lt;br /&gt;
Any applications that use OpenSSL 3.0 and are started after these changes are made will start using only the FIPS module unless those applications take explicit steps to avoid this default behaviour.&lt;br /&gt;
&lt;br /&gt;
This approach has the primary advantage that it is simple, and no code changes are required in applications in order to benefit from the FIPS module. There are some disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
* You may not want ''all'' applications to use the FIPS module. It may be the case that some applications should and some should not.&lt;br /&gt;
* If applications take explicit steps to not load the default config file or set different settings then this method will not work for them&lt;br /&gt;
* The algorithms available in the FIPS module are a subset of the algorithms that are available in the default OpenSSL Provider. If those applications attempt to use any algorithms that are not present, then they will fail.&lt;br /&gt;
* Usage of certain APIs avoids the use of the FIPS module. If any applications use those APIs then the FIPS module will not be used.&lt;br /&gt;
&lt;br /&gt;
=== Selectively making applications use the FIPS module by default ===&lt;br /&gt;
&lt;br /&gt;
A variation on the above approach is to do the same thing on an individual application basis. The default OpenSSL config file depends on the compiled in value for OPENSSLDIR as described in the section above. However it is also possible to override the config file to be used via the OPENSSL_CONF environment variable. For example the following on Unix will cause the application to be executed with a non-standard config file location:&lt;br /&gt;
&lt;br /&gt;
 $ OPENSSL_CONF=/my/non-default/openssl.cnf myapplication&lt;br /&gt;
&lt;br /&gt;
Using this mechanism you can control which config file is loaded (and hence whether the FIPS module is loaded) on an application by application basis.&lt;br /&gt;
&lt;br /&gt;
This removes the disadvantage listed above that you may not want all applications to use the FIPS module. All the other advantages and disadvantages still apply.&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (default library context) ===&lt;br /&gt;
&lt;br /&gt;
Applications may choose to load the FIPS provider explicitly rather than relying on config to do this. The config file is still necessary in order to hold the FIPS module config data (such as its self test status and integrity data). But in this case we do not automatically activate the FIPS provider via that config file.&lt;br /&gt;
&lt;br /&gt;
To do things this way configure as per the section &amp;quot;Making all applications use the FIPS module by default&amp;quot; above, but edit the fipsmodule.cnf file to remove or comment out the line which says &amp;quot;activate = 1&amp;quot;. This means all the required config information will be available to load the FIPS module, but it is not actually automatically loaded when the application starts. The FIPS provider can then be loaded programmatically like this:&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;openssl/provider.h&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    int main(void)&lt;br /&gt;
    {&lt;br /&gt;
        OSSL_PROVIDER *fips;&lt;br /&gt;
    &lt;br /&gt;
        fips = OSSL_PROVIDER_load(NULL, &amp;quot;fips&amp;quot;);&lt;br /&gt;
        if (fips == NULL) {&lt;br /&gt;
            printf(&amp;quot;Failed to load FIPS provider\n&amp;quot;);&lt;br /&gt;
            exit(EXIT_FAILURE);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        /* Rest of application */&lt;br /&gt;
    &lt;br /&gt;
        OSSL_PROVIDER_unload(fips);&lt;br /&gt;
        exit(EXIT_SUCCESS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that this should be one of the first things that you do in your application. If any OpenSSL functions get called that require the use of cryptographic functions before this occurs then, if no provider has yet been loaded, then the default provider will be automatically loaded. If you then later explicitly load the FIPS provider then you will have both the FIPS and the default provider loaded at the same time. It is undefined which implementation of an algorithm will be used if multiple implementations are available and you have not explicitly specified via a property query (see below) which one should be used.&lt;br /&gt;
&lt;br /&gt;
Applications written to use the OpenSSL 3.0 FIPS module should not use any legacy APIs or features that avoid the FIPS module. Specifically this includes:&lt;br /&gt;
&lt;br /&gt;
* Low level cryptographic APIs (use the EVP APIs instead). All such APIs are deprecated in OpenSSL 3.0 - so a simple rule is to avoid using all deprecated functions.&lt;br /&gt;
* Engines&lt;br /&gt;
* Any functions that create or modify custom &amp;quot;METHODS&amp;quot; (for example EVP_MD_meth_new, EVP_CIPHER_meth_new, EVP_PKEY_meth_new, RSA_meth_new, EC_KEY_METHOD_new, etc.)&lt;br /&gt;
&lt;br /&gt;
=== Loading the FIPS module at the same time as other providers ===&lt;br /&gt;
&lt;br /&gt;
It is possible to have the FIPS provider and other providers (such as the default provider) all loaded at the same time into the same library context. You can use a property query string during algorithm fetches to specify which implementation you would like to use. &lt;br /&gt;
&lt;br /&gt;
For example to fetch an implementation of SHA256 which conforms to FIPS standards you can specify the property query &amp;quot;fips=yes&amp;quot; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no property query is specified, or more than one implementation matches the property query then it is undefined which implementation of a particular algorithm will be returned.&lt;br /&gt;
&lt;br /&gt;
This example shows an explicit request for an implementation of SHA256 from the default provider:&lt;br /&gt;
&lt;br /&gt;
   EVP_MD *sha256;&lt;br /&gt;
   &lt;br /&gt;
   sha256 = EVP_MD_fetch(NULL, &amp;quot;SHA2-256&amp;quot;, &amp;quot;provider=default&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
It is also possible to set a default property query string. The following example sets the default property query of &amp;quot;fips=yes&amp;quot; for all fetches within the default library  context:&lt;br /&gt;
&lt;br /&gt;
   EVP_set_default_properties(NULL, &amp;quot;fips=yes&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
NOTE: Default properties are currently not functional in the OpenSSL 3.0 alpha 1 and alpha 2 releases - see the known issues below&lt;br /&gt;
&lt;br /&gt;
If a fetch function has both an explicit property query specified, and a default property query is defined then the two queries are merged together and both apply. It is also possible for a locally specified property query to override the default properties.&lt;br /&gt;
&lt;br /&gt;
There are two important built-in properties that you should be aware of:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;provider&amp;quot; property enables you to specify which provider you want an implementation to be fetched from, e.g. &amp;quot;provider=default&amp;quot; or &amp;quot;provider=fips&amp;quot;. All algorithms implemented in a provider have this property set on them.&lt;br /&gt;
&lt;br /&gt;
There is also the &amp;quot;fips&amp;quot; property. All FIPS algorithms match against the property query &amp;quot;fips=yes&amp;quot;. There are also some non-cryptographic algorithms available in the default provider that also have the &amp;quot;fips=yes&amp;quot; property defined for them. These are the serializer algorithms that can (for example) be used to write out a key generated in the FIPS provider to a file. The serializer algorithms are not in the FIPS module itself but are allowed to be used in conjunction with the FIPS algorithms.&lt;br /&gt;
&lt;br /&gt;
It is possible to specify default properties within a config file. For example the following config file automatically loads the default and fips providers and sets the default property value to be &amp;quot;fips=yes&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
   openssl_conf = openssl_init&lt;br /&gt;
   &lt;br /&gt;
   .include /usr/local/ssl/fipsmodule.cnf&lt;br /&gt;
   &lt;br /&gt;
   [openssl_init]&lt;br /&gt;
   providers = provider_sect&lt;br /&gt;
   alg_section = algorithm_sect&lt;br /&gt;
   &lt;br /&gt;
   [provider_sect]&lt;br /&gt;
   fips = fips_sect&lt;br /&gt;
   default = default sect&lt;br /&gt;
   &lt;br /&gt;
   [default_sect]&lt;br /&gt;
   activate = 1&lt;br /&gt;
   &lt;br /&gt;
   [algorithm_sect]&lt;br /&gt;
   default_properties = fips=yes&lt;br /&gt;
&lt;br /&gt;
=== Programmatically loading the FIPS module (non-default library context) ===&lt;br /&gt;
&lt;br /&gt;
In addition to using properties to separate usage of the FIPS module from other usages this can also be achieved using library contexts. In this example we create two library contexts. In one we assume the existence of a config file called &amp;quot;openssl-fips.cnf&amp;quot; that automatically loads and configures the FIPS provider. The other library context will just use the default provider.&lt;br /&gt;
&lt;br /&gt;
    OPENSSL_CTX *fipslibctx, *nonfipslibctx;&lt;br /&gt;
    OSSL_PROVIDER *defctxnull = NULL;&lt;br /&gt;
    EVP_MD *fipssha256 = NULL, *nonfipssha256 = NULL;&lt;br /&gt;
    int ret = 1;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Create two non-default library contexts. One for fips usage and one for&lt;br /&gt;
     * non-fips usage&lt;br /&gt;
     */&lt;br /&gt;
    fipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    nonfipslibctx = OPENSSL_CTX_new();&lt;br /&gt;
    if (fipslibctx == NULL || nonfipslibctx == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Prevent anything from using the default library context */&lt;br /&gt;
    defctxnull = OSSL_PROVIDER_load(NULL, &amp;quot;null&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * Load config file for the FIPS library context. We assume that this&lt;br /&gt;
     * config file will automatically activate the FIPS provider so we don't&lt;br /&gt;
     * need to explicitly load it here.&lt;br /&gt;
     */&lt;br /&gt;
    if (!OPENSSL_CTX_load_config(fipslibctx, &amp;quot;openssl-fips.cnf&amp;quot;))&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /*&lt;br /&gt;
     * We don't need to do anything special to load the default provider into&lt;br /&gt;
     * nonfipslibctx. This happens automatically if no other providers are&lt;br /&gt;
     * loaded. Because we don't call OPENSSL_CTX_load_config() explicitly for&lt;br /&gt;
     * nonfipslibctx it will just use the default config file.&lt;br /&gt;
     */&lt;br /&gt;
    &lt;br /&gt;
    /* As an example get some digests */&lt;br /&gt;
    &lt;br /&gt;
    /* Get a FIPS validated digest */&lt;br /&gt;
    fipssha256 = EVP_MD_fetch(fipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (fipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Get a non-FIPS validated digest */&lt;br /&gt;
    nonfipssha256 = EVP_MD_fetch(nonfipslibctx, &amp;quot;SHA2-256&amp;quot;, NULL);&lt;br /&gt;
    if (nonfipssha256 == NULL)&lt;br /&gt;
        goto err;&lt;br /&gt;
    &lt;br /&gt;
    /* Use the digests */&lt;br /&gt;
    &lt;br /&gt;
    printf(&amp;quot;Success\n&amp;quot;);&lt;br /&gt;
    ret = 0;&lt;br /&gt;
 err:&lt;br /&gt;
    EVP_MD_free(fipssha256);&lt;br /&gt;
    EVP_MD_free(nonfipssha256);&lt;br /&gt;
    OPENSSL_CTX_free(fipslibctx);&lt;br /&gt;
    OPENSSL_CTX_free(nonfipslibctx);&lt;br /&gt;
    OSSL_PROVIDER_unload(defctxnull);&lt;br /&gt;
    &lt;br /&gt;
    return ret;&lt;br /&gt;
&lt;br /&gt;
Note that we have made use of the special &amp;quot;null&amp;quot; provider here which we load into the default library context. We could have chosen to use the default library context for FIPS usage, and just create one additional library context for other usages - or vice versa. However if code has not been converted to use library contexts then the default library context will be automatically used. This could be the case for your own existing applications as well as certain parts of OpenSSL itself. Not all parts of OpenSSL are library context aware. If this happens then you could &amp;quot;accidentally&amp;quot; use the wrong library context for a particular operation. To be sure this doesn't happen you can load the &amp;quot;null&amp;quot; provider into the default library context. Because a provider has been explicitly loaded, the default provider will not automatically load. This means code using the default context by accident will fail because no algorithms will be available.&lt;br /&gt;
&lt;br /&gt;
=== Using Serializers with the FIPS module ===&lt;br /&gt;
&lt;br /&gt;
Serializers are used to read and write keys or parameters from or to some external format (for example a PEM file). In the OpenSSL 3.0 alpha 1 and alpha 2 releases only the &amp;quot;write&amp;quot; serializers have been implemented. Reading will come in a later alpha release. If your application generates keys or parameters that then need to be written into PEM or DER format then it is likely that you will need to use a serializer to do this. In most cases this will be invisible to you if you are using APIs that existed in OpenSSL 1.1.1 or earlier such as i2d_PrivateKey. However the appropriate serializer will need to be available in the library context associated with the key or parameter object. The built-in OpenSSL serializers are implemented in the default provider and are not in the FIPS module boundary. However since they are not cryptographic algorithms themselves it is still possible to use them in conjunction with the FIPS module, and therefore these serializers have the &amp;quot;fips=yes&amp;quot; property against them. You must ensure that the default provider is loaded into the library context in this case.&lt;br /&gt;
&lt;br /&gt;
=== Using the FIPS module in SSL/TLS ===&lt;br /&gt;
&lt;br /&gt;
Writing an application that uses libssl in conjunction with the FIPS module is much the same as writing a normal libssl application. If you are using global properties to specify usage of FIPS validated algorithms then this will happen automatically for all cryptographic algorithms in libssl. If you are using a non-default library context to load the FIPS provider then you can supply this to libssl using the function SSL_CTX_new_with_libctx(). This works as a drop in replacement for the function SSL_CTX_new() except it provides you with the capability to specify the library context to be used. You can also use this same function to specify libssl specific properties to use.&lt;br /&gt;
&lt;br /&gt;
In this first example we create two SSL_CTX objects using two different library contexts.&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the FIPS provider loaded has been&lt;br /&gt;
     * created called fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(fips_libctx, NULL, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * We assume that a non-default library context with the default provider loaded has been&lt;br /&gt;
     * created called non_fips_libctx.&lt;br /&gt;
     /&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(non_fips_libctx, NULL, TLS_method());&lt;br /&gt;
&lt;br /&gt;
In this second example we create two SSL_CTX objects using different properties to specify FIPS usage:&lt;br /&gt;
&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;fips=yes&amp;quot; property includes all FIPS approved algorithms as well as serializers from the&lt;br /&gt;
     * default provider that are allowed to be used. The NULL below indicates that we are using the&lt;br /&gt;
     * default library context.&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;fips=yes&amp;quot;, TLS_method());&lt;br /&gt;
    /*&lt;br /&gt;
     * The &amp;quot;provider!=fips&amp;quot; property allows algorithms from any provider except the FIPS provider&lt;br /&gt;
     */&lt;br /&gt;
    SSL_CTX *non_fips_ssl_ctx = SSL_CTX_new_with_libctx(NULL, &amp;quot;provider!=fips&amp;quot;, TLS_method());&lt;br /&gt;
&lt;br /&gt;
Note that in the OpenSSL alpha 1 and alpha 2 releases OpenSSL does not automatically detect what signature algorithms are available within the currently loaded providers. If signature algorithms in the default set are not available, then an OpenSSL endpoint will offer them anyway. This could result in a handshake failure if the peer decides to use that signature algorithm. As a workaround until this is implemented applications can set the supported signature algorithms manually using a function such as SSL_CTX_set1_sigalgs_list() or similar. See the man page [[https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_sigalgs.html here]]&lt;br /&gt;
&lt;br /&gt;
== Openssl command line application changes ==&lt;br /&gt;
&lt;br /&gt;
The following additional command line arguments have been added&lt;br /&gt;
&lt;br /&gt;
 '''-provider_path''' path_name   - Provider load path&lt;br /&gt;
 '''-provider''' provider_name    - Provider to load&lt;br /&gt;
&lt;br /&gt;
These options can be used multiple times to load any providers, such as the 'legacy' provider or third party providers.&lt;br /&gt;
If used then the 'default' provider would also need to be specified if required.&lt;br /&gt;
The -provider_path must be specified before the -provider option.&lt;br /&gt;
&lt;br /&gt;
== STATUS of current development ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The STATUS section should disappear as soon as 3.0.0 is finally relased --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''[this is a collection of notes, changing as time and alpha / beta releases go]''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The following should change to &amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; when we enter those release phases --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current status of OpenSSL 3.0 is '''in development'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The next status is expected to be '''alpha'''&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
==== Building and testing ====&lt;br /&gt;
&lt;br /&gt;
* Doesn't build and test on all platforms on our watch list.  See the list of [[#Platforms|platforms]] below&amp;lt;br /&amp;gt;&lt;br /&gt;
: ''To be noted that we can't pretend to build on everything and anything, but there are a number of platforms that we watch, either on our own or with community help and reporting''&lt;br /&gt;
&lt;br /&gt;
==== Integration ====&lt;br /&gt;
&lt;br /&gt;
(these issues are tracked in [[#Provider implementation support in other OpenSSL APIs|a table further down]])&lt;br /&gt;
&lt;br /&gt;
* PKCS#7, CMS, SSL/TLS don't work with asymmetric keys implemented by a provider.  There's a temporary hack in place that &amp;quot;downgrades&amp;quot; such keys to work with legacy methods (&amp;lt;tt&amp;gt;EVP_PKEY_METHOD&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EVP_PKEY_ASN1_METHOD&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* CMP/CRMF, PKCS#7, TS, CMS, PKCS#12 and OSSL_STORE currently have no library context support&lt;br /&gt;
* OCSP, PEM, ASN.1 have some very limited library context support&lt;br /&gt;
* It is not yet possible to &amp;quot;fetch&amp;quot; a RAND algorithm&lt;br /&gt;
&lt;br /&gt;
==== Programming ====&lt;br /&gt;
&lt;br /&gt;
* EVP_set_default_properties() does not work (see [https://github.com/openssl/openssl/issues/11594 github #11594])&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS ====&lt;br /&gt;
&lt;br /&gt;
* libssl does not currently detect what signature algorithms are available within the currently loaded providers. Unless explicitly configured differently endpoints will advertise to peers the default list of signature algorithms that are supported - even if those are not available in the currently loaded providers. This could result in handshake failures. As a workaround until this is fixed you should explicitly configure signature algorithms that are consistent with the loaded providers.&lt;br /&gt;
&lt;br /&gt;
=== Platforms ===&lt;br /&gt;
&lt;br /&gt;
These are platforms that have been observed so far.  More will be added.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Platform                             !! Builds !! Tests     !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| Linux - x86 / x86_64                 ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Linux - s390x                        ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| Windows + Visual C - x86 / x86_64    ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| MacOS X                              ||  Yes   ||  Yes&lt;br /&gt;
|-&lt;br /&gt;
| OpenVMS - Alpha / Itanium            ||  No    ||  Unknown  || New include directories need to be dealt with, and more elegantly than the 1.1.1 kludge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
&lt;br /&gt;
All the core support features are in.&lt;br /&gt;
&lt;br /&gt;
The percentages in the tables below represent the amount of work done to convert legacy implementations to a provider based ones.  Algorithms for which the conversion hasn't been completed (or ever started) remain full functional via the legacy code paths.&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented operation types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Operation type                       !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| EVP_DIGEST                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_CIPHER                           || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_MAC                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KDF                              || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_ASYM_CIPHER                      || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYEXCH                          || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_SIGNATURE                        || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EVP_KEYMGMT                          || 95%                || 70%                        || Missing functionality for loading HSM keys&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_SERIALIZER                      || 50%                || 50%                        || Serializer implemented, deserializer not implemented&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| AES                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ARIA                                 || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| BF                                   || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAMELLIA                             || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CAST                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DESX                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DES-EDE3                             || default, FIPS  || 100%               || ??                        || For FIPS, only DES-EDE3-ECB and DES-EDE3-CBC&lt;br /&gt;
|-&lt;br /&gt;
| IDEA                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RC5                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SEED                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM4                                  || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented digests ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                               || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM3                                  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD2                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD4                                  || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| MD5, MD5-SHA1                        || default        || 100%               || ??                          || MD5-SHA1 is a TLS special, not otherwise useful&lt;br /&gt;
|-&lt;br /&gt;
| MDC2                                 || legacy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA1                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA2                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHA3                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SHAKE                                || default, FIPS  || 100%               || ??                          || For the FIPS provider, only SHAKE-256 is available, not SHAKE-128.&lt;br /&gt;
|-&lt;br /&gt;
| RIPEMD-160                           || leagcy         || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| WHIRLPOOL                            || legacy         || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented MACs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| BLAKE2                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| CMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| GMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| HMAC                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KMAC                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| POLY1305                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SIPHASH                                  || default  || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented KDFs ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| HKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KBKDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| KRB5KDF                                  || default  || 100%               || ?? || Kerberos KDF&lt;br /&gt;
|-&lt;br /&gt;
| PBKDF2                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SCRYPT                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SSKDF                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| TLS1-PRF                                  || default, FIPS  || 100%               || ?? || TLS 1.x PRF is treated as a KDF by OpenSSL&lt;br /&gt;
|-&lt;br /&gt;
| X942KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X963KDF                                  || default  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric key types ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key type                              !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                    || default, FIPS  || 95% &amp;lt;!-- DHX? --&amp;gt;  || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC                                    || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, X25519, ED448, X448          || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ?? || Vendor affirmed for FIPS, they cannot yet be validated.&lt;br /&gt;
|-&lt;br /&gt;
| RSA                                   || default, FIPS  || 100% &amp;lt;!-- ? --&amp;gt;    || ??                          || RSA-PSS or RSA-OAEP are considered separate key types, although the RSA EVP_ASYM_CIPHER and EVP_SIGNATURE implementations carry some of the corresponding properties.&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS                               || default        || 0%                 || ??                          || Scheduled for alpha 2&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP                              || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2                                   || default        || 0%                 || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented asymmetric ciphers ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| RSA                      || default, FIPS  || 80%                || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSAES-OAEP                      || default  || 80%                || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented signature ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DSA                                  || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ECDSA                                || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519, ED448                       || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|-&lt;br /&gt;
| RSA, RSASSA-PSS                      || default        || 80%                || ??                          || RSASSA-PSS support untested&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented key exchange ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Algorithm                            !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH                                   || default, FIPS  || 70% &amp;lt;!-- ? --&amp;gt;     || ??                          || We lack support for X9.42 DH, which is needed by CMS&lt;br /&gt;
|-&lt;br /&gt;
| ECDH                                 || default, FIPS  || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519, X448                         || default, FIPS  || 100%               || ?? || In the FIPS provider, these are vendor affirmed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented serializers / deserializers ====&lt;br /&gt;
&lt;br /&gt;
===== Serializers =====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Serializer                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| DH to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| DSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED25519 to printable text, DER, PEM  || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| ED448 to printable text, DER, PEM    || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| EC to printable text, DER, PEM       || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA to printable text, DER, PEM      || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-PSS to printable text, DER, PEM  || default        || 0%                 || ??&lt;br /&gt;
|-&lt;br /&gt;
| RSA-OAEP to printable text, DER, PEM || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| SM2 to printable text, DER, PEM      || default        || 0% ?               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X25519 to printable text, DER, PEM   || default        || 100%               || ??&lt;br /&gt;
|-&lt;br /&gt;
| X448 to printable text, DER, PEM     || default        || 100%               || ??&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Deserializers =====&lt;br /&gt;
&lt;br /&gt;
TO BE ADDED&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Deserializer                         !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Provider implemented OSSL_STORE URI schemes ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! URI scheme                           !! Providers      !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| file:                                || default (?)    || 0%                 || ??                          || This is pending on deserializers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Library Context/Provider implementation support in other OpenSSL APIs ===&lt;br /&gt;
&lt;br /&gt;
Diverse OpenSSL APIs have been modified and continue to be modified to support provider implementations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! API                                  !! Code completion %  !! Documentation completion %  !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| ASN1                                 || 5%                 || 5%&lt;br /&gt;
|-&lt;br /&gt;
| CMS                                  || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with CMS&lt;br /&gt;
|-&lt;br /&gt;
| CMP                                  || ??                 || ??                          || We need to investigate if we need to change anything&lt;br /&gt;
|-&lt;br /&gt;
| CRMF                                 || 5%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| OCSP                                 || 20%                || 20%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|-&lt;br /&gt;
| OSSL_STORE                           || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| PEM                                  || 50%                || 50%                         || Integrated with provider serializers for writing out keys and parameters&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#7                               || 0%                 || 0%                          || There are hacks in place that downgrade a key to legacy when used with PKCS#7&lt;br /&gt;
|-&lt;br /&gt;
| PKCS#12                              || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| SSL / TLS                            || 80%                || 100%                        || There are hacks in place that downgrade a key to legacy in some situations. Some processing happens in libssl that should be moved to a provider. Presence of signature algorithms is not correctly detected&lt;br /&gt;
|-&lt;br /&gt;
| TS                                   || 0%                 || 0%&lt;br /&gt;
|-&lt;br /&gt;
| X509                                 || 80%                || 80%                         || All changes needed to pass the libssl test suite have been done. We need to investigate if further changes are required&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Matt</name></author>
	</entry>
</feed>