当前位置: 首页>>代码示例>>C++>>正文


C++ CRYPTO_cleanup_all_ex_data函数代码示例

本文整理汇总了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函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的CRYPTO_cleanup_all_ex_data函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。