SSLEAY_ADD_ALL_ALGORITHMS(3ssl)

πŸ“¦ version 4.1.0, in opensuse-leap 16.0

🌸 OPENSSL_ADD_ALL_ALGORITHMS β€” bestie's guide to the algorithm table ✨

okay so this page lives in the OpenSSL library (openssl/evp.h, iykyk) and it's all about the internal table of digests and ciphers. pull up a chair πŸ’…


πŸŽ€ NAME πŸŽ€

OpenSSL_add_all_algorithms, OpenSSL_add_all_ciphers, OpenSSL_add_all_digests, EVP_cleanup, SSLeay_add_all_algorithms β€” the whole friend group that adds algorithms to the internal table 🫢

✨ SYNOPSIS ✨

#include <openssl/evp.h>

void
OpenSSL_add_all_algorithms(void);

void
OpenSSL_add_all_ciphers(void);

void
OpenSSL_add_all_digests(void);

void
EVP_cleanup(void);

void
SSLeay_add_all_algorithms(void);

πŸ’– DESCRIPTION πŸ’–

so first things first, bestie: these functions are deprecated. like, fully. the docs straight up say it is never useful for any application program to call any of them explicitly, because the library already calls them internally whenever needed. so you don't have to do anything. it's giving "the library has main character energy and handles it" πŸ‘‘

OpenSSL keeps an internal table of digest algorithms and ciphers. it uses this table to look up ciphers via functions such as EVP_get_cipherbyname(3). think of it as the group chat directory of every digest and cipher OpenSSL knows about πŸ“‡

Here's the rundown on each one:

  • OpenSSL_add_all_algorithms() β€” adds all the algorithms to the table (digests and ciphers). and if the application was compiled with the preprocessor symbol OPENSSL_LOAD_CONF #define'd, it also calls OPENSSL_config(3) with a NULL argument, which loads the default configuration file. sneaky little bonus behavior, love that for it 🌈
  • OpenSSL_add_all_digests() β€” adds all the digest algorithms to the table. digests only, no ciphers πŸ’œ
  • OpenSSL_add_all_ciphers() β€” adds all the encryption algorithms to the table, and yes that includes password based encryption algorithms πŸ“
real talk: if any of the above functions is called more than once, only the first call has an effect. so spamming them does nothing. periodt πŸ’€

EVP_cleanup() is the chaotic one β€” it removes all ciphers and digests from the table, and it also calls OBJ_NAME_cleanup(3) with an argument of -1. that resets the global associative array of names and all signature algorithm definitions back to their default states, removing all application-defined types, key-value pairs, and aliases β€” including any that are unrelated to the EVP library. 😭 so yeah, it's a whole spring cleaning, not just a tidy-up of its own room. be aware of that before you call it.

SSLeay_add_all_algorithms() is just a deprecated alias for OpenSSL_add_all_algorithms(). same energy, older name 🧚

and a lil detail: OpenSSL_add_all_algorithms() and SSLeay_add_all_algorithms() are implemented as macros, not real functions. iconic 🌸

πŸ¦‹ SEE ALSO πŸ¦‹

⭐ HISTORY ⭐

  • EVP_cleanup(), SSLeay_add_all_algorithms(), and their precursor functions SSLeay_add_all_ciphers() and SSLeay_add_all_digests() first appeared in SSLeay 0.8.0 and have been available since OpenBSD 2.4. vintage πŸ’…
  • OpenSSL_add_all_algorithms(), OpenSSL_add_all_ciphers(), and OpenSSL_add_all_digests() first appeared in OpenSSL 0.9.5 and have been available since OpenBSD 2.7. glow up ✨

πŸ’€ BUGS πŸ’€

okay so here's the tea: these functions do not return error codes, but it is possible for them to fail 😬 the only way that happens is a memory allocation failure, so honestly it's not too much of a problem in practice. lowkey fine, but now you know πŸ™ˆ


and that's the whole page, bestie β€” go forth and let the library call these for you 🫢

mwah πŸ’‹ β€” from the Debian build of these man pages, dated March 4, 2024, filed under OPENSSL_ADD_ALL_ALGORITHMS(3) πŸŽ€

πŸ“¦ where this page comes from