本文整理汇总了C++中CRYPTO_cleanup_all_ex_data函数的典型用法代码示例。如果您正苦于以下问题:C++ CRYPTO_cleanup_all_ex_data函数的具体用法?C++ CRYPTO_cleanup_all_ex_data怎么用?C++ CRYPTO_cleanup_all_ex_data使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CRYPTO_cleanup_all_ex_data函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: finish
void finish() {
av_lockmgr_register(nullptr);
CRYPTO_cleanup_all_ex_data();
FIPS_mode_set(0);
ENGINE_cleanup();
CONF_modules_unload(1);
ERR_remove_state(0);
ERR_free_strings();
ERR_remove_thread_state(nullptr);
EVP_cleanup();
delete[] _sslLocks;
_sslLocks = nullptr;
Platform::ThirdParty::finish();
}
开发者ID:2asoft,项目名称:tdesktop,代码行数:17,代码来源:utils.cpp
示例2: SQBIND_Exit_curl
static void SQBIND_Exit_curl()
{
oexAutoLock ll( _g_curl_lock );
if ( !ll.IsLocked() )
return;
// Cleanup curl
curl_global_cleanup();
// SSL cleanup sequence
ERR_remove_state( 0 );
// ENGINE_cleanup();
CONF_modules_unload( 1 );
ERR_free_strings();
EVP_cleanup();
CRYPTO_cleanup_all_ex_data();
}
开发者ID:wheresjames,项目名称:winglib,代码行数:17,代码来源:stdafx.cpp
示例3: lws_ssl_context_destroy
LWS_VISIBLE void
lws_ssl_context_destroy(struct lws_context *context)
{
if (context->ssl_ctx)
SSL_CTX_free(context->ssl_ctx);
if (!context->user_supplied_ssl_ctx && context->ssl_client_ctx)
SSL_CTX_free(context->ssl_client_ctx);
#if (OPENSSL_VERSION_NUMBER < 0x01000000) || defined(USE_WOLFSSL)
ERR_remove_state(0);
#else
ERR_remove_thread_state(NULL);
#endif
ERR_free_strings();
EVP_cleanup();
CRYPTO_cleanup_all_ex_data();
}
开发者ID:reticentae,项目名称:libwebsockets,代码行数:17,代码来源:ssl.c
示例4: openssl_shutdown
static void
openssl_shutdown(void)
{
CONF_modules_unload(1);
destroy_ui_method();
OBJ_cleanup();
EVP_cleanup();
#ifndef OPENSSL_NO_ENGINE
ENGINE_cleanup();
#endif
CRYPTO_cleanup_all_ex_data();
ERR_remove_thread_state(NULL);
RAND_cleanup();
ERR_free_strings();
}
开发者ID:DiamondLovesYou,项目名称:libressl-pnacl-sys,代码行数:17,代码来源:openssl.c
示例5: main
int main(void)
{
int ret = 1;
BIO *out;
out = BIO_new_fp(stdout, BIO_NOCLOSE);
/* enable memory leak checking unless explicitly disabled */
if (!((getenv("OPENSSL_DEBUG_MEMORY") != NULL) &&
(0 == strcmp(getenv("OPENSSL_DEBUG_MEMORY"), "off"))))
{
CRYPTO_malloc_debug_init();
CRYPTO_set_mem_debug_options(V_CRYPTO_MDEBUG_ALL);
}
else
{
/* OPENSSL_DEBUG_MEMORY=off */
CRYPTO_set_mem_debug_functions(0, 0, 0, 0, 0);
}
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
ERR_load_crypto_strings();
/* initialize the prng */
RAND_seed(rnd_seed, sizeof(rnd_seed));
/* the tests */
if (!x9_62_tests(out)) goto err;
if (!test_builtin(out)) goto err;
ret = 0;
err:
if (ret)
BIO_printf(out, "\nECDSA test failed\n");
else
BIO_printf(out, "\nECDSA test passed\n");
if (ret)
ERR_print_errors(out);
CRYPTO_cleanup_all_ex_data();
ERR_remove_thread_state(NULL);
ERR_free_strings();
CRYPTO_mem_leaks(out);
if (out != NULL)
BIO_free(out);
return ret;
}
开发者ID:54104,项目名称:droid-VNC-server,代码行数:46,代码来源:ecdsatest.c
示例6: check_finish
void check_finish()
{
iconv_close(iconv_utf8);
iconv_close(iconv_ucs2);
iconv_close(iconv_utf32);
BN_free(bn_factors);
ASN1_OBJECT_free(obj_jurisdictionCountryName);
ASN1_OBJECT_free(obj_jurisdictionLocalityName);
ASN1_OBJECT_free(obj_jurisdictionStateOrProvinceName);
ASN1_OBJECT_free(obj_StreetAddress);
ASN1_OBJECT_free(obj_postalCode);
ASN1_OBJECT_free(obj_postOfficeBox);
ASN1_OBJECT_free(obj_anyEKU);
ASN1_OBJECT_free(obj_IntelAMTvProEKU);
EVP_cleanup();
CRYPTO_cleanup_all_ex_data();
}
开发者ID:kroeckx,项目名称:x509lint,代码行数:17,代码来源:checks.c
示例7: dst__openssl_destroy
void
dst__openssl_destroy(void) {
/*
* Sequence taken from apps_shutdown() in <apps/apps.h>.
*/
if (rm != NULL) {
#if OPENSSL_VERSION_NUMBER >= 0x00907000L
RAND_cleanup();
#endif
mem_free(rm);
rm = NULL;
}
#if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
CONF_modules_free();
#endif
OBJ_cleanup();
EVP_cleanup();
#if defined(USE_ENGINE)
if (e != NULL)
ENGINE_free(e);
e = NULL;
#if defined(USE_ENGINE) && OPENSSL_VERSION_NUMBER >= 0x00907000L
ENGINE_cleanup();
#endif
#endif
#if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
CRYPTO_cleanup_all_ex_data();
#endif
ERR_clear_error();
#if OPENSSL_VERSION_NUMBER < 0x10100000L
ERR_remove_state(0);
#endif
ERR_free_strings();
#ifdef DNS_CRYPTO_LEAKS
CRYPTO_mem_leaks_fp(stderr);
#endif
if (locks != NULL) {
CRYPTO_set_locking_callback(NULL);
DESTROYMUTEXBLOCK(locks, nlocks);
mem_free(locks);
locks = NULL;
}
}
开发者ID:edmonds,项目名称:isc-bind9,代码行数:45,代码来源:openssl_link.c
示例8: cleanupOpenSSL
void cleanupOpenSSL()
{
if(m_ssl != NULL)
{
SSL_shutdown (m_ssl); /* send SSL/TLS close_notify */
SSL_free (m_ssl);
m_ssl = NULL;
}
if(m_ctx != NULL)
{
SSL_CTX_free (m_ctx);
m_ctx = NULL;
ERR_remove_state(0);
ERR_free_strings();
EVP_cleanup();
CRYPTO_cleanup_all_ex_data();
}
}
开发者ID:Discriminator,项目名称:PDW,代码行数:18,代码来源:smtp.cpp
示例9: oh_ssl_finit
/**
* oh_ssl_finit
*
* Finalizes the OpenSSL library. The calls used in this routine releases global
* data created/initialized by the OpenSSL library.
*
* Note that it is the responisbility of the caller of this function to make
* sure that no other threads are making the OpenSSL library calls. The openhpid
* should close all the threads and call this function from the main (single)
* thread.
*
* Return value: None
**/
void oh_ssl_finit(void)
{
/* TODO: Check whether any other SSL library cleanup should be called */
thread_cleanup();
ENGINE_cleanup();
CONF_modules_unload(0);
ERR_free_strings();
EVP_cleanup();
CRYPTO_cleanup_all_ex_data();
/* The valgrind is showing possible memory leak by
* SSL_COMP_get_compression_methods() call.
*
* Call to SSL_free_comp_methods() may resolve the memory leak.
* But not able to find this call in the openssl 0.9.8e
* TODO: Find whether its a real problem or not
*/
}
开发者ID:openhpi1,项目名称:testrepo,代码行数:31,代码来源:oh_ssl.c
示例10: apps_shutdown
static void apps_shutdown()
{
#ifndef OPENSSL_NO_ENGINE
ENGINE_cleanup();
#endif
destroy_ui_method();
CONF_modules_unload(1);
#ifndef OPENSSL_NO_COMP
COMP_zlib_cleanup();
SSL_COMP_free_compression_methods();
#endif
OBJ_cleanup();
EVP_cleanup();
CRYPTO_cleanup_all_ex_data();
ERR_remove_thread_state(NULL);
RAND_cleanup();
ERR_free_strings();
}
开发者ID:NTASTE,项目名称:openssl,代码行数:18,代码来源:openssl.c
示例11: finish
void finish() {
av_lockmgr_register(nullptr);
CRYPTO_cleanup_all_ex_data();
#ifndef LIBRESSL_VERSION_NUMBER
FIPS_mode_set(0);
#endif
ENGINE_cleanup();
CONF_modules_unload(1);
ERR_remove_state(0);
ERR_free_strings();
ERR_remove_thread_state(nullptr);
EVP_cleanup();
delete[] base::take(_sslLocks);
Platform::ThirdParty::finish();
}
开发者ID:cuiwm,项目名称:tdesktop,代码行数:18,代码来源:utils.cpp
示例12: ch_en_openssl_uninit
// .. c:function::
ch_error_t
ch_en_openssl_uninit(void)
// :noindex:
//
// see: :c:func:`ch_en_openssl_uninit`
//
// .. code-block:: cpp
//
{
FIPS_mode_set(0);
ENGINE_cleanup();
CONF_modules_unload(1);
EVP_cleanup();
CRYPTO_cleanup_all_ex_data();
ERR_free_strings();
CONF_modules_free();
return CH_SUCCESS;
}
开发者ID:concretecloud,项目名称:c4irp,代码行数:19,代码来源:encryption.c
示例13: selfTest
/**
* @see clientlib.h
*/
void selfTest(){
ERR_load_crypto_strings();
OpenSSL_add_all_algorithms();
OPENSSL_config(NULL);
// TODO: do some encryption
unsigned char data[] = "HelloWorld";
unsigned char hash[SHA512_DIGEST_LENGTH];
SHA512(data, sizeof(data), hash);
int i;
for (i = 0; i < sizeof(data); i++) {
printf("%02x ", data[i]);
}
printf("\n");
//
EVP_cleanup();
CRYPTO_cleanup_all_ex_data();
ERR_free_strings();
}
开发者ID:crossbridge-community,项目名称:crossbridge-swc-openssl,代码行数:21,代码来源:clientlib.c
示例14: main
int main( int argc, char** argv )
{
SSTRACE_ARGS args; int rc = 0;
memset( &args, 0, sizeof( args ) );
ErrBuffer[0] = 0;
if( argc < 3 )
{
print_usage();
return 0;
}
if( load_args( argc, argv, &args ) != 0 )
{
if( strlen( ErrBuffer ) )
{
fprintf( stderr, ErrBuffer );
}
else
{
print_usage();
}
return 1;
}
/* Initialize OpenSSL library before using DSSL! */
SSL_library_init();
OpenSSL_add_all_ciphers();
OpenSSL_add_all_digests();
rc = proceed( &args );
if( rc != 0 )
{
if( strlen( ErrBuffer ) ) fprintf( stderr, ErrBuffer );
}
/* Cleanup OpenSSL */
EVP_cleanup();
CRYPTO_cleanup_all_ex_data();
return rc;
}
开发者ID:Correlsense,项目名称:libdssl,代码行数:44,代码来源:ssltrace.c
示例15: Curl_ossl_cleanup
/* Global cleanup */
void Curl_ossl_cleanup(void)
{
/* Free the SSL error strings */
ERR_free_strings();
/* EVP_cleanup() removes all ciphers and digests from the
table. */
EVP_cleanup();
#ifdef HAVE_ENGINE_cleanup
ENGINE_cleanup();
#endif
#ifdef HAVE_CRYPTO_CLEANUP_ALL_EX_DATA
/* this function was not present in 0.9.6b, but was added sometimes
later */
CRYPTO_cleanup_all_ex_data();
#endif
}
开发者ID:dangardner,项目名称:mudmagic-client,代码行数:20,代码来源:ssluse.c
示例16: GetContext
//--------------------------------------------------------------------------------------------------
le_result_t secSocket_Delete
(
secSocket_Ctx_t* ctxPtr ///< [INOUT] Secure socket context pointer
)
{
if (!ctxPtr)
{
return LE_BAD_PARAMETER;
}
OpensslCtx_t* contextPtr = GetContext(ctxPtr);
if (!contextPtr)
{
return LE_BAD_PARAMETER;
}
BIO_free_all(contextPtr->bioPtr);
contextPtr->bioPtr = NULL;
SSL_CTX_free(contextPtr->sslCtxPtr);
contextPtr->sslCtxPtr = NULL;
#if OPENSSL_API_COMPAT < 0x10100000L
#if OPENSSL_API_COMPAT > 0x10002000L
// In versions of OpenSSL prior to 1.1.0 SSL_COMP_free_compression_methods() freed the
// internal table of compression methods that were built internally, and possibly augmented
// by adding SSL_COMP_add_compression_method().
// However this is now unnecessary from version 1.1.0. No explicit initialisation or
// de-initialisation is necessary.
SSL_COMP_free_compression_methods();
#endif
#endif
EVP_cleanup();
ERR_free_strings();
CRYPTO_cleanup_all_ex_data();
#if OPENSSL_VERSION_NUMBER < 0x10100000L
ERR_remove_state(0);
#endif
contextPtr->isInit = false;
le_mem_Release(contextPtr);
return LE_OK;
}
开发者ID:legatoproject,项目名称:legato-af,代码行数:44,代码来源:secSocket_openssl.c
示例17: mod_destroy
/*
* called from main.c when opensips exits (main process)
*/
static void mod_destroy(void)
{
struct tls_domain *d;
LM_DBG("entered\n");
if (dom_lock) {
lock_destroy_rw(dom_lock);
dom_lock = 0;
}
d = tls_server_domains;
while (d) {
if (d->ctx)
SSL_CTX_free(d->ctx);
lock_destroy(d->lock);
lock_dealloc(d->lock);
d = d->next;
}
d = tls_client_domains;
while (d) {
if (d->ctx)
SSL_CTX_free(d->ctx);
lock_destroy(d->lock);
lock_dealloc(d->lock);
d = d->next;
}
if (tls_default_server_domain.ctx) {
SSL_CTX_free(tls_default_server_domain.ctx);
}
if (tls_default_client_domain.ctx) {
SSL_CTX_free(tls_default_client_domain.ctx);
}
tls_free_domains();
/* TODO - destroy static locks */
/* library destroy */
ERR_free_strings();
/*SSL_free_comp_methods(); - this function is not on std. openssl*/
EVP_cleanup();
CRYPTO_cleanup_all_ex_data();
return;
}
开发者ID:Danfx,项目名称:opensips,代码行数:46,代码来源:tls_mgm.c
示例18: _mosquitto_net_cleanup
void _mosquitto_net_cleanup(void)
{
#ifdef WITH_TLS
ERR_remove_state(0);
ENGINE_cleanup();
CONF_modules_unload(1);
ERR_free_strings();
EVP_cleanup();
CRYPTO_cleanup_all_ex_data();
#endif
#ifdef WITH_SRV
ares_library_cleanup();
#endif
#ifdef WIN32
WSACleanup();
#endif
}
开发者ID:ADVANTECH-Corp,项目名称:WISEAgent,代码行数:19,代码来源:net_mosq.c
示例19: ERR_load_crypto_strings
bool msl::encrypt_rsa(const void* plain,const size_t size,const std::string& key,std::string& cipher)
{
bool success=true;
ERR_load_crypto_strings();
OpenSSL_add_all_algorithms();
BIO* keybio=BIO_new_mem_buf((uint8_t*)key.c_str(),-1);
if(keybio==nullptr)
success=false;
RSA* rsa=nullptr;
if(success)
rsa=PEM_read_bio_RSA_PUBKEY(keybio,&rsa,nullptr,nullptr);
if(rsa==nullptr)
success=false;
if(size>(size_t)RSA_size(rsa)-RSA_PKCS1_OAEP_PADDING_SIZE)
success=false;
size_t temp_size=(size_t)-1;
uint8_t* temp_data=new uint8_t[RSA_size(rsa)];
if(success)
temp_size=RSA_public_encrypt(size,(uint8_t*)plain,temp_data,rsa,RSA_PKCS1_OAEP_PADDING);
if(success&&temp_size==(size_t)~0)
success=false;
if(success)
cipher=std::string((char*)temp_data,temp_size);
delete[] temp_data;
BIO_free(keybio);
RSA_free(rsa);
ERR_free_strings();
EVP_cleanup();
ERR_remove_state(0);
CRYPTO_cleanup_all_ex_data();
return success;
}
开发者ID:mrmoss,项目名称:blasteroids,代码行数:42,代码来源:crypto.cpp
示例20: mysql_server_end
/*
Release SSL and free resources
Will be automatically executed by
mysql_server_end() function
SYNOPSIS
my_ssl_end()
void
RETURN VALUES
void
*/
void my_ssl_end()
{
DBUG_ENTER("my_ssl_end");
pthread_mutex_lock(&LOCK_ssl_config);
if (my_ssl_initialized)
{
int i;
if (LOCK_crypto)
{
CRYPTO_set_locking_callback(NULL);
CRYPTO_set_id_callback(NULL);
for (i=0; i < CRYPTO_num_locks(); i++)
pthread_mutex_destroy(&LOCK_crypto[i]);
my_free(LOCK_crypto);
LOCK_crypto= NULL;
}
if (SSL_context)
{
SSL_CTX_free(SSL_context);
SSL_context= FALSE;
}
if (mariadb_deinitialize_ssl)
{
#if OPENSSL_VERSION_NUMBER < 0x10100000
ERR_remove_state(0);
#endif
EVP_cleanup();
CRYPTO_cleanup_all_ex_data();
ERR_free_strings();
CONF_modules_free();
CONF_modules_unload(1);
}
my_ssl_initialized= FALSE;
}
pthread_mutex_unlock(&LOCK_ssl_config);
pthread_mutex_destroy(&LOCK_ssl_config);
DBUG_VOID_RETURN;
}
开发者ID:825126369,项目名称:2018_Server,代码行数:54,代码来源:ma_secure.c
注:本文中的CRYPTO_cleanup_all_ex_data函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论