本文整理汇总了C++中DSO_free函数的典型用法代码示例。如果您正苦于以下问题:C++ DSO_free函数的具体用法?C++ DSO_free怎么用?C++ DSO_free使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DSO_free函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ibmca_finish
static int ibmca_finish(ENGINE *e)
{
if(ibmca_dso == NULL)
{
IBMCAerr(IBMCA_F_IBMCA_FINISH,IBMCA_R_NOT_LOADED);
return 0;
}
release_context(handle);
if(!DSO_free(ibmca_dso))
{
IBMCAerr(IBMCA_F_IBMCA_FINISH,IBMCA_R_DSO_FAILURE);
return 0;
}
ibmca_dso = NULL;
return 1;
}
示例2: ubsec_finish
static int ubsec_finish(ENGINE *e)
{
free_UBSEC_LIBNAME();
if(ubsec_dso == NULL)
{
UBSECerr(UBSEC_F_UBSEC_FINISH, UBSEC_R_NOT_LOADED);
return 0;
}
if(!DSO_free(ubsec_dso))
{
UBSECerr(UBSEC_F_UBSEC_FINISH, UBSEC_R_DSO_FAILURE);
return 0;
}
ubsec_dso = NULL;
p_UBSEC_ubsec_bytes_to_bits = NULL;
p_UBSEC_ubsec_bits_to_bytes = NULL;
p_UBSEC_ubsec_open = NULL;
p_UBSEC_ubsec_close = NULL;
#ifndef OPENSSL_NO_DH
p_UBSEC_diffie_hellman_generate_ioctl = NULL;
p_UBSEC_diffie_hellman_agree_ioctl = NULL;
#endif
#ifndef OPENSSL_NO_RSA
p_UBSEC_rsa_mod_exp_ioctl = NULL;
p_UBSEC_rsa_mod_exp_crt_ioctl = NULL;
#endif
#ifndef OPENSSL_NO_DSA
p_UBSEC_dsa_sign_ioctl = NULL;
p_UBSEC_dsa_verify_ioctl = NULL;
#endif
p_UBSEC_math_accelerate_ioctl = NULL;
p_UBSEC_rng_ioctl = NULL;
p_UBSEC_max_key_len_ioctl = NULL;
return 1;
}
示例3: surewarehk_finish
static int surewarehk_finish(ENGINE *e)
{
int to_return = 1;
if(surewarehk_dso == NULL)
{
SUREWAREerr(SUREWARE_F_SUREWAREHK_FINISH,ENGINE_R_NOT_LOADED);
to_return = 0;
goto err;
}
p_surewarehk_Finish();
if(!DSO_free(surewarehk_dso))
{
SUREWAREerr(SUREWARE_F_SUREWAREHK_FINISH,ENGINE_R_DSO_FAILURE);
to_return = 0;
goto err;
}
err:
if (logstream)
BIO_free(logstream);
surewarehk_dso = NULL;
p_surewarehk_Init = NULL;
p_surewarehk_Finish = NULL;
p_surewarehk_Rand_Bytes = NULL;
p_surewarehk_Rand_Seed = NULL;
p_surewarehk_Load_Privkey = NULL;
p_surewarehk_Load_Rsa_Pubkey = NULL;
p_surewarehk_Free = NULL;
p_surewarehk_Rsa_Priv_Dec = NULL;
p_surewarehk_Rsa_Sign = NULL;
p_surewarehk_Dsa_Sign = NULL;
p_surewarehk_Info_Pubkey = NULL;
p_surewarehk_Load_Dsa_Pubkey = NULL;
p_surewarehk_Mod_Exp = NULL;
return to_return;
}
示例4: DSO_new_method
DSO *DSO_load(DSO *dso, const char *filename, DSO_METHOD *meth, int flags)
{
DSO *ret;
int allocated = 0;
if(dso == NULL)
{
ret = DSO_new_method(meth);
if(ret == NULL)
{
DSOerr(DSO_F_DSO_LOAD,ERR_R_MALLOC_FAILURE);
goto err;
}
allocated = 1;
/* Pass the provided flags to the new DSO object */
if(DSO_ctrl(ret, DSO_CTRL_SET_FLAGS, flags, NULL) < 0)
{
DSOerr(DSO_F_DSO_LOAD,DSO_R_CTRL_FAILED);
goto err;
}
}
else
ret = dso;
/* Don't load if we're currently already loaded */
if(ret->filename != NULL)
{
DSOerr(DSO_F_DSO_LOAD,DSO_R_DSO_ALREADY_LOADED);
goto err;
}
/* filename can only be NULL if we were passed a dso that already has
* one set. */
if(filename != NULL)
if(!DSO_set_filename(ret, filename))
{
DSOerr(DSO_F_DSO_LOAD,DSO_R_SET_FILENAME_FAILED);
goto err;
}
filename = ret->filename;
if(filename == NULL)
{
DSOerr(DSO_F_DSO_LOAD,DSO_R_NO_FILENAME);
goto err;
}
if(ret->meth->dso_load == NULL)
{
DSOerr(DSO_F_DSO_LOAD,DSO_R_UNSUPPORTED);
goto err;
}
if(!ret->meth->dso_load(ret))
{
DSOerr(DSO_F_DSO_LOAD,DSO_R_LOAD_FAILED);
goto err;
}
/* Load succeeded */
return(ret);
err:
if(allocated)
DSO_free(ret);
return(NULL);
}
示例5: COMP_zlib_cleanup
void COMP_zlib_cleanup (void)
{
#ifdef ZLIB_SHARED
if (zlib_dso)
DSO_free (zlib_dso);
#endif
}
示例6: ibm_4758_cca_finish
static int ibm_4758_cca_finish(ENGINE *e)
{
free_CCA4758_LIB_NAME();
if(!dso)
{
CCA4758err(CCA4758_F_IBM_4758_CCA_FINISH,
CCA4758_R_NOT_LOADED);
return 0;
}
if(!DSO_free(dso))
{
CCA4758err(CCA4758_F_IBM_4758_CCA_FINISH,
CCA4758_R_UNIT_FAILURE);
return 0;
}
dso = NULL;
#ifndef OPENSSL_NO_RSA
keyRecordRead = (F_KEYRECORDREAD)0;
randomNumberGenerate = (F_RANDOMNUMBERGENERATE)0;
digitalSignatureGenerate = (F_DIGITALSIGNATUREGENERATE)0;
digitalSignatureVerify = (F_DIGITALSIGNATUREVERIFY)0;
publicKeyExtract = (F_PUBLICKEYEXTRACT)0;
pkaEncrypt = (F_PKAENCRYPT)0;
pkaDecrypt = (F_PKADECRYPT)0;
#endif
randomNumberGenerate = (F_RANDOMNUMBERGENERATE)0;
return 1;
}
示例7: cluster_labs_finish
static int cluster_labs_finish(ENGINE *e)
{
if (cluster_labs_dso == NULL) {
CLerr(CL_F_CLUSTER_LABS_FINISH, CL_R_NOT_LOADED);
return 0;
}
if (!DSO_free(cluster_labs_dso)) {
CLerr(CL_F_CLUSTER_LABS_FINISH, CL_R_DSO_FAILURE);
return 0;
}
cluster_labs_dso = NULL;
p_cl_engine_init = NULL;
p_cl_mod_exp = NULL;
p_cl_rsa_mod_exp = NULL;
p_cl_mod_exp_crt = NULL;
p_cl_rsa_priv_enc = NULL;
p_cl_rsa_priv_dec = NULL;
p_cl_rsa_pub_enc = NULL;
p_cl_rsa_pub_dec = NULL;
p_cl_rand_bytes = NULL;
p_cl_dsa_sign = NULL;
p_cl_dsa_verify = NULL;
return (1);
}
示例8: hwcrhk_finish
static int hwcrhk_finish(ENGINE *e)
{
int to_return = 1;
free_HWCRHK_LIBNAME();
if(hwcrhk_dso == NULL)
{
HWCRHKerr(HWCRHK_F_HWCRHK_FINISH,HWCRHK_R_NOT_LOADED);
to_return = 0;
goto err;
}
release_context(hwcrhk_context);
if(!DSO_free(hwcrhk_dso))
{
HWCRHKerr(HWCRHK_F_HWCRHK_FINISH,HWCRHK_R_DSO_FAILURE);
to_return = 0;
goto err;
}
err:
if (logstream)
BIO_free(logstream);
hwcrhk_dso = NULL;
p_hwcrhk_Init = NULL;
p_hwcrhk_Finish = NULL;
p_hwcrhk_ModExp = NULL;
#ifndef OPENSSL_NO_RSA
p_hwcrhk_RSA = NULL;
p_hwcrhk_RSALoadKey = NULL;
p_hwcrhk_RSAGetPublicKey = NULL;
p_hwcrhk_RSAUnloadKey = NULL;
#endif
p_hwcrhk_ModExpCRT = NULL;
p_hwcrhk_RandomBytes = NULL;
return to_return;
}
示例9: cswift_init
/* (de)initialisation functions. */
static int cswift_init(ENGINE *e)
{
SW_CONTEXT_HANDLE hac;
t_swAcquireAccContext *p1;
t_swAttachKeyParam *p2;
t_swSimpleRequest *p3;
t_swReleaseAccContext *p4;
if(cswift_dso != NULL)
{
CSWIFTerr(CSWIFT_F_CSWIFT_INIT,CSWIFT_R_ALREADY_LOADED);
goto err;
}
/* Attempt to load libswift.so/swift.dll/whatever. */
cswift_dso = DSO_load(NULL, get_CSWIFT_LIBNAME(), NULL, 0);
if(cswift_dso == NULL)
{
CSWIFTerr(CSWIFT_F_CSWIFT_INIT,CSWIFT_R_NOT_LOADED);
goto err;
}
if(!(p1 = (t_swAcquireAccContext *)
DSO_bind_func(cswift_dso, CSWIFT_F1)) ||
!(p2 = (t_swAttachKeyParam *)
DSO_bind_func(cswift_dso, CSWIFT_F2)) ||
!(p3 = (t_swSimpleRequest *)
DSO_bind_func(cswift_dso, CSWIFT_F3)) ||
!(p4 = (t_swReleaseAccContext *)
DSO_bind_func(cswift_dso, CSWIFT_F4)))
{
CSWIFTerr(CSWIFT_F_CSWIFT_INIT,CSWIFT_R_NOT_LOADED);
goto err;
}
/* Copy the pointers */
p_CSwift_AcquireAccContext = p1;
p_CSwift_AttachKeyParam = p2;
p_CSwift_SimpleRequest = p3;
p_CSwift_ReleaseAccContext = p4;
/* Try and get a context - if not, we may have a DSO but no
* accelerator! */
if(!get_context(&hac))
{
CSWIFTerr(CSWIFT_F_CSWIFT_INIT,CSWIFT_R_UNIT_FAILURE);
goto err;
}
release_context(hac);
/* Everything's fine. */
return 1;
err:
if(cswift_dso)
{
DSO_free(cswift_dso);
cswift_dso = NULL;
}
p_CSwift_AcquireAccContext = NULL;
p_CSwift_AttachKeyParam = NULL;
p_CSwift_SimpleRequest = NULL;
p_CSwift_ReleaseAccContext = NULL;
return 0;
}
示例10: atalla_init
/* (de)initialisation functions. */
static int atalla_init(ENGINE *e)
{
tfnASI_GetHardwareConfig *p1;
tfnASI_RSAPrivateKeyOpFn *p2;
tfnASI_GetPerformanceStatistics *p3;
/* Not sure of the origin of this magic value, but Ben's code had it
* and it seemed to have been working for a few people. :-) */
unsigned int config_buf[1024];
if(atalla_dso != NULL)
{
ATALLAerr(ATALLA_F_ATALLA_INIT,ATALLA_R_ALREADY_LOADED);
goto err;
}
/* Attempt to load libatasi.so/atasi.dll/whatever. Needs to be
* changed unfortunately because the Atalla drivers don't have
* standard library names that can be platform-translated well. */
/* TODO: Work out how to actually map to the names the Atalla
* drivers really use - for now a symbollic link needs to be
* created on the host system from libatasi.so to atasi.so on
* unix variants. */
atalla_dso = DSO_load(NULL, get_ATALLA_LIBNAME(), NULL, 0);
if(atalla_dso == NULL)
{
ATALLAerr(ATALLA_F_ATALLA_INIT,ATALLA_R_NOT_LOADED);
goto err;
}
if(!(p1 = (tfnASI_GetHardwareConfig *)DSO_bind_func(
atalla_dso, ATALLA_F1)) ||
!(p2 = (tfnASI_RSAPrivateKeyOpFn *)DSO_bind_func(
atalla_dso, ATALLA_F2)) ||
!(p3 = (tfnASI_GetPerformanceStatistics *)DSO_bind_func(
atalla_dso, ATALLA_F3)))
{
ATALLAerr(ATALLA_F_ATALLA_INIT,ATALLA_R_NOT_LOADED);
goto err;
}
/* Copy the pointers */
p_Atalla_GetHardwareConfig = p1;
p_Atalla_RSAPrivateKeyOpFn = p2;
p_Atalla_GetPerformanceStatistics = p3;
/* Perform a basic test to see if there's actually any unit
* running. */
if(p1(0L, config_buf) != 0)
{
ATALLAerr(ATALLA_F_ATALLA_INIT,ATALLA_R_UNIT_FAILURE);
goto err;
}
/* Everything's fine. */
return 1;
err:
if(atalla_dso)
DSO_free(atalla_dso);
atalla_dso = NULL;
p_Atalla_GetHardwareConfig = NULL;
p_Atalla_RSAPrivateKeyOpFn = NULL;
p_Atalla_GetPerformanceStatistics = NULL;
return 0;
}
示例11: comp_zlib_cleanup_int
void comp_zlib_cleanup_int(void)
{
#ifdef ZLIB_SHARED
if (zlib_dso != NULL)
DSO_free(zlib_dso);
zlib_dso = NULL;
#endif
}
示例12: OPENSSL_atexit
int OPENSSL_atexit(void (*handler)(void))
{
OPENSSL_INIT_STOP *newhand;
#if !defined(OPENSSL_NO_DSO) && !defined(OPENSSL_USE_NODELETE)
{
union {
void *sym;
void (*func)(void);
} handlersym;
handlersym.func = handler;
# ifdef DSO_WIN32
{
HMODULE handle = NULL;
BOOL ret;
/*
* We don't use the DSO route for WIN32 because there is a better
* way
*/
ret = GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
| GET_MODULE_HANDLE_EX_FLAG_PIN,
handlersym.sym, &handle);
if (!ret)
return 0;
}
# else
/*
* Deliberately leak a reference to the handler. This will force the
* library/code containing the handler to remain loaded until we run the
* atexit handler. If -znodelete has been used then this is
* unnecessary.
*/
{
DSO *dso = NULL;
ERR_set_mark();
dso = DSO_dsobyaddr(handlersym.sym, DSO_FLAG_NO_UNLOAD_ON_FREE);
DSO_free(dso);
ERR_pop_to_mark();
}
# endif
}
#endif
newhand = OPENSSL_malloc(sizeof(*newhand));
if (newhand == NULL)
return 0;
newhand->handler = handler;
newhand->next = stop_handlers;
stop_handlers = newhand;
return 1;
}
示例13: aep_finish
static int aep_finish(ENGINE *e)
{
int to_return = 0, in_use;
AEP_RV rv;
if(aep_dso == NULL)
{
AEPHKerr(AEPHK_F_AEP_FINISH,AEPHK_R_NOT_LOADED);
goto err;
}
rv = aep_close_all_connections(0, &in_use);
if (rv != AEP_R_OK)
{
AEPHKerr(AEPHK_F_AEP_FINISH,AEPHK_R_CLOSE_HANDLES_FAILED);
goto err;
}
if (in_use)
{
AEPHKerr(AEPHK_F_AEP_FINISH,AEPHK_R_CONNECTIONS_IN_USE);
goto err;
}
rv = p_AEP_Finalize();
if (rv != AEP_R_OK)
{
AEPHKerr(AEPHK_F_AEP_FINISH,AEPHK_R_FINALIZE_FAILED);
goto err;
}
if(!DSO_free(aep_dso))
{
AEPHKerr(AEPHK_F_AEP_FINISH,AEPHK_R_UNIT_FAILURE);
goto err;
}
aep_dso = NULL;
p_AEP_CloseConnection = NULL;
p_AEP_OpenConnection = NULL;
p_AEP_ModExp = NULL;
p_AEP_ModExpCrt = NULL;
#ifdef AEPRAND
p_AEP_GenRandom = NULL;
#endif
p_AEP_Initialize = NULL;
p_AEP_Finalize = NULL;
p_AEP_SetBNCallBacks = NULL;
to_return = 1;
err:
return to_return;
}
示例14: dynamic_data_ctx_free_func
/*
* Because our ex_data element may or may not get allocated depending on
* whether a "first-use" occurs before the ENGINE is freed, we have a memory
* leak problem to solve. We can't declare a "new" handler for the ex_data as
* we don't want a dynamic_data_ctx in *all* ENGINE structures of all types
* (this is a bug in the design of CRYPTO_EX_DATA). As such, we just declare
* a "free" handler and that will get called if an ENGINE is being destroyed
* and there was an ex_data element corresponding to our context type.
*/
static void dynamic_data_ctx_free_func(void *parent, void *ptr,
CRYPTO_EX_DATA *ad, int idx, long argl,
void *argp)
{
if (ptr) {
dynamic_data_ctx *ctx = (dynamic_data_ctx *)ptr;
DSO_free(ctx->dynamic_dso);
OPENSSL_free(ctx->DYNAMIC_LIBNAME);
OPENSSL_free(ctx->engine_id);
sk_OPENSSL_STRING_pop_free(ctx->dirs, int_free_str);
OPENSSL_free(ctx);
}
}
示例15: nuron_finish
static int nuron_finish(ENGINE *e)
{
free_NURON_LIBNAME();
if (pvDSOHandle == NULL) {
NURONerr(NURON_F_NURON_FINISH, NURON_R_NOT_LOADED);
return 0;
}
if (!DSO_free(pvDSOHandle)) {
NURONerr(NURON_F_NURON_FINISH, NURON_R_DSO_FAILURE);
return 0;
}
pvDSOHandle = NULL;
pfnModExp = NULL;
return 1;
}