本文整理汇总了C++中REF_PRINT函数的典型用法代码示例。如果您正苦于以下问题:C++ REF_PRINT函数的具体用法?C++ REF_PRINT怎么用?C++ REF_PRINT使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了REF_PRINT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EVP_PKEY_free
void EVP_PKEY_free(EVP_PKEY *x)
{
int i;
if (x == NULL) return;
i=CRYPTO_add(&x->references,-1,CRYPTO_LOCK_EVP_PKEY);
#ifdef REF_PRINT
REF_PRINT("EVP_PKEY",x);
#endif
if (i > 0) return;
#ifdef REF_CHECK
if (i < 0)
{
fprintf(stderr,"EVP_PKEY_free, bad reference count\n");
abort();
}
#endif
EVP_PKEY_free_it(x);
#ifndef OPENSSL_NO_X509
if (x->attributes)
sk_X509_ATTRIBUTE_pop_free(x->attributes, X509_ATTRIBUTE_free);
#endif
OPENSSL_free(x);
}
示例2: EC_KEY_free
void EC_KEY_free(EC_KEY *r)
{
int i;
if (r == NULL) return;
i=CRYPTO_add(&r->references,-1,CRYPTO_LOCK_EC);
#ifdef REF_PRINT
REF_PRINT("EC_KEY",r);
#endif
if (i > 0) return;
#ifdef REF_CHECK
if (i < 0)
{
fprintf(stderr,"EC_KEY_free, bad reference count\n");
abort();
}
#endif
if (r->group != NULL)
EC_GROUP_free(r->group);
if (r->pub_key != NULL)
EC_POINT_free(r->pub_key);
if (r->priv_key != NULL)
BN_clear_free(r->priv_key);
EC_EX_DATA_free_all_data(&r->method_data);
OPENSSL_cleanse((void *)r, sizeof(EC_KEY));
OPENSSL_free(r);
}
示例3: DSA_free
void DSA_free(DSA *r)
{
int i;
if (r == NULL) return;
i=CRYPTO_add(&r->references,-1,CRYPTO_LOCK_DSA);
#ifdef REF_PRINT
REF_PRINT("DSA",r);
#endif
if (i > 0) return;
#ifdef REF_CHECK
if (i < 0)
{
fprintf(stderr,"DSA_free, bad reference count\n");
abort();
}
#endif
CRYPTO_free_ex_data(dsa_meth, r, &r->ex_data);
if(r->meth->finish) r->meth->finish(r);
if (r->p != NULL) BN_clear_free(r->p);
if (r->q != NULL) BN_clear_free(r->q);
if (r->g != NULL) BN_clear_free(r->g);
if (r->pub_key != NULL) BN_clear_free(r->pub_key);
if (r->priv_key != NULL) BN_clear_free(r->priv_key);
if (r->kinv != NULL) BN_clear_free(r->kinv);
if (r->r != NULL) BN_clear_free(r->r);
OPENSSL_free(r);
}
示例4: EC_KEY_free
void EC_KEY_free(EC_KEY *r)
{
int i;
if (r == NULL)
return;
i = CRYPTO_add(&r->references, -1, CRYPTO_LOCK_EC);
#ifdef REF_PRINT
REF_PRINT("EC_KEY", r);
#endif
if (i > 0)
return;
#ifdef REF_CHECK
if (i < 0) {
fprintf(stderr, "EC_KEY_free, bad reference count\n");
abort();
}
#endif
if (r->meth->finish != NULL)
r->meth->finish(r);
#ifndef OPENSSL_NO_ENGINE
if (r->engine != NULL)
ENGINE_finish(r->engine);
#endif
CRYPTO_free_ex_data(CRYPTO_EX_INDEX_EC_KEY, r, &r->ex_data);
EC_GROUP_free(r->group);
EC_POINT_free(r->pub_key);
BN_clear_free(r->priv_key);
OPENSSL_clear_free((void *)r, sizeof(EC_KEY));
}
示例5: BIO_free
int BIO_free(BIO *a)
{
int ret=0,i;
if (a == NULL) return(0);
i=CRYPTO_add(&a->references,-1,CRYPTO_LOCK_BIO);
#ifdef REF_PRINT
REF_PRINT("BIO",a);
#endif
if (i > 0) return(1);
#ifdef REF_CHECK
if (i < 0)
{
TINYCLR_SSL_FPRINTF(OPENSSL_TYPE__FILE_STDERR,"BIO_free, bad reference count\n");
TINYCLR_SSL_ABORT();
}
#endif
if ((a->callback != NULL) &&
((i=(int)a->callback(a,BIO_CB_FREE,NULL,0,0L,1L)) <= 0))
return(i);
CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, a, &a->ex_data);
if ((a->method == NULL) || (a->method->destroy == NULL)) return(1);
ret=a->method->destroy(a);
OPENSSL_free(a);
return(1);
}
示例6: check_store
X509 *STORE_get_certificate(STORE *s, OPENSSL_ITEM attributes[],
OPENSSL_ITEM parameters[])
{
STORE_OBJECT *object;
X509 *x;
check_store(s,STORE_F_STORE_GET_CERTIFICATE,
get_object,STORE_R_NO_GET_OBJECT_FUNCTION);
object = s->meth->get_object(s, STORE_OBJECT_TYPE_X509_CERTIFICATE,
attributes, parameters);
if (!object || !object->data.x509.certificate)
{
STOREerr(STORE_F_STORE_GET_CERTIFICATE,
STORE_R_FAILED_GETTING_CERTIFICATE);
return 0;
}
CRYPTO_add(&object->data.x509.certificate->references,1,CRYPTO_LOCK_X509);
#ifdef REF_PRINT
REF_PRINT("X509",data);
#endif
x = object->data.x509.certificate;
STORE_OBJECT_free(object);
return x;
}
示例7: DH_free
void 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);
CRYPTO_free_ex_data(dh_meth, 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) 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);
Free(r);
}
示例8: X509_INFO_free
void X509_INFO_free(X509_INFO *x)
{
int i;
if (x == NULL) return;
i=CRYPTO_add(&x->references,-1,CRYPTO_LOCK_X509_INFO);
#ifdef REF_PRINT
REF_PRINT("X509_INFO",x);
#endif
if (i > 0) return;
#ifdef REF_CHECK
if (i < 0)
{
fprintf(stderr,"X509_INFO_free, bad reference count\n");
abort();
}
#endif
if (x->x509 != NULL) X509_free(x->x509);
if (x->crl != NULL) X509_CRL_free(x->crl);
if (x->x_pkey != NULL) X509_PKEY_free(x->x_pkey);
if (x->enc_data != NULL) OPENSSL_free(x->enc_data);
OPENSSL_free(x);
}
示例9: BIO_free
int BIO_free(BIO *a)
{
int i;
if (a == NULL) return(0);
i=CRYPTO_add(&a->references,-1,CRYPTO_LOCK_BIO);
#ifdef REF_PRINT
REF_PRINT("BIO",a);
#endif
if (i > 0) return(1);
#ifdef REF_CHECK
if (i < 0)
{
fprintf(stderr,"BIO_free, bad reference count\n");
abort();
}
#endif
if ((a->callback != NULL) &&
((i=(int)a->callback(a,BIO_CB_FREE,NULL,0,0L,1L)) <= 0))
return(i);
CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, a, &a->ex_data);
if ((a->method == NULL) || (a->method->destroy == NULL)) return(1);
a->method->destroy(a);
OPENSSL_free(a);
return(1);
}
示例10: X509_STORE_free
void X509_STORE_free(X509_STORE *vfy)
{
int i;
STACK_OF(X509_LOOKUP) *sk;
X509_LOOKUP *lu;
if (vfy == NULL)
return;
i = CRYPTO_add(&vfy->references, -1, CRYPTO_LOCK_X509_STORE);
#ifdef REF_PRINT
REF_PRINT("X509_STORE", vfy);
#endif
if (i > 0)
return;
#ifdef REF_CHECK
if (i < 0) {
fprintf(stderr, "X509_STORE_free, bad reference count\n");
abort(); /* ok */
}
#endif
sk = vfy->get_cert_methods;
for (i = 0; i < sk_X509_LOOKUP_num(sk); i++) {
lu = sk_X509_LOOKUP_value(sk, i);
X509_LOOKUP_shutdown(lu);
X509_LOOKUP_free(lu);
}
sk_X509_LOOKUP_free(sk);
sk_X509_OBJECT_pop_free(vfy->objs, cleanup);
CRYPTO_free_ex_data(CRYPTO_EX_INDEX_X509_STORE, vfy, &vfy->ex_data);
X509_VERIFY_PARAM_free(vfy->param);
OPENSSL_free(vfy);
}
示例11: X509_PKEY_free
void X509_PKEY_free(X509_PKEY *x)
{
int i;
if (x == NULL)
return;
i = CRYPTO_add(&x->references, -1, CRYPTO_LOCK_X509_PKEY);
#ifdef REF_PRINT
REF_PRINT("X509_PKEY", x);
#endif
if (i > 0)
return;
#ifdef REF_CHECK
if (i < 0) {
fprintf(stderr, "X509_PKEY_free, bad reference count\n");
abort();
}
#endif
X509_ALGOR_free(x->enc_algor);
ASN1_OCTET_STRING_free(x->enc_pkey);
EVP_PKEY_free(x->dec_pkey);
if (x->key_free)
OPENSSL_free(x->key_data);
OPENSSL_free(x);
}
示例12: RSA_free
void RSA_free(RSA *r)
{
int i;
if (r == NULL) return;
i=CRYPTO_add(&r->references,-1,CRYPTO_LOCK_RSA);
#ifdef REF_PRINT
REF_PRINT("RSA",r);
#endif
if (i > 0) return;
#ifdef REF_CHECK
if (i < 0)
{
fprintf(stderr,"RSA_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_RSA, r, &r->ex_data);
if (r->n != NULL) BN_clear_free(r->n);
if (r->e != NULL) BN_clear_free(r->e);
if (r->d != NULL) BN_clear_free(r->d);
if (r->p != NULL) BN_clear_free(r->p);
if (r->q != NULL) BN_clear_free(r->q);
if (r->dmp1 != NULL) BN_clear_free(r->dmp1);
if (r->dmq1 != NULL) BN_clear_free(r->dmq1);
if (r->iqmp != NULL) BN_clear_free(r->iqmp);
if (r->blinding != NULL) BN_BLINDING_free(r->blinding);
if (r->mt_blinding != NULL) BN_BLINDING_free(r->mt_blinding);
if (r->bignum_data != NULL) OPENSSL_free_locked(r->bignum_data);
if (r->additional_primes != NULL)
{
int j;
for (j = 0; j < sk_RSA_additional_prime_num(r->additional_primes); j++)
{
RSA_additional_prime *ap = sk_RSA_additional_prime_value(r->additional_primes, j);
BN_clear_free(ap->prime);
BN_clear_free(ap->exp);
BN_clear_free(ap->coeff);
BN_clear_free(ap->r);
}
sk_RSA_additional_prime_pop_free(r->additional_primes, int_rsa_free_additional_prime);
}
OPENSSL_free(r);
}
示例13: RSA_up_ref
int RSA_up_ref(RSA *r)
{
int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_RSA);
#ifdef REF_PRINT
REF_PRINT("RSA",r);
#endif
#if 0//def REF_CHECK
if (i < 2)
{
abort();
}
#endif
return ((i > 1) ? 1 : 0);
}
示例14: EC_KEY_up_ref
int EC_KEY_up_ref(EC_KEY *r)
{
int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_EC);
#ifdef REF_PRINT
REF_PRINT("EC_KEY", r);
#endif
#ifdef REF_CHECK
if (i < 2) {
fprintf(stderr, "EC_KEY_up, bad reference count\n");
abort();
}
#endif
return ((i > 1) ? 1 : 0);
}
示例15: RSA_up_ref
int RSA_up_ref(RSA *r)
{
int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_RSA);
#ifdef REF_PRINT
REF_PRINT("RSA", r);
#endif
#ifdef REF_CHECK
if (i < 2) {
fprintf(stderr, "RSA_up_ref, bad reference count\n");
abort();
}
#endif
return ((i > 1) ? 1 : 0);
}