本文整理汇总了C++中ENGINE_finish函数的典型用法代码示例。如果您正苦于以下问题:C++ ENGINE_finish函数的具体用法?C++ ENGINE_finish怎么用?C++ ENGINE_finish使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ENGINE_finish函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: int_engine_module_finish
static void
int_engine_module_finish(CONF_IMODULE *md)
{
ENGINE *e;
while ((e = sk_ENGINE_pop(initialized_engines)))
ENGINE_finish(e);
sk_ENGINE_free(initialized_engines);
initialized_engines = NULL;
}
开发者ID:2trill2spill,项目名称:nextgen,代码行数:10,代码来源:eng_cnf.c
示例2: unload_hardware_engine
/* Free memory for the hardware engine */
static void unload_hardware_engine () {
if (!reng)
return;
ENGINE_finish (reng);
ENGINE_free (reng);
ENGINE_cleanup ();
reng = NULL;
rand_loaded = 0;
}
开发者ID:cjcole,项目名称:libgolle,代码行数:11,代码来源:random.c
示例3: eng_RAND_set_rand_method
int eng_RAND_set_rand_method(const RAND_METHOD *meth, const RAND_METHOD **pmeth)
{
if(funct_ref)
{
ENGINE_finish(funct_ref);
funct_ref = NULL;
}
*pmeth = meth;
return 1;
}
开发者ID:alisw,项目名称:alice-openssl,代码行数:10,代码来源:rand_eng.c
示例4: ossl_engine_finish
/* Document-method: OpenSSL::Engine#finish
*
* Releases all internal structural references for this engine.
*
* May raise an EngineError if the engine is unavailable
*/
static VALUE
ossl_engine_finish(VALUE self)
{
ENGINE *e;
GetEngine(self, e);
if(!ENGINE_finish(e)) ossl_raise(eEngineError, NULL);
return Qnil;
}
开发者ID:DashYang,项目名称:sim,代码行数:16,代码来源:ossl_engine.c
示例5: init_gen_str
int init_gen_str(BIO *err, EVP_PKEY_CTX **pctx,
const char *algname, ENGINE *e, int do_param)
{
EVP_PKEY_CTX *ctx = NULL;
const EVP_PKEY_ASN1_METHOD *ameth;
ENGINE *tmpeng = NULL;
int pkey_id;
if (*pctx) {
BIO_puts(err, "Algorithm already set!\n");
return 0;
}
ameth = EVP_PKEY_asn1_find_str(&tmpeng, algname, -1);
#ifndef OPENSSL_NO_ENGINE
if (!ameth && e)
ameth = ENGINE_get_pkey_asn1_meth_str(e, algname, -1);
#endif
if (!ameth) {
BIO_printf(bio_err, "Algorithm %s not found\n", algname);
return 0;
}
ERR_clear_error();
EVP_PKEY_asn1_get0_info(&pkey_id, NULL, NULL, NULL, NULL, ameth);
#ifndef OPENSSL_NO_ENGINE
if (tmpeng)
ENGINE_finish(tmpeng);
#endif
ctx = EVP_PKEY_CTX_new_id(pkey_id, e);
if (!ctx)
goto err;
if (do_param) {
if (EVP_PKEY_paramgen_init(ctx) <= 0)
goto err;
} else {
if (EVP_PKEY_keygen_init(ctx) <= 0)
goto err;
}
*pctx = ctx;
return 1;
err:
BIO_printf(err, "Error initializing %s context\n", algname);
ERR_print_errors(err);
if (ctx)
EVP_PKEY_CTX_free(ctx);
return 0;
}
开发者ID:119120119,项目名称:node,代码行数:55,代码来源:genpkey.c
示例6: pkey_set_type
static int pkey_set_type(EVP_PKEY *pkey, int type, const char *str, int len)
{
const EVP_PKEY_ASN1_METHOD *ameth;
ENGINE *e = NULL;
if (pkey) {
if (pkey->pkey.ptr)
EVP_PKEY_free_it(pkey);
/*
* If key type matches and a method exists then this lookup has
* succeeded once so just indicate success.
*/
if ((type == pkey->save_type) && pkey->ameth)
return 1;
#ifndef OPENSSL_NO_ENGINE
/* If we have an ENGINE release it */
if (pkey->engine) {
ENGINE_finish(pkey->engine);
pkey->engine = NULL;
}
#endif
}
if (str)
ameth = EVP_PKEY_asn1_find_str(&e, str, len);
else
ameth = EVP_PKEY_asn1_find(&e, type);
#ifndef OPENSSL_NO_ENGINE
if (!pkey && e)
ENGINE_finish(e);
#endif
if (!ameth) {
EVPerr(EVP_F_PKEY_SET_TYPE, EVP_R_UNSUPPORTED_ALGORITHM);
return 0;
}
if (pkey) {
pkey->ameth = ameth;
pkey->engine = e;
pkey->type = pkey->ameth->pkey_id;
pkey->save_type = type;
}
return 1;
}
开发者ID:Voxer,项目名称:openssl,代码行数:42,代码来源:p_lib.c
示例7: ASN1err
EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp,
long length)
{
EVP_PKEY *ret;
const unsigned char *p = *pp;
if ((a == NULL) || (*a == NULL)) {
if ((ret = EVP_PKEY_new()) == NULL) {
ASN1err(ASN1_F_D2I_PRIVATEKEY, ERR_R_EVP_LIB);
return (NULL);
}
} else {
ret = *a;
#ifndef OPENSSL_NO_ENGINE
if (ret->engine) {
ENGINE_finish(ret->engine);
ret->engine = NULL;
}
#endif
}
if (!EVP_PKEY_set_type(ret, type)) {
ASN1err(ASN1_F_D2I_PRIVATEKEY, ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE);
goto err;
}
if (!ret->ameth->old_priv_decode ||
!ret->ameth->old_priv_decode(ret, &p, length)) {
if (ret->ameth->priv_decode) {
EVP_PKEY *tmp;
PKCS8_PRIV_KEY_INFO *p8 = NULL;
p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, length);
if (!p8)
goto err;
tmp = EVP_PKCS82PKEY(p8);
PKCS8_PRIV_KEY_INFO_free(p8);
if (tmp == NULL)
goto err;
EVP_PKEY_free(ret);
ret = tmp;
} else {
ASN1err(ASN1_F_D2I_PRIVATEKEY, ERR_R_ASN1_LIB);
goto err;
}
}
*pp = p;
if (a != NULL)
(*a) = ret;
return (ret);
err:
if ((ret != NULL) && ((a == NULL) || (*a != ret)))
EVP_PKEY_free(ret);
return (NULL);
}
开发者ID:PerfectlySoft,项目名称:Perfect-OpenSSL,代码行数:54,代码来源:d2i_.c
示例8: crypto_cleanup
/**
* @brief Clean encryption / decryption context.
* @note After cleanup, a context is free to be reused if necessary.
* @param f The context to use.
* @return Returns APR_ENOTIMPL if not supported.
*/
static apr_status_t crypto_cleanup(apr_crypto_t *f)
{
if (f->config->engine) {
ENGINE_finish(f->config->engine);
ENGINE_free(f->config->engine);
f->config->engine = NULL;
}
return APR_SUCCESS;
}
开发者ID:ATCP,项目名称:mtcp,代码行数:17,代码来源:apr_crypto_openssl.c
示例9: RAND_set_rand_method
int RAND_set_rand_method(const RAND_METHOD *meth)
{
#ifndef OPENSSL_NO_ENGINE
if (funct_ref) {
ENGINE_finish(funct_ref);
funct_ref = NULL;
}
#endif
default_RAND_meth = meth;
return 1;
}
开发者ID:GarikRC,项目名称:openssl,代码行数:11,代码来源:rand_lib.c
示例10: EVP_PKEY_free_it
static void EVP_PKEY_free_it(EVP_PKEY *x)
{
/* internal function; x is never NULL */
if (x->ameth && x->ameth->pkey_free) {
x->ameth->pkey_free(x);
x->pkey.ptr = NULL;
}
#ifndef OPENSSL_NO_ENGINE
ENGINE_finish(x->engine);
x->engine = NULL;
#endif
}
开发者ID:G-P-S,项目名称:openssl,代码行数:12,代码来源:p_lib.c
示例11: EVP_PKEY_free_it
static void EVP_PKEY_free_it(EVP_PKEY *x)
{
if (x->ameth && x->ameth->pkey_free)
x->ameth->pkey_free(x);
#ifndef OPENSSL_NO_ENGINE
if (x->engine)
{
ENGINE_finish(x->engine);
x->engine = NULL;
}
#endif
}
开发者ID:Sorcha,项目名称:NETMF-LPC,代码行数:12,代码来源:p_lib.cpp
示例12: DH_set_method
int
DH_set_method(DH *dh, const DH_METHOD *method)
{
(*dh->meth->finish)(dh);
if (dh->engine) {
ENGINE_finish(dh->engine);
dh->engine = NULL;
}
dh->meth = method;
(*dh->meth->init)(dh);
return 1;
}
开发者ID:Henauxg,项目名称:minix,代码行数:12,代码来源:dh.c
示例13: ecdh_data_free
void ecdh_data_free(void *data)
{
ECDH_DATA *r = (ECDH_DATA *)data;
#ifndef OPENSSL_NO_ENGINE
if (r->engine)
ENGINE_finish(r->engine);
#endif
CRYPTO_free_ex_data(CRYPTO_EX_INDEX_ECDH, r, &r->ex_data);
OPENSSL_clear_free((void *)r, sizeof(ECDH_DATA));
}
开发者ID:aeijdenberg,项目名称:openssl,代码行数:12,代码来源:ech_lib.c
示例14: RAND_set_rand_method
int
RAND_set_rand_method(const RAND_METHOD *meth)
{
const RAND_METHOD *old = selected_meth;
selected_meth = meth;
if (old)
(*old->cleanup)();
if (selected_engine) {
ENGINE_finish(selected_engine);
selected_engine = NULL;
}
return 1;
}
开发者ID:elric1,项目名称:heimdal,代码行数:13,代码来源:rand.c
示例15: EVP_PKEY_CTX_free
void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx)
{
if (ctx == NULL)
return;
if (ctx->pmeth && ctx->pmeth->cleanup)
ctx->pmeth->cleanup(ctx);
EVP_PKEY_free(ctx->pkey);
EVP_PKEY_free(ctx->peerkey);
#ifndef OPENSSL_NO_ENGINE
ENGINE_finish(ctx->engine);
#endif
OPENSSL_free(ctx);
}
开发者ID:zsdev2015,项目名称:GmSSL,代码行数:13,代码来源:pmeth_lib.c
示例16: uninitEngine
void uninitEngine(void)
{
// finish
printf("**** Finish engine ****\n");
ck_assert_msg(ENGINE_finish(_pkcs12_engine), "Failed to finish engine");
printf("**** Free engine ****\n");
ck_assert_msg(ENGINE_free(_pkcs12_engine), "Failed to free engine");
ENGINE_cleanup();
qeo_openssl_engine_destroy();
free(_engine_id);
}
开发者ID:JianlongCao,项目名称:qeo-core,代码行数:13,代码来源:engine_fixtures.c
示例17: get_optional_pkey_id
static int get_optional_pkey_id(const char *pkey_name)
{
const EVP_PKEY_ASN1_METHOD *ameth;
ENGINE *tmpeng = NULL;
int pkey_id=0;
ameth = EVP_PKEY_asn1_find_str(&tmpeng,pkey_name,-1);
if (ameth)
{
EVP_PKEY_asn1_get0_info(&pkey_id, NULL,NULL,NULL,NULL,ameth);
}
if (tmpeng) ENGINE_finish(tmpeng);
return pkey_id;
}
开发者ID:735579768,项目名称:droidVncServer,代码行数:13,代码来源:ssl_ciph.c
示例18: Curl_ossl_close_all
/*
* This function is called when the 'data' struct is going away. Close
* down everything and free all resources!
*/
int Curl_ossl_close_all(struct SessionHandle *data)
{
#ifdef HAVE_OPENSSL_ENGINE_H
if(data->state.engine) {
ENGINE_finish(data->state.engine);
ENGINE_free(data->state.engine);
data->state.engine = NULL;
}
#else
(void)data;
#endif
return 0;
}
开发者ID:dangardner,项目名称:mudmagic-client,代码行数:17,代码来源:ssluse.c
示例19: int_engine_init
static int int_engine_init(ENGINE *e)
{
if (!ENGINE_init(e))
return 0;
if (!initialized_engines)
initialized_engines = sk_ENGINE_new_null();
if (!initialized_engines || !sk_ENGINE_push(initialized_engines, e))
{
ENGINE_finish(e);
return 0;
}
return 1;
}
开发者ID:hackshields,项目名称:antivirus,代码行数:13,代码来源:eng_cnf.c
示例20: RAND_set_rand_method
int RAND_set_rand_method(const RAND_METHOD *meth)
{
if (!RUN_ONCE(&rand_lock_init, do_rand_lock_init))
return 0;
CRYPTO_THREAD_write_lock(rand_meth_lock);
#ifndef OPENSSL_NO_ENGINE
ENGINE_finish(funct_ref);
funct_ref = NULL;
#endif
default_RAND_meth = meth;
CRYPTO_THREAD_unlock(rand_meth_lock);
return 1;
}
开发者ID:vathpela,项目名称:mallory,代码行数:14,代码来源:rand_lib.c
注:本文中的ENGINE_finish函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论