return 1;
}
ret = CRYPTO_add(lck, op, aux->ref_lock);
-#ifdef REF_PRINT
- fprintf(stderr, "%s: Reference Count: %d\n", it->sname, *lck);
-#endif
-#ifdef REF_CHECK
- if (ret < 0)
- fprintf(stderr, "%s, bad reference count\n", it->sname);
-#endif
return ret;
}
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 == 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
if (x->enc_algor != NULL) X509_ALGOR_free(x->enc_algor);
if (x->enc_pkey != NULL) M_ASN1_OCTET_STRING_free(x->enc_pkey);
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);
pointer = sk_CRYPTO_dynlock_value(dyn_locks, i);
if (pointer != NULL) {
--pointer->references;
-#ifdef REF_CHECK
- if (pointer->references < 0) {
- fprintf(stderr, "CRYPTO_destroy_dynlockid, bad reference count\n");
- abort();
- } else
-#endif
if (pointer->references <= 0) {
(void)sk_CRYPTO_dynlock_set(dyn_locks, i, NULL);
} else
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);
int DH_up_ref(DH *r)
{
int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_DH);
-#ifdef REF_PRINT
- REF_PRINT("DH",r);
-#endif
-#ifdef REF_CHECK
- if (i < 2)
- {
- fprintf(stderr, "DH_up, bad reference count\n");
- abort();
- }
-#endif
return ((i > 1) ? 1 : 0);
}
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
if(r->meth->finish)
r->meth->finish(r);
int DSA_up_ref(DSA *r)
{
int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_DSA);
-#ifdef REF_PRINT
- REF_PRINT("DSA",r);
-#endif
-#ifdef REF_CHECK
- if (i < 2)
- {
- fprintf(stderr, "DSA_up_ref, bad reference count\n");
- abort();
- }
-#endif
return ((i > 1) ? 1 : 0);
}
}
i=CRYPTO_add(&dso->references,-1,CRYPTO_LOCK_DSO);
-#ifdef REF_PRINT
- REF_PRINT("DSO",dso);
-#endif
if(i > 0) return(1);
-#ifdef REF_CHECK
- if(i < 0)
- {
- fprintf(stderr,"DSO_free, bad reference count\n");
- abort();
- }
-#endif
if((dso->meth->dso_unload != NULL) && !dso->meth->dso_unload(dso))
{
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);
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);
}
if(!to_return)
return 0;
}
-#ifdef REF_CHECK
- if(e->funct_ref < 0)
- {
- fprintf(stderr,"ENGINE_finish, bad functional reference count\n");
- abort();
- }
-#endif
+
/* Release the structural reference too */
if(!engine_free_util(e, 0))
{
i = --e->struct_ref;
engine_ref_debug(e, 0, -1)
if (i > 0) return 1;
-#ifdef REF_CHECK
- if (i < 0)
- {
- fprintf(stderr,"ENGINE_free, bad structural reference count\n");
- abort();
- }
-#endif
+
/* Free up any dynamically allocated public key methods */
engine_pkey_meths_free(e);
engine_pkey_asn1_meths_free(e);
return;
i = CRYPTO_add(&int_thread_hash_references, -1, CRYPTO_LOCK_ERR);
-
-#ifdef REF_PRINT
- fprintf(stderr,"%4d:%s\n",int_thread_hash_references,"ERR");
-#endif
if (i > 0) return;
-#ifdef REF_CHECK
- if (i < 0)
- {
- fprintf(stderr,"int_thread_release, bad reference count\n");
- abort(); /* ok */
- }
-#endif
+
*hash = NULL;
}
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);
if (x->attributes)
sk_X509_ATTRIBUTE_pop_free(x->attributes, X509_ATTRIBUTE_free);
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);
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);
}
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;
}
CRYPTO_add(&data->references,1,CRYPTO_LOCK_X509);
-#ifdef REF_PRINT
- REF_PRINT("X509",data);
-#endif
object->data.x509.certificate = data;
i = s->meth->store_object(s, STORE_OBJECT_TYPE_X509_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;
return 0;
}
CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY);
-#ifdef REF_PRINT
- REF_PRINT("EVP_PKEY",data);
-#endif
pkey = object->data.key;
STORE_OBJECT_free(object);
return pkey;
return 0;
}
CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY);
-#ifdef REF_PRINT
- REF_PRINT("EVP_PKEY",data);
-#endif
pkey = object->data.key;
STORE_OBJECT_free(object);
return pkey;
}
CRYPTO_add(&data->references,1,CRYPTO_LOCK_EVP_PKEY);
-#ifdef REF_PRINT
- REF_PRINT("EVP_PKEY",data);
-#endif
object->data.key = data;
i = s->meth->store_object(s, STORE_OBJECT_TYPE_PRIVATE_KEY, object,
return 0;
}
CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY);
-#ifdef REF_PRINT
- REF_PRINT("EVP_PKEY",data);
-#endif
pkey = object->data.key;
STORE_OBJECT_free(object);
return pkey;
return 0;
}
CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY);
-#ifdef REF_PRINT
- REF_PRINT("EVP_PKEY",data);
-#endif
pkey = object->data.key;
STORE_OBJECT_free(object);
return pkey;
}
CRYPTO_add(&data->references,1,CRYPTO_LOCK_EVP_PKEY);
-#ifdef REF_PRINT
- REF_PRINT("EVP_PKEY",data);
-#endif
object->data.key = data;
i = s->meth->store_object(s, STORE_OBJECT_TYPE_PUBLIC_KEY, object,
return 0;
}
CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY);
-#ifdef REF_PRINT
- REF_PRINT("EVP_PKEY",data);
-#endif
pkey = object->data.key;
STORE_OBJECT_free(object);
return pkey;
return 0;
}
CRYPTO_add(&object->data.crl->references,1,CRYPTO_LOCK_X509_CRL);
-#ifdef REF_PRINT
- REF_PRINT("X509_CRL",data);
-#endif
crl = object->data.crl;
STORE_OBJECT_free(object);
return crl;
return 0;
}
CRYPTO_add(&object->data.crl->references,1,CRYPTO_LOCK_X509_CRL);
-#ifdef REF_PRINT
- REF_PRINT("X509_CRL",data);
-#endif
crl = object->data.crl;
STORE_OBJECT_free(object);
return crl;
}
CRYPTO_add(&data->references,1,CRYPTO_LOCK_X509_CRL);
-#ifdef REF_PRINT
- REF_PRINT("X509_CRL",data);
-#endif
object->data.crl = data;
i = s->meth->store_object(s, STORE_OBJECT_TYPE_X509_CRL, object,
return 0;
}
CRYPTO_add(&object->data.crl->references,1,CRYPTO_LOCK_X509_CRL);
-#ifdef REF_PRINT
- REF_PRINT("X509_CRL",data);
-#endif
crl = object->data.crl;
STORE_OBJECT_free(object);
return crl;
return 1;
}
ret = CRYPTO_add(lck, op, aux->ref_lock);
-#ifdef REF_PRINT
- fprintf(stderr, "%s: Reference Count: %d\n", it->sname, *lck);
-#endif
-#ifdef REF_CHECK
- if (ret < 0)
- fprintf(stderr, "%s, bad reference count\n", it->sname);
-#endif
return ret;
}
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 == 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
if (x->enc_algor != NULL) X509_ALGOR_free(x->enc_algor);
if (x->enc_pkey != NULL) M_ASN1_OCTET_STRING_free(x->enc_pkey);
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);
pointer = sk_CRYPTO_dynlock_value(dyn_locks, i);
if (pointer != NULL) {
--pointer->references;
-#ifdef REF_CHECK
- if (pointer->references < 0) {
- fprintf(stderr, "CRYPTO_destroy_dynlockid, bad reference count\n");
- abort();
- } else
-#endif
if (pointer->references <= 0) {
(void)sk_CRYPTO_dynlock_set(dyn_locks, i, NULL);
} else
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);
int DH_up_ref(DH *r)
{
int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_DH);
-#ifdef REF_PRINT
- REF_PRINT("DH",r);
-#endif
-#ifdef REF_CHECK
- if (i < 2)
- {
- fprintf(stderr, "DH_up, bad reference count\n");
- abort();
- }
-#endif
return ((i > 1) ? 1 : 0);
}
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
if(r->meth->finish)
r->meth->finish(r);
int DSA_up_ref(DSA *r)
{
int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_DSA);
-#ifdef REF_PRINT
- REF_PRINT("DSA",r);
-#endif
-#ifdef REF_CHECK
- if (i < 2)
- {
- fprintf(stderr, "DSA_up_ref, bad reference count\n");
- abort();
- }
-#endif
return ((i > 1) ? 1 : 0);
}
}
i=CRYPTO_add(&dso->references,-1,CRYPTO_LOCK_DSO);
-#ifdef REF_PRINT
- REF_PRINT("DSO",dso);
-#endif
if(i > 0) return(1);
-#ifdef REF_CHECK
- if(i < 0)
- {
- fprintf(stderr,"DSO_free, bad reference count\n");
- abort();
- }
-#endif
if((dso->meth->dso_unload != NULL) && !dso->meth->dso_unload(dso))
{
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);
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);
}
if(!to_return)
return 0;
}
-#ifdef REF_CHECK
- if(e->funct_ref < 0)
- {
- fprintf(stderr,"ENGINE_finish, bad functional reference count\n");
- abort();
- }
-#endif
+
/* Release the structural reference too */
if(!engine_free_util(e, 0))
{
i = --e->struct_ref;
engine_ref_debug(e, 0, -1)
if (i > 0) return 1;
-#ifdef REF_CHECK
- if (i < 0)
- {
- fprintf(stderr,"ENGINE_free, bad structural reference count\n");
- abort();
- }
-#endif
+
/* Free up any dynamically allocated public key methods */
engine_pkey_meths_free(e);
engine_pkey_asn1_meths_free(e);
return;
i = CRYPTO_add(&int_thread_hash_references, -1, CRYPTO_LOCK_ERR);
-
-#ifdef REF_PRINT
- fprintf(stderr,"%4d:%s\n",int_thread_hash_references,"ERR");
-#endif
if (i > 0) return;
-#ifdef REF_CHECK
- if (i < 0)
- {
- fprintf(stderr,"int_thread_release, bad reference count\n");
- abort(); /* ok */
- }
-#endif
+
*hash = NULL;
}
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);
if (x->attributes)
sk_X509_ATTRIBUTE_pop_free(x->attributes, X509_ATTRIBUTE_free);
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);
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);
}
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;
}
CRYPTO_add(&data->references,1,CRYPTO_LOCK_X509);
-#ifdef REF_PRINT
- REF_PRINT("X509",data);
-#endif
object->data.x509.certificate = data;
i = s->meth->store_object(s, STORE_OBJECT_TYPE_X509_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;
return 0;
}
CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY);
-#ifdef REF_PRINT
- REF_PRINT("EVP_PKEY",data);
-#endif
pkey = object->data.key;
STORE_OBJECT_free(object);
return pkey;
return 0;
}
CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY);
-#ifdef REF_PRINT
- REF_PRINT("EVP_PKEY",data);
-#endif
pkey = object->data.key;
STORE_OBJECT_free(object);
return pkey;
}
CRYPTO_add(&data->references,1,CRYPTO_LOCK_EVP_PKEY);
-#ifdef REF_PRINT
- REF_PRINT("EVP_PKEY",data);
-#endif
object->data.key = data;
i = s->meth->store_object(s, STORE_OBJECT_TYPE_PRIVATE_KEY, object,
return 0;
}
CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY);
-#ifdef REF_PRINT
- REF_PRINT("EVP_PKEY",data);
-#endif
pkey = object->data.key;
STORE_OBJECT_free(object);
return pkey;
return 0;
}
CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY);
-#ifdef REF_PRINT
- REF_PRINT("EVP_PKEY",data);
-#endif
pkey = object->data.key;
STORE_OBJECT_free(object);
return pkey;
}
CRYPTO_add(&data->references,1,CRYPTO_LOCK_EVP_PKEY);
-#ifdef REF_PRINT
- REF_PRINT("EVP_PKEY",data);
-#endif
object->data.key = data;
i = s->meth->store_object(s, STORE_OBJECT_TYPE_PUBLIC_KEY, object,
return 0;
}
CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY);
-#ifdef REF_PRINT
- REF_PRINT("EVP_PKEY",data);
-#endif
pkey = object->data.key;
STORE_OBJECT_free(object);
return pkey;
return 0;
}
CRYPTO_add(&object->data.crl->references,1,CRYPTO_LOCK_X509_CRL);
-#ifdef REF_PRINT
- REF_PRINT("X509_CRL",data);
-#endif
crl = object->data.crl;
STORE_OBJECT_free(object);
return crl;
return 0;
}
CRYPTO_add(&object->data.crl->references,1,CRYPTO_LOCK_X509_CRL);
-#ifdef REF_PRINT
- REF_PRINT("X509_CRL",data);
-#endif
crl = object->data.crl;
STORE_OBJECT_free(object);
return crl;
}
CRYPTO_add(&data->references,1,CRYPTO_LOCK_X509_CRL);
-#ifdef REF_PRINT
- REF_PRINT("X509_CRL",data);
-#endif
object->data.crl = data;
i = s->meth->store_object(s, STORE_OBJECT_TYPE_X509_CRL, object,
return 0;
}
CRYPTO_add(&object->data.crl->references,1,CRYPTO_LOCK_X509_CRL);
-#ifdef REF_PRINT
- REF_PRINT("X509_CRL",data);
-#endif
crl = object->data.crl;
STORE_OBJECT_free(object);
return crl;
extern "C" {
#endif
-/* Used to checking reference counts, most while doing perl5 stuff :-) */
-#ifdef REF_PRINT
-#undef REF_PRINT
-#define REF_PRINT(a,b) fprintf(stderr,"%08X:%4d:%s\n",(int)b,b->references,a)
-#endif
-
#define OPENSSL_CONF "openssl.cnf"
#define RFILE ".rnd"
return;
i = CRYPTO_add(&c->references, -1, CRYPTO_LOCK_SSL_CERT);
-#ifdef REF_PRINT
- REF_PRINT("CERT", c);
-#endif
if (i > 0)
return;
-#ifdef REF_CHECK
- if (i < 0) {
- fprintf(stderr, "ssl_cert_free, bad reference count\n");
- abort(); /* ok */
- }
-#endif
#ifndef OPENSSL_NO_RSA
if (c->rsa_tmp)
return;
i = CRYPTO_add(&sc->references, -1, CRYPTO_LOCK_SSL_SESS_CERT);
-#ifdef REF_PRINT
- REF_PRINT("SESS_CERT", sc);
-#endif
if (i > 0)
return;
-#ifdef REF_CHECK
- if (i < 0) {
- fprintf(stderr, "ssl_sess_cert_free, bad reference count\n");
- abort(); /* ok */
- }
-#endif
/* i == 0 */
if (sc->cert_chain != NULL)
* OTHERWISE.
*/
-#ifdef REF_CHECK
-# include <assert.h>
-#endif
#include <stdio.h>
#include "ssl_locl.h"
#include "kssl_lcl.h"
return;
i = CRYPTO_add(&s->references, -1, CRYPTO_LOCK_SSL);
-#ifdef REF_PRINT
- REF_PRINT("SSL", s);
-#endif
if (i > 0)
return;
-#ifdef REF_CHECK
- if (i < 0) {
- fprintf(stderr, "SSL_free, bad reference count\n");
- abort(); /* ok */
- }
-#endif
if (s->param)
X509_VERIFY_PARAM_free(s->param);
return;
i = CRYPTO_add(&a->references, -1, CRYPTO_LOCK_SSL_CTX);
-#ifdef REF_PRINT
- REF_PRINT("SSL_CTX", a);
-#endif
if (i > 0)
return;
-#ifdef REF_CHECK
- if (i < 0) {
- fprintf(stderr, "SSL_CTX_free, bad reference count\n");
- abort(); /* ok */
- }
-#endif
if (a->param)
X509_VERIFY_PARAM_free(a->param);
if (s->bbio == s->wbio) {
/* remove buffering */
s->wbio = BIO_pop(s->wbio);
-#ifdef REF_CHECK /* not the usual REF_CHECK, but this avoids adding one more preprocessor symbol */
- assert(s->wbio != NULL);
-#endif
}
BIO_free(s->bbio);
s->bbio = NULL;
return;
i = CRYPTO_add(&ss->references, -1, CRYPTO_LOCK_SSL_SESSION);
-#ifdef REF_PRINT
- REF_PRINT("SSL_SESSION", ss);
-#endif
if (i > 0)
return;
-#ifdef REF_CHECK
- if (i < 0) {
- fprintf(stderr, "SSL_SESSION_free, bad reference count\n");
- abort(); /* ok */
- }
-#endif
CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL_SESSION, ss, &ss->ex_data);
return;
i = CRYPTO_add(&c->references, -1, CRYPTO_LOCK_SSL_CERT);
-#ifdef REF_PRINT
- REF_PRINT("CERT", c);
-#endif
if (i > 0)
return;
-#ifdef REF_CHECK
- if (i < 0) {
- fprintf(stderr, "ssl_cert_free, bad reference count\n");
- abort(); /* ok */
- }
-#endif
#ifndef OPENSSL_NO_RSA
if (c->rsa_tmp)
return;
i = CRYPTO_add(&sc->references, -1, CRYPTO_LOCK_SSL_SESS_CERT);
-#ifdef REF_PRINT
- REF_PRINT("SESS_CERT", sc);
-#endif
if (i > 0)
return;
-#ifdef REF_CHECK
- if (i < 0) {
- fprintf(stderr, "ssl_sess_cert_free, bad reference count\n");
- abort(); /* ok */
- }
-#endif
/* i == 0 */
if (sc->cert_chain != NULL)
* OTHERWISE.
*/
-#ifdef REF_CHECK
-# include <assert.h>
-#endif
#include <stdio.h>
#include "ssl_locl.h"
#include "kssl_lcl.h"
return;
i = CRYPTO_add(&s->references, -1, CRYPTO_LOCK_SSL);
-#ifdef REF_PRINT
- REF_PRINT("SSL", s);
-#endif
if (i > 0)
return;
-#ifdef REF_CHECK
- if (i < 0) {
- fprintf(stderr, "SSL_free, bad reference count\n");
- abort(); /* ok */
- }
-#endif
if (s->param)
X509_VERIFY_PARAM_free(s->param);
return;
i = CRYPTO_add(&a->references, -1, CRYPTO_LOCK_SSL_CTX);
-#ifdef REF_PRINT
- REF_PRINT("SSL_CTX", a);
-#endif
if (i > 0)
return;
-#ifdef REF_CHECK
- if (i < 0) {
- fprintf(stderr, "SSL_CTX_free, bad reference count\n");
- abort(); /* ok */
- }
-#endif
if (a->param)
X509_VERIFY_PARAM_free(a->param);
if (s->bbio == s->wbio) {
/* remove buffering */
s->wbio = BIO_pop(s->wbio);
-#ifdef REF_CHECK /* not the usual REF_CHECK, but this avoids adding one more preprocessor symbol */
- assert(s->wbio != NULL);
-#endif
}
BIO_free(s->bbio);
s->bbio = NULL;
return;
i = CRYPTO_add(&ss->references, -1, CRYPTO_LOCK_SSL_SESSION);
-#ifdef REF_PRINT
- REF_PRINT("SSL_SESSION", ss);
-#endif
if (i > 0)
return;
-#ifdef REF_CHECK
- if (i < 0) {
- fprintf(stderr, "SSL_SESSION_free, bad reference count\n");
- abort(); /* ok */
- }
-#endif
CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL_SESSION, ss, &ss->ex_data);