From 22c84afa773559279af928652a2d9f3489cc7d73 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Mon, 4 Apr 2016 15:28:58 +0100 Subject: Deprecate EVP_cleanup() and make it a no-op EVP_cleanup() should not be called expicitly - we should leave auto-deinit to clean this up instead. Reviewed-by: Tim Hudson Reviewed-by: Richard Levitte --- doc/crypto/EVP_DigestInit.pod | 2 -- doc/crypto/OpenSSL_add_all_algorithms.pod | 43 ++++++++++++++++++++++++++----- 2 files changed, 36 insertions(+), 9 deletions(-) (limited to 'doc') diff --git a/doc/crypto/EVP_DigestInit.pod b/doc/crypto/EVP_DigestInit.pod index 94c4d19d29..7ce569540f 100644 --- a/doc/crypto/EVP_DigestInit.pod +++ b/doc/crypto/EVP_DigestInit.pod @@ -236,8 +236,6 @@ digest name passed on the command line. printf("%02x", md_value[i]); printf("\n"); - /* Call this once before exit. */ - EVP_cleanup(); exit(0); } diff --git a/doc/crypto/OpenSSL_add_all_algorithms.pod b/doc/crypto/OpenSSL_add_all_algorithms.pod index b107155a3a..78fe12aa3f 100644 --- a/doc/crypto/OpenSSL_add_all_algorithms.pod +++ b/doc/crypto/OpenSSL_add_all_algorithms.pod @@ -9,16 +9,44 @@ add algorithms to internal table #include - void OpenSSL_add_all_algorithms(void); - void OpenSSL_add_all_ciphers(void); - void OpenSSL_add_all_digests(void); - - void EVP_cleanup(void); +Deprecated: + + # if OPENSSL_API_COMPAT < 0x10100000L + # define OPENSSL_add_all_algorithms_conf() \ + OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \ + | OPENSSL_INIT_ADD_ALL_DIGESTS \ + | OPENSSL_INIT_LOAD_CONFIG, NULL) + # define OPENSSL_add_all_algorithms_noconf() \ + OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \ + | OPENSSL_INIT_ADD_ALL_DIGESTS, NULL) + + # ifdef OPENSSL_LOAD_CONF + # define OpenSSL_add_all_algorithms() \ + OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \ + | OPENSSL_INIT_ADD_ALL_DIGESTS \ + | OPENSSL_INIT_LOAD_CONFIG, NULL) + # else + # define OpenSSL_add_all_algorithms() \ + OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \ + | OPENSSL_INIT_ADD_ALL_DIGESTS, NULL) + # endif + + # define OpenSSL_add_all_ciphers() \ + OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS, NULL) + # define OpenSSL_add_all_digests() \ + OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_DIGESTS, NULL) + + # define EVP_cleanup() +# endif =head1 DESCRIPTION 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(). +this table to lookup ciphers via functions such as EVP_get_cipher_byname(). In +OpenSSL versions prior to 1.1.0 these functions initialised and de-initialised +this table. From OpenSSL 1.1.0 are deprecated. No explicit initialisation or +de-initialisation is required. See L for further +information. OpenSSL_add_all_digests() adds all digest algorithms to the table. @@ -28,7 +56,8 @@ ciphers). OpenSSL_add_all_ciphers() adds all encryption algorithms to the table including password based encryption algorithms. -EVP_cleanup() removes all ciphers and digests from the table. +In versions prior to 1.1.0 EVP_cleanup() removed all ciphers and digests from +the table. It no longer has any effect in OpenSSL 1.1.0. =head1 RETURN VALUES -- cgit v1.2.3