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


C++ ENGINE_add函数代码示例

本文整理汇总了C++中ENGINE_add函数的典型用法代码示例。如果您正苦于以下问题:C++ ENGINE_add函数的具体用法?C++ ENGINE_add怎么用?C++ ENGINE_add使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ENGINE_add函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: engine_add_nif

ERL_NIF_TERM engine_add_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{/* (Engine) */
#ifdef HAS_ENGINE_SUPPORT
    struct engine_ctx *ctx;

    // Get Engine
    ASSERT(argc == 1);

    if (!enif_get_resource(env, argv[0], engine_ctx_rtype, (void**)&ctx))
        goto bad_arg;

    if (!ENGINE_add(ctx->engine))
        goto failed;

    return atom_ok;

 bad_arg:
    return enif_make_badarg(env);

 failed:
    return ERROR_Atom(env, "add_engine_failed");

#else
    return atom_notsup;
#endif
}
开发者ID:bjorng,项目名称:otp,代码行数:26,代码来源:engine.c

示例2: openssl_engine_add

static int openssl_engine_add(lua_State*L)
{
  ENGINE* eng = CHECK_OBJECT(1, ENGINE, "openssl.engine");
  int ret = ENGINE_add(eng);
  lua_pushboolean(L, ret);
  return 1;
}
开发者ID:sdgdsffdsfff,项目名称:lua-openssl,代码行数:7,代码来源:engine.c

示例3: ENGINE_load_gost

void ENGINE_load_gost(void)
{
    ENGINE *toadd =engine_gost();
    if (!toadd) return;
    ENGINE_add(toadd);
    ENGINE_free(toadd);
    ERR_clear_error();
}
开发者ID:koson,项目名称:.NETMF_for_LPC17xx,代码行数:8,代码来源:gost_eng.cpp

示例4: ENGINE_load_4758cca

void ENGINE_load_4758cca(void)
	{
	ENGINE *e_4758 = engine_4758_cca();
	if (!e_4758) return;
	ENGINE_add(e_4758);
	ENGINE_free(e_4758);
	ERR_clear_error();   
	}
开发者ID:Sorcha,项目名称:NETMF-LPC,代码行数:8,代码来源:e_4758cca.cpp

示例5: ENGINE_load_ubsec

void ENGINE_load_ubsec(void)
	{
	/* Copied from eng_[openssl|dyn].c */
	ENGINE *toadd = engine_ubsec();
	if(!toadd) return;
	ENGINE_add(toadd);
	ENGINE_free(toadd);
	ERR_clear_error();
	}
开发者ID:EddieGarmon,项目名称:netduino-netmf,代码行数:9,代码来源:e_ubsec.cpp

示例6: engine_load_dasync_int

void engine_load_dasync_int(void)
{
    ENGINE *toadd = engine_dasync();
    if (!toadd)
        return;
    ENGINE_add(toadd);
    ENGINE_free(toadd);
    ERR_clear_error();
}
开发者ID:1234-,项目名称:openssl,代码行数:9,代码来源:e_dasync.c

示例7: LoadEngine

    static ENGINE* LoadEngine()
    {
      // This function creates an engine for PKCS#11 and inspired by
      // the "ENGINE_load_dynamic" function from OpenSSL, in file
      // "crypto/engine/eng_dyn.c"

      ENGINE* engine = ENGINE_new();
      if (!engine)
      {
        LOG(ERROR) << "Cannot create an OpenSSL engine for PKCS#11";
        throw OrthancException(ErrorCode_InternalError);
      }

      // Create a PKCS#11 context using libp11
      context_ = pkcs11_new();
      if (!context_)
      {
        LOG(ERROR) << "Cannot create a libp11 context for PKCS#11";
        ENGINE_free(engine);
        throw OrthancException(ErrorCode_InternalError);
      }

      if (!ENGINE_set_id(engine, PKCS11_ENGINE_ID) ||
          !ENGINE_set_name(engine, PKCS11_ENGINE_NAME) ||
          !ENGINE_set_cmd_defns(engine, PKCS11_ENGINE_COMMANDS) ||

          // Register the callback functions
          !ENGINE_set_init_function(engine, EngineInitialize) ||
          !ENGINE_set_finish_function(engine, EngineFinalize) ||
          !ENGINE_set_destroy_function(engine, EngineDestroy) ||
          !ENGINE_set_ctrl_function(engine, EngineControl) ||
          !ENGINE_set_load_pubkey_function(engine, EngineLoadPublicKey) ||
          !ENGINE_set_load_privkey_function(engine, EngineLoadPrivateKey) ||

          !ENGINE_set_RSA(engine, PKCS11_get_rsa_method()) ||
          !ENGINE_set_ECDSA(engine, PKCS11_get_ecdsa_method()) ||
          !ENGINE_set_ECDH(engine, PKCS11_get_ecdh_method()) ||

#if OPENSSL_VERSION_NUMBER  >= 0x10100002L
          !ENGINE_set_EC(engine, PKCS11_get_ec_key_method()) ||
#endif

          // Make OpenSSL know about our PKCS#11 engine
          !ENGINE_add(engine))
      {
        LOG(ERROR) << "Cannot initialize the OpenSSL engine for PKCS#11";
        pkcs11_finish(context_);
        ENGINE_free(engine);
        throw OrthancException(ErrorCode_InternalError);
      }

      // If the "ENGINE_add" worked, it gets a structural
      // reference. We release our just-created reference.
      ENGINE_free(engine);

      return ENGINE_by_id(PKCS11_ENGINE_ID);
    }
开发者ID:PACSinTERRA,项目名称:orthanc,代码行数:57,代码来源:Pkcs11.cpp

示例8: ENGINE_load_test

void ENGINE_load_test(void)
{
    fprintf(stderr, "arrive at ENGINE_load_test\n");
	/* Copied from eng_[openssl|dyn].c */
	ENGINE *toadd = engine_hwdev();
	if(!toadd) return;
	ENGINE_add(toadd);
	ENGINE_free(toadd);
	ERR_clear_error();
}
开发者ID:winstard,项目名称:GmSSL,代码行数:10,代码来源:cba_ecdh_engine.c

示例9: ENGINE_load_padlock

void ENGINE_load_padlock (void)
{
/* On non-x86 CPUs it just returns. */
#ifdef COMPILE_HW_PADLOCK
	ENGINE *toadd = ENGINE_padlock ();
	if (!toadd) return;
	ENGINE_add (toadd);
	ENGINE_free (toadd);
	ERR_clear_error ();
#endif
}
开发者ID:dframework,项目名称:cpp-common,代码行数:11,代码来源:eng_padlock.c

示例10: ENGINE_load_ibmca

static
#endif
void ENGINE_load_ibmca(void)
	{
	/* Copied from eng_[openssl|dyn].c */
	ENGINE *toadd = engine_ibmca();
	if(!toadd) return;
	ENGINE_add(toadd);
	ENGINE_free(toadd);
	ERR_clear_error();
	}
开发者ID:LucidOne,项目名称:Rovio,代码行数:11,代码来源:hw_ibmca.c

示例11: ENGINE_load_gost

void ENGINE_load_gost(void)
	{
	ENGINE *toadd;
	if (pmeth_GostR3410_94)
		return;
	toadd = engine_gost();
	if (!toadd) return;
	ENGINE_add(toadd);
	ENGINE_free(toadd);
	ERR_clear_error();
	}
开发者ID:0culus,项目名称:openssl,代码行数:11,代码来源:gost_eng.c

示例12: ENGINE_load_cluster_labs

static
#endif
void ENGINE_load_cluster_labs(void)
	{

	ENGINE *cluster_labs = engine_cluster_labs();
	
	if(!cluster_labs) return;
	ENGINE_add(cluster_labs);
	ENGINE_free(cluster_labs);
	ERR_clear_error();
	}
开发者ID:LucidOne,项目名称:Rovio,代码行数:12,代码来源:hw_cluster_labs.c

示例13: ENGINE_load_aesni

void ENGINE_load_aesni (void)
{
/* On non-x86 CPUs it just returns. */
#ifdef COMPILE_HW_AESNI
	ENGINE *toadd = ENGINE_aesni();
	if (!toadd)
		return;
	ENGINE_add (toadd);
	ENGINE_free (toadd);
	ERR_clear_error ();
#endif
}
开发者ID:evenmatrix,项目名称:streamster2-pyopenssl,代码行数:12,代码来源:eng_aesni.c

示例14: ENGINE_load_rdrand

void ENGINE_load_rdrand (void)
	{
	extern unsigned int OPENSSL_ia32cap_P[];

	if (OPENSSL_ia32cap_P[1] & (1<<(62-32)))
		{
		ENGINE *toadd = ENGINE_rdrand();
		if(!toadd) return;
		ENGINE_add(toadd);
		ENGINE_free(toadd);
		ERR_clear_error();
		}
	}
开发者ID:benwh4,项目名称:libressl,代码行数:13,代码来源:eng_rdrand.c

示例15: ENGINE_load_dynamic

void ENGINE_load_dynamic(void)
	{
	ENGINE *toadd = engine_dynamic();
	if(!toadd) return;
	ENGINE_add(toadd);
	/* If the "add" worked, it gets a structural reference. So either way,
	 * we release our just-created reference. */
	ENGINE_free(toadd);
	/* If the "add" didn't work, it was probably a conflict because it was
	 * already added (eg. someone calling ENGINE_load_blah then calling
	 * ENGINE_load_builtin_engines() perhaps). */
	ERR_clear_error();
	}
开发者ID:Cpasjuste,项目名称:platform_external_openssl,代码行数:13,代码来源:eng_dyn.c


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