return (cp);
}
-void EVP_cleanup(void)
+void evp_cleanup_intern(void)
{
OBJ_NAME_cleanup(OBJ_NAME_TYPE_CIPHER_METH);
OBJ_NAME_cleanup(OBJ_NAME_TYPE_MD_METH);
void openssl_add_all_ciphers_internal(void);
void openssl_add_all_digests_internal(void);
+void evp_cleanup_intern(void);
fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: "
"bio_sock_cleanup_intern()\n");
fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: "
- "EVP_cleanup()\n");
+ "evp_cleanup_intern()\n");
fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: "
"OBJ_cleanup()\n");
#endif
#ifndef OPENSSL_NO_SOCK
bio_sock_cleanup_intern();
#endif
- EVP_cleanup();
+ evp_cleanup_intern();
OBJ_cleanup();
base_inited = 0;
}
}
/*
- * The purpose of obj_cleanup_defer is to avoid EVP_cleanup() attempting to
- * use freed up OIDs. If necessary the actual freeing up of OIDs is delayed.
+ * The purpose of obj_cleanup_defer is to avoid evp_cleanup_intern() attempting
+ * to use freed up OIDs. If necessary the actual freeing up of OIDs is delayed.
*/
int obj_cleanup_defer = 0;
printf("%02x", md_value[i]);
printf("\n");
- /* Call this once before exit. */
- EVP_cleanup();
exit(0);
}
#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);
+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<OPENSSL_init_crypto(3)> for further
+information.
OpenSSL_add_all_digests() adds all digest algorithms to the table.
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
# endif
# if OPENSSL_API_COMPAT < 0x10100000L
-# define OPENSSL_add_all_algorithms_conf() \
+# 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() \
+# define OPENSSL_add_all_algorithms_noconf() \
OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \
| OPENSSL_INIT_ADD_ALL_DIGESTS, NULL)
| OPENSSL_INIT_ADD_ALL_DIGESTS, NULL)
# endif
-# define OpenSSL_add_all_ciphers() \
+# define OpenSSL_add_all_ciphers() \
OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS, NULL)
-# define OpenSSL_add_all_digests() \
+# define OpenSSL_add_all_digests() \
OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_DIGESTS, NULL)
+
+# define EVP_cleanup()
# endif
int EVP_add_cipher(const EVP_CIPHER *cipher);
const EVP_CIPHER *EVP_get_cipherbyname(const char *name);
const EVP_MD *EVP_get_digestbyname(const char *name);
-void EVP_cleanup(void);
void EVP_CIPHER_do_all(void (*fn) (const EVP_CIPHER *ciph,
const char *from, const char *to, void *x),