这篇教程C++ ENGINE_finish函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ENGINE_finish函数的典型用法代码示例。如果您正苦于以下问题:C++ ENGINE_finish函数的具体用法?C++ ENGINE_finish怎么用?C++ ENGINE_finish使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ENGINE_finish函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: int_engine_module_finishstatic voidint_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,
示例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,
示例3: eng_RAND_set_rand_methodint 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,
示例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 VALUEossl_engine_finish(VALUE self){ ENGINE *e; GetEngine(self, e); if(!ENGINE_finish(e)) ossl_raise(eEngineError, NULL); return Qnil;}
开发者ID:DashYang,项目名称:sim,代码行数:16,
示例5: init_gen_strint 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,
示例6: pkey_set_typestatic 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,
示例7: ASN1errEVP_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,
示例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,
示例9: RAND_set_rand_methodint 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,
示例10: EVP_PKEY_free_itstatic 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,
示例11: EVP_PKEY_free_itstatic 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,
示例12: DH_set_methodintDH_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,
示例13: ecdh_data_freevoid 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,
示例14: RAND_set_rand_methodintRAND_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,
示例15: EVP_PKEY_CTX_freevoid 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,
示例16: uninitEnginevoid 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,
示例17: get_optional_pkey_idstatic 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,
示例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,
示例19: int_engine_initstatic 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,
示例20: RAND_set_rand_methodint 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,
示例21: RSA_set_methodintRSA_set_method(RSA *rsa, const RSA_METHOD *method){ (*rsa->meth->finish)(rsa); if (rsa->engine) { ENGINE_finish(rsa->engine); rsa->engine = NULL; } rsa->meth = method; (*rsa->meth->init)(rsa); return 1;}
开发者ID:alfintatorkace,项目名称:osx-10.9-opensource,代码行数:14,
示例22: RAND_cleanupvoidRAND_cleanup(void){ const RAND_METHOD *meth = selected_meth; ENGINE *engine = selected_engine; selected_meth = NULL; selected_engine = NULL; if (meth) (*meth->cleanup)(); if (engine) ENGINE_finish(engine);}
开发者ID:elric1,项目名称:heimdal,代码行数:14,
示例23: ecdsa_data_freestatic voidecdsa_data_free(void *data){ ECDSA_DATA *r = (ECDSA_DATA *)data;#ifndef OPENSSL_NO_ENGINE if (r->engine) ENGINE_finish(r->engine);#endif CRYPTO_free_ex_data(CRYPTO_EX_INDEX_ECDSA, r, &r->ex_data); explicit_bzero((void *)r, sizeof(ECDSA_DATA)); free(r);}
开发者ID:ajinkya93,项目名称:OpenBSD,代码行数:15,
示例24: SSL_CTX_set_client_cert_engineint SSL_CTX_set_client_cert_engine(SSL_CTX *ctx, ENGINE *e){ if (!ENGINE_init(e)) { SSLerr(SSL_F_SSL_CTX_SET_CLIENT_CERT_ENGINE, ERR_R_ENGINE_LIB); return 0; } if (!ENGINE_get_ssl_client_cert_function(e)) { SSLerr(SSL_F_SSL_CTX_SET_CLIENT_CERT_ENGINE, SSL_R_NO_CLIENT_CERT_METHOD); ENGINE_finish(e); return 0; } ctx->client_cert_engine = e; return 1;}
开发者ID:infinityhacks,项目名称:openssl,代码行数:15,
示例25: EVP_PKEY_typeint EVP_PKEY_type(int type){ int ret; const EVP_PKEY_ASN1_METHOD *ameth; ENGINE *e; ameth = EVP_PKEY_asn1_find(&e, type); if (ameth) ret = ameth->pkey_id; else ret = NID_undef;#ifndef OPENSSL_NO_ENGINE ENGINE_finish(e);#endif return ret;}
开发者ID:G-P-S,项目名称:openssl,代码行数:15,
示例26: do_evp_md_engine_fullstatic int do_evp_md_engine_full(EVP_MD_CTX *ctx, const EVP_MD **ptype, ENGINE *impl) { if (*ptype) { /* Ensure an ENGINE left lying around from last time is cleared * (the previous check attempted to avoid this if the same * ENGINE and EVP_MD could be used). */ if(ctx->engine) ENGINE_finish(ctx->engine); if(impl) { if (!ENGINE_init(impl)) { EVPerr(EVP_F_DO_EVP_MD_ENGINE_FULL,EVP_R_INITIALIZATION_ERROR); return 0; } } else /* Ask if an ENGINE is reserved for this job */ impl = ENGINE_get_digest_engine((*ptype)->type); if(impl) { /* There's an ENGINE for this job ... (apparently) */ const EVP_MD *d = ENGINE_get_digest(impl, (*ptype)->type); if(!d) { /* Same comment from evp_enc.c */ EVPerr(EVP_F_DO_EVP_MD_ENGINE_FULL,EVP_R_INITIALIZATION_ERROR); return 0; } /* We'll use the ENGINE's private digest definition */ *ptype = d; /* Store the ENGINE functional reference so we know * 'type' came from an ENGINE and we need to release * it when done. */ ctx->engine = impl; } else ctx->engine = NULL; } else if(!ctx->digest) { EVPerr(EVP_F_DO_EVP_MD_ENGINE_FULL,EVP_R_NO_DIGEST_SET); return 0; } return 1; }
开发者ID:RafaelRMachado,项目名称:MinnowBoard,代码行数:48,
示例27: DH_set_methodint DH_set_method(DH *dh, const DH_METHOD *meth) { /* NB: The caller is specifically setting a method, so it's not up to us * to deal with which ENGINE it comes from. */ const DH_METHOD *mtmp; mtmp = dh->meth; if (mtmp->finish) mtmp->finish(dh); if (dh->engine) { ENGINE_finish(dh->engine); dh->engine = NULL; } dh->meth = meth; if (meth->init) meth->init(dh); return 1; }
开发者ID:xyzy,项目名称:mips-openssl_0.9.7,代码行数:16,
示例28: STOREerrSTORE *STORE_new_engine(ENGINE *engine) { STORE *ret = NULL; ENGINE *e = engine; const STORE_METHOD *meth = 0;#ifdef OPENSSL_NO_ENGINE e = NULL;#else if (engine) { if (!ENGINE_init(engine)) { STOREerr(STORE_F_STORE_NEW_ENGINE, ERR_R_ENGINE_LIB); return NULL; } e = engine; } else { STOREerr(STORE_F_STORE_NEW_ENGINE,ERR_R_PASSED_NULL_PARAMETER); return NULL; } if(e) { meth = ENGINE_get_STORE(e); if(!meth) { STOREerr(STORE_F_STORE_NEW_ENGINE, ERR_R_ENGINE_LIB); ENGINE_finish(e); return NULL; } }#endif ret = STORE_new_method(meth); if (ret == NULL) { STOREerr(STORE_F_STORE_NEW_ENGINE,ERR_R_STORE_LIB); return NULL; } ret->engine = e; return(ret); }
开发者ID:awakecoding,项目名称:libressl,代码行数:47,
示例29: DH_freevoid DH_free (DH * r){ int i; if (r == NULL) return; i = CRYPTO_add (&r->references, -1, CRYPTO_LOCK_DH);#ifdef REF_PRINT REF_PRINT ("DH", r);#endif if (i > 0) return;#ifdef REF_CHECK if (i < 0) { fprintf (stderr, "DH_free, bad reference count/n"); abort (); }#endif if (r->meth->finish) r->meth->finish (r);#ifndef OPENSSL_NO_ENGINE if (r->engine) ENGINE_finish (r->engine);#endif CRYPTO_free_ex_data (CRYPTO_EX_INDEX_DH, r, &r->ex_data); if (r->p != NULL) BN_clear_free (r->p); if (r->g != NULL) BN_clear_free (r->g); if (r->q != NULL) BN_clear_free (r->q); if (r->j != NULL) BN_clear_free (r->j); if (r->seed) OPENSSL_free (r->seed); if (r->counter != NULL) BN_clear_free (r->counter); if (r->pub_key != NULL) BN_clear_free (r->pub_key); if (r->priv_key != NULL) BN_clear_free (r->priv_key); OPENSSL_free (r);}
开发者ID:274914765,项目名称:C,代码行数:47,
示例30: RAND_set_rand_engineint RAND_set_rand_engine(ENGINE *engine){ const RAND_METHOD *tmp_meth = NULL; if (engine) { if (!ENGINE_init(engine)) return 0; tmp_meth = ENGINE_get_RAND(engine); if (!tmp_meth) { ENGINE_finish(engine); return 0; } } /* This function releases any prior ENGINE so call it first */ RAND_set_rand_method(tmp_meth); funct_ref = engine; return 1;}
开发者ID:GarikRC,项目名称:openssl,代码行数:17,
注:本文中的ENGINE_finish函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ ENGINE_get_first函数代码示例 C++ ENGINE_cleanup函数代码示例 |