Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Don't understand OpenSSL_add_all_algorithms method

Tags:

ssl

openssl

The documentation says

OpenSSL keeps an internal table of digest algorithms and ciphers. It uses this table to lookup ciphers via functions such as EVP_get_cipher_byname().

OpenSSL_add_all_digests() adds all digest algorithms to the table.

My question is, where is this table stored? How does my code know that this method has executed?...how does it work internally, what if i want more SSL connections and one to have all digests added and one not? Does anyone know any good documentation for this?

Thank you

like image 872
Jacob Krieg Avatar asked Jan 23 '13 21:01

Jacob Krieg


2 Answers

This is an old question. The API was deprecated some years ago:

The OpenSSL_add_all_algorithms(), OpenSSL_add_all_ciphers(), OpenSSL_add_all_digests(), and EVP_cleanup(), functions were deprecated in OpenSSL 1.1.0 by OPENSSL_init_crypto().

Reference: https://www.openssl.org/docs/man1.1.0/man3/OpenSSL_add_all_algorithms.html

like image 115
rustyMagnet Avatar answered Sep 28 '22 06:09

rustyMagnet


OpenSSL_add_all_algorithms() is not needed for newer OpenSSL versions and is ignored. For backward and forward compatibility, use this:

# if OPENSSL_API_COMPAT < 0x10100000L
OpenSSL_add_all_algorithms();
# endif

And

# if OPENSSL_API_COMPAT < 0x10100000L
EVP_cleanup();
# endif

The same applies to OpenSSL_add_all_ciphers() and OpenSSL_add_all_digests().

For more details, see the man page at https://www.openssl.org/docs/man1.1.0/man3/OpenSSL_add_all_digests.html

like image 24
Dan Anderson Avatar answered Sep 28 '22 08:09

Dan Anderson