本文整理汇总了C++中CRYPTO_set_ex_data函数的典型用法代码示例。如果您正苦于以下问题:C++ CRYPTO_set_ex_data函数的具体用法?C++ CRYPTO_set_ex_data怎么用?C++ CRYPTO_set_ex_data使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CRYPTO_set_ex_data函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MYOBJ_sethello
static void MYOBJ_sethello(MYOBJ *obj, char *cp)
{
int st;
st = CRYPTO_set_ex_data(&obj->ex_data, sidx, cp);
assert(st != 0);
}
示例2: ECDSA_set_ex_data
int ECDSA_set_ex_data(EC_KEY *d, int idx, void *arg)
{
ECDSA_DATA *ecdsa;
ecdsa = ecdsa_check(d);
if (ecdsa == NULL)
return 0;
return(CRYPTO_set_ex_data(&ecdsa->ex_data,idx,arg));
}
示例3: ECDH_set_ex_data
int ECDH_set_ex_data(EC_KEY *d, int idx, void *arg)
{
ECDH_DATA *ecdh;
ecdh = ecdh_check(d);
if (ecdh == NULL)
return 0;
return (CRYPTO_set_ex_data(&ecdh->ex_data, idx, arg));
}
示例4: keyhandle_dup
/**
* Duplicates a keyhandle stored in ex_data in case we copy a key.
*/
int keyhandle_dup(CRYPTO_EX_DATA* to, CRYPTO_EX_DATA*, void *ptrRef, int idx, long, void *) {
// This appears to be a bug in OpenSSL.
void** ptr = reinterpret_cast<void**>(ptrRef);
char* keyhandle = reinterpret_cast<char*>(*ptr);
if (keyhandle != NULL) {
char* keyhandle_copy = strdup(keyhandle);
*ptr = keyhandle_copy;
// Call this in case OpenSSL is fixed in the future.
(void) CRYPTO_set_ex_data(to, idx, keyhandle_copy);
}
return 1;
}
示例5: zlib_stateful_init
static int zlib_stateful_init(COMP_CTX *ctx)
{
int err;
struct zlib_state *state =
(struct zlib_state *)OPENSSL_malloc(sizeof(struct zlib_state));
if (state == NULL)
goto err;
state->istream.zalloc = zlib_zalloc;
state->istream.zfree = zlib_zfree;
state->istream.opaque = Z_NULL;
state->istream.next_in = Z_NULL;
state->istream.next_out = Z_NULL;
state->istream.avail_in = 0;
state->istream.avail_out = 0;
err = inflateInit_(&state->istream, ZLIB_VERSION, sizeof(z_stream));
if (err != Z_OK)
goto err;
state->ostream.zalloc = zlib_zalloc;
state->ostream.zfree = zlib_zfree;
state->ostream.opaque = Z_NULL;
state->ostream.next_in = Z_NULL;
state->ostream.next_out = Z_NULL;
state->ostream.avail_in = 0;
state->ostream.avail_out = 0;
err = deflateInit_(&state->ostream, Z_DEFAULT_COMPRESSION,
ZLIB_VERSION, sizeof(z_stream));
if (err != Z_OK)
goto err;
CRYPTO_new_ex_data(CRYPTO_EX_INDEX_COMP, ctx, &ctx->ex_data);
CRYPTO_set_ex_data(&ctx->ex_data, zlib_stateful_ex_idx, state);
return 1;
err:
if (state)
OPENSSL_free(state);
return 0;
}
示例6: SSL_SESSION_set_ex_data
int SSL_SESSION_set_ex_data(SSL_SESSION *s, int idx, void *arg)
{
return (CRYPTO_set_ex_data(&s->ex_data, idx, arg));
}
示例7: X509_set_ex_data
int X509_set_ex_data(X509 *r, int idx, void *arg)
{
return(CRYPTO_set_ex_data(&r->ex_data,idx,arg));
}
示例8: UI_set_ex_data
int UI_set_ex_data(UI *r, int idx, void *arg)
{
return (CRYPTO_set_ex_data(&r->ex_data, idx, arg));
}
示例9: UI_method_set_ex_data
int UI_method_set_ex_data(UI_METHOD *method, int idx, void *data)
{
return CRYPTO_set_ex_data(&method->ex_data, idx, data);
}
示例10: ENGINE_set_ex_data
int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg)
{
return(CRYPTO_set_ex_data(&e->ex_data, idx, arg));
}
示例11: STORE_set_ex_data
int
STORE_set_ex_data(STORE *r, int idx, void *arg)
{
return (CRYPTO_set_ex_data(&r->ex_data, idx, arg));
}
示例12: DH_set_ex_data
int DH_set_ex_data(DH *d, int idx, void *arg) {
return (CRYPTO_set_ex_data(&d->ex_data, idx, arg));
}
示例13: X509_STORE_set_ex_data
int X509_STORE_set_ex_data(X509_STORE *str, int idx, void *data)
{
return CRYPTO_set_ex_data(&str->ex_data, idx, data);
}
示例14: SSL_SESSION_set_ex_data
int SSL_SESSION_set_ex_data(SSL_SESSION *session, int idx, void *arg) {
return CRYPTO_set_ex_data(&session->ex_data, idx, arg);
}
示例15: RAND_DRBG_set_ex_data
/*
* Get and set the EXDATA
*/
int RAND_DRBG_set_ex_data(RAND_DRBG *drbg, int idx, void *arg)
{
return CRYPTO_set_ex_data(&drbg->ex_data, idx, arg);
}