當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。