
#use wml::openssl-macros area=docs page=OpenSSL_add_all_algorithms

<title>Documents, OpenSSL_add_all_algorithms(3)</title>

<h1>OpenSSL_add_all_algorithms(3)</h1>

#use wml::imp::generic

{:
## What's this? [[s|(<STRONG>[^<].+?)</A>(</STRONG><DD>)|$1$2|sg]]
[[s|<P>\s+<P>|<P>|sg]]
[[s|<P>\s+</|</|sg]]
[[s|<DD>\s*<DT>|<DD>&nbsp;<DT>|sg]]
[[s|<DD>\s*</DL>|<DD>&nbsp;</DL>|sg]]
[[s|\[|&#91;|sg]]
[[s|\]|&#93;|sg]]

<!-- INDEX BEGIN -->

<UL>

	<LI><A HREF="#NAME">NAME</A>
	<LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
	<LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
	<LI><A HREF="#RETURN_VALUES">RETURN VALUES</A>
	<LI><A HREF="#NOTES">NOTES</A>
	<LI><A HREF="#BUGS">BUGS</A>
	<LI><A HREF="#SEE_ALSO">SEE ALSO</A>
</UL>
<!-- INDEX END -->

<HR>
<P>
<HR>
<H1><A NAME="NAME">NAME</A></H1>
<P>
OpenSSL_add_all_algorithms, OpenSSL_add_all_ciphers,
OpenSSL_add_all_digests, EVP_cleanup - add algorithms to internal table

</P>
<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<PRE> #include &lt;openssl/evp.h&gt;
</PRE>
<PRE> void OpenSSL_add_all_algorithms(void);
 void OpenSSL_add_all_ciphers(void);
 void OpenSSL_add_all_digests(void);
</PRE>
<PRE> void EVP_cleanup(void);
</PRE>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
OpenSSL keeps an internal table of digest algorithms and ciphers. It uses
this table to lookup ciphers via functions such as
<CODE>EVP_get_cipher_byname().</CODE>

</P>
<P>
<CODE>OpenSSL_add_all_digests()</CODE> adds all digest algorithms to the
table.

</P>
<P>
<CODE>OpenSSL_add_all_algorithms()</CODE> adds all algorithms to the table
(digests and ciphers).

</P>
<P>
<CODE>OpenSSL_add_all_ciphers()</CODE> adds all encryption algorithms to
the table including password based encryption algorithms.

</P>
<P>
<CODE>EVP_cleanup()</CODE> removes all ciphers and digests from the table.

</P>
<P>
<HR>
<H1><A NAME="RETURN_VALUES">RETURN VALUES</A></H1>
<P>
None of the functions return a value.

</P>
<P>
<HR>
<H1><A NAME="NOTES">NOTES</A></H1>
<P>
A typical application will call <CODE>OpenSSL_add_all_algorithms()</CODE>
initially and <CODE>EVP_cleanup()</CODE> before exiting.

</P>
<P>
An application does not need to add algorithms to use them explicitly, for
example by <CODE>EVP_sha1().</CODE> It just needs to add them if it (or any
of the functions it calls) needs to lookup algorithms.

</P>
<P>
The cipher and digest lookup functions are used in many parts of the
library. If the table is not initialized several functions will misbehave
and complain they cannot find algorithms. This includes the PEM, PKCS#12,
SSL and S/MIME libraries. This is a common query in the OpenSSL mailing
lists.

</P>
<P>
Calling <CODE>OpenSSL_add_all_algorithms()</CODE> 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.

</P>
<P>
<HR>
<H1><A NAME="BUGS">BUGS</A></H1>
<P>
Although the functions do not return error codes it is possible for them to
fail. This will only happen as a result of a memory allocation failure so
this is not too much of a problem in practice.

</P>
<P>
<HR>
<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
<P>
<A HREF="../crypto/evp.html#">evp(3)</A>, <A HREF="../crypto/EVP_DigestInit.html#">EVP_DigestInit(3)</A>,
<A HREF="../crypto/EVP_EncryptInit.html#">EVP_EncryptInit(3)</A>



</P>
:}

