diff options
37 files changed, 8 insertions, 526 deletions
diff --git a/src/lib/libcrypto/asn1/tasn_utl.c b/src/lib/libcrypto/asn1/tasn_utl.c index dfa63fb2bc..ab4989b6ce 100644 --- a/src/lib/libcrypto/asn1/tasn_utl.c +++ b/src/lib/libcrypto/asn1/tasn_utl.c | |||
@@ -115,13 +115,6 @@ int asn1_do_lock(ASN1_VALUE **pval, int op, const ASN1_ITEM *it) | |||
115 | return 1; | 115 | return 1; |
116 | } | 116 | } |
117 | ret = CRYPTO_add(lck, op, aux->ref_lock); | 117 | ret = CRYPTO_add(lck, op, aux->ref_lock); |
118 | #ifdef REF_PRINT | ||
119 | fprintf(stderr, "%s: Reference Count: %d\n", it->sname, *lck); | ||
120 | #endif | ||
121 | #ifdef REF_CHECK | ||
122 | if (ret < 0) | ||
123 | fprintf(stderr, "%s, bad reference count\n", it->sname); | ||
124 | #endif | ||
125 | return ret; | 118 | return ret; |
126 | } | 119 | } |
127 | 120 | ||
diff --git a/src/lib/libcrypto/asn1/x_info.c b/src/lib/libcrypto/asn1/x_info.c index c13fad056f..cb5b6634a1 100644 --- a/src/lib/libcrypto/asn1/x_info.c +++ b/src/lib/libcrypto/asn1/x_info.c | |||
@@ -91,17 +91,7 @@ void X509_INFO_free(X509_INFO *x) | |||
91 | if (x == NULL) return; | 91 | if (x == NULL) return; |
92 | 92 | ||
93 | i=CRYPTO_add(&x->references,-1,CRYPTO_LOCK_X509_INFO); | 93 | i=CRYPTO_add(&x->references,-1,CRYPTO_LOCK_X509_INFO); |
94 | #ifdef REF_PRINT | ||
95 | REF_PRINT("X509_INFO",x); | ||
96 | #endif | ||
97 | if (i > 0) return; | 94 | if (i > 0) return; |
98 | #ifdef REF_CHECK | ||
99 | if (i < 0) | ||
100 | { | ||
101 | fprintf(stderr,"X509_INFO_free, bad reference count\n"); | ||
102 | abort(); | ||
103 | } | ||
104 | #endif | ||
105 | 95 | ||
106 | if (x->x509 != NULL) X509_free(x->x509); | 96 | if (x->x509 != NULL) X509_free(x->x509); |
107 | if (x->crl != NULL) X509_CRL_free(x->crl); | 97 | if (x->crl != NULL) X509_CRL_free(x->crl); |
diff --git a/src/lib/libcrypto/asn1/x_pkey.c b/src/lib/libcrypto/asn1/x_pkey.c index 3bf2f5e915..c37f207e33 100644 --- a/src/lib/libcrypto/asn1/x_pkey.c +++ b/src/lib/libcrypto/asn1/x_pkey.c | |||
@@ -131,17 +131,7 @@ void X509_PKEY_free(X509_PKEY *x) | |||
131 | if (x == NULL) return; | 131 | if (x == NULL) return; |
132 | 132 | ||
133 | i=CRYPTO_add(&x->references,-1,CRYPTO_LOCK_X509_PKEY); | 133 | i=CRYPTO_add(&x->references,-1,CRYPTO_LOCK_X509_PKEY); |
134 | #ifdef REF_PRINT | ||
135 | REF_PRINT("X509_PKEY",x); | ||
136 | #endif | ||
137 | if (i > 0) return; | 134 | if (i > 0) return; |
138 | #ifdef REF_CHECK | ||
139 | if (i < 0) | ||
140 | { | ||
141 | fprintf(stderr,"X509_PKEY_free, bad reference count\n"); | ||
142 | abort(); | ||
143 | } | ||
144 | #endif | ||
145 | 135 | ||
146 | if (x->enc_algor != NULL) X509_ALGOR_free(x->enc_algor); | 136 | if (x->enc_algor != NULL) X509_ALGOR_free(x->enc_algor); |
147 | if (x->enc_pkey != NULL) M_ASN1_OCTET_STRING_free(x->enc_pkey); | 137 | if (x->enc_pkey != NULL) M_ASN1_OCTET_STRING_free(x->enc_pkey); |
diff --git a/src/lib/libcrypto/bio/bio_lib.c b/src/lib/libcrypto/bio/bio_lib.c index 485374931b..47ab0c8a45 100644 --- a/src/lib/libcrypto/bio/bio_lib.c +++ b/src/lib/libcrypto/bio/bio_lib.c | |||
@@ -116,17 +116,8 @@ BIO_free(BIO *a) | |||
116 | return (0); | 116 | return (0); |
117 | 117 | ||
118 | i = CRYPTO_add(&a->references, -1, CRYPTO_LOCK_BIO); | 118 | i = CRYPTO_add(&a->references, -1, CRYPTO_LOCK_BIO); |
119 | #ifdef REF_PRINT | ||
120 | REF_PRINT("BIO", a); | ||
121 | #endif | ||
122 | if (i > 0) | 119 | if (i > 0) |
123 | return (1); | 120 | return (1); |
124 | #ifdef REF_CHECK | ||
125 | if (i < 0) { | ||
126 | fprintf(stderr, "BIO_free, bad reference count\n"); | ||
127 | abort(); | ||
128 | } | ||
129 | #endif | ||
130 | if ((a->callback != NULL) && | 121 | if ((a->callback != NULL) && |
131 | ((i = (int)a->callback(a, BIO_CB_FREE, NULL, 0, 0L, 1L)) <= 0)) | 122 | ((i = (int)a->callback(a, BIO_CB_FREE, NULL, 0, 0L, 1L)) <= 0)) |
132 | return (i); | 123 | return (i); |
diff --git a/src/lib/libcrypto/cryptlib.c b/src/lib/libcrypto/cryptlib.c index ca583d59a9..1024dec09e 100644 --- a/src/lib/libcrypto/cryptlib.c +++ b/src/lib/libcrypto/cryptlib.c | |||
@@ -293,12 +293,6 @@ CRYPTO_destroy_dynlockid(int i) | |||
293 | pointer = sk_CRYPTO_dynlock_value(dyn_locks, i); | 293 | pointer = sk_CRYPTO_dynlock_value(dyn_locks, i); |
294 | if (pointer != NULL) { | 294 | if (pointer != NULL) { |
295 | --pointer->references; | 295 | --pointer->references; |
296 | #ifdef REF_CHECK | ||
297 | if (pointer->references < 0) { | ||
298 | fprintf(stderr, "CRYPTO_destroy_dynlockid, bad reference count\n"); | ||
299 | abort(); | ||
300 | } else | ||
301 | #endif | ||
302 | if (pointer->references <= 0) { | 296 | if (pointer->references <= 0) { |
303 | (void)sk_CRYPTO_dynlock_set(dyn_locks, i, NULL); | 297 | (void)sk_CRYPTO_dynlock_set(dyn_locks, i, NULL); |
304 | } else | 298 | } else |
diff --git a/src/lib/libcrypto/dh/dh_lib.c b/src/lib/libcrypto/dh/dh_lib.c index 4e3d25b7e5..e09c5fdd21 100644 --- a/src/lib/libcrypto/dh/dh_lib.c +++ b/src/lib/libcrypto/dh/dh_lib.c | |||
@@ -178,17 +178,7 @@ void DH_free(DH *r) | |||
178 | int i; | 178 | int i; |
179 | if(r == NULL) return; | 179 | if(r == NULL) return; |
180 | i = CRYPTO_add(&r->references, -1, CRYPTO_LOCK_DH); | 180 | i = CRYPTO_add(&r->references, -1, CRYPTO_LOCK_DH); |
181 | #ifdef REF_PRINT | ||
182 | REF_PRINT("DH",r); | ||
183 | #endif | ||
184 | if (i > 0) return; | 181 | if (i > 0) return; |
185 | #ifdef REF_CHECK | ||
186 | if (i < 0) | ||
187 | { | ||
188 | fprintf(stderr,"DH_free, bad reference count\n"); | ||
189 | abort(); | ||
190 | } | ||
191 | #endif | ||
192 | 182 | ||
193 | if (r->meth->finish) | 183 | if (r->meth->finish) |
194 | r->meth->finish(r); | 184 | r->meth->finish(r); |
@@ -213,16 +203,6 @@ void DH_free(DH *r) | |||
213 | int DH_up_ref(DH *r) | 203 | int DH_up_ref(DH *r) |
214 | { | 204 | { |
215 | int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_DH); | 205 | int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_DH); |
216 | #ifdef REF_PRINT | ||
217 | REF_PRINT("DH",r); | ||
218 | #endif | ||
219 | #ifdef REF_CHECK | ||
220 | if (i < 2) | ||
221 | { | ||
222 | fprintf(stderr, "DH_up, bad reference count\n"); | ||
223 | abort(); | ||
224 | } | ||
225 | #endif | ||
226 | return ((i > 1) ? 1 : 0); | 206 | return ((i > 1) ? 1 : 0); |
227 | } | 207 | } |
228 | 208 | ||
diff --git a/src/lib/libcrypto/dsa/dsa_lib.c b/src/lib/libcrypto/dsa/dsa_lib.c index 27a4c66618..7c7cd60883 100644 --- a/src/lib/libcrypto/dsa/dsa_lib.c +++ b/src/lib/libcrypto/dsa/dsa_lib.c | |||
@@ -188,17 +188,7 @@ void DSA_free(DSA *r) | |||
188 | if (r == NULL) return; | 188 | if (r == NULL) return; |
189 | 189 | ||
190 | i=CRYPTO_add(&r->references,-1,CRYPTO_LOCK_DSA); | 190 | i=CRYPTO_add(&r->references,-1,CRYPTO_LOCK_DSA); |
191 | #ifdef REF_PRINT | ||
192 | REF_PRINT("DSA",r); | ||
193 | #endif | ||
194 | if (i > 0) return; | 191 | if (i > 0) return; |
195 | #ifdef REF_CHECK | ||
196 | if (i < 0) | ||
197 | { | ||
198 | fprintf(stderr,"DSA_free, bad reference count\n"); | ||
199 | abort(); | ||
200 | } | ||
201 | #endif | ||
202 | 192 | ||
203 | if(r->meth->finish) | 193 | if(r->meth->finish) |
204 | r->meth->finish(r); | 194 | r->meth->finish(r); |
@@ -222,16 +212,6 @@ void DSA_free(DSA *r) | |||
222 | int DSA_up_ref(DSA *r) | 212 | int DSA_up_ref(DSA *r) |
223 | { | 213 | { |
224 | int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_DSA); | 214 | int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_DSA); |
225 | #ifdef REF_PRINT | ||
226 | REF_PRINT("DSA",r); | ||
227 | #endif | ||
228 | #ifdef REF_CHECK | ||
229 | if (i < 2) | ||
230 | { | ||
231 | fprintf(stderr, "DSA_up_ref, bad reference count\n"); | ||
232 | abort(); | ||
233 | } | ||
234 | #endif | ||
235 | return ((i > 1) ? 1 : 0); | 215 | return ((i > 1) ? 1 : 0); |
236 | } | 216 | } |
237 | 217 | ||
diff --git a/src/lib/libcrypto/dso/dso_lib.c b/src/lib/libcrypto/dso/dso_lib.c index 68f5430ea8..00e65938b9 100644 --- a/src/lib/libcrypto/dso/dso_lib.c +++ b/src/lib/libcrypto/dso/dso_lib.c | |||
@@ -139,17 +139,7 @@ int DSO_free(DSO *dso) | |||
139 | } | 139 | } |
140 | 140 | ||
141 | i=CRYPTO_add(&dso->references,-1,CRYPTO_LOCK_DSO); | 141 | i=CRYPTO_add(&dso->references,-1,CRYPTO_LOCK_DSO); |
142 | #ifdef REF_PRINT | ||
143 | REF_PRINT("DSO",dso); | ||
144 | #endif | ||
145 | if(i > 0) return(1); | 142 | if(i > 0) return(1); |
146 | #ifdef REF_CHECK | ||
147 | if(i < 0) | ||
148 | { | ||
149 | fprintf(stderr,"DSO_free, bad reference count\n"); | ||
150 | abort(); | ||
151 | } | ||
152 | #endif | ||
153 | 143 | ||
154 | if((dso->meth->dso_unload != NULL) && !dso->meth->dso_unload(dso)) | 144 | if((dso->meth->dso_unload != NULL) && !dso->meth->dso_unload(dso)) |
155 | { | 145 | { |
diff --git a/src/lib/libcrypto/ec/ec_key.c b/src/lib/libcrypto/ec/ec_key.c index 4375514ef5..4f0559591e 100644 --- a/src/lib/libcrypto/ec/ec_key.c +++ b/src/lib/libcrypto/ec/ec_key.c | |||
@@ -109,17 +109,7 @@ void EC_KEY_free(EC_KEY *r) | |||
109 | if (r == NULL) return; | 109 | if (r == NULL) return; |
110 | 110 | ||
111 | i=CRYPTO_add(&r->references,-1,CRYPTO_LOCK_EC); | 111 | i=CRYPTO_add(&r->references,-1,CRYPTO_LOCK_EC); |
112 | #ifdef REF_PRINT | ||
113 | REF_PRINT("EC_KEY",r); | ||
114 | #endif | ||
115 | if (i > 0) return; | 112 | if (i > 0) return; |
116 | #ifdef REF_CHECK | ||
117 | if (i < 0) | ||
118 | { | ||
119 | fprintf(stderr,"EC_KEY_free, bad reference count\n"); | ||
120 | abort(); | ||
121 | } | ||
122 | #endif | ||
123 | 113 | ||
124 | if (r->group != NULL) | 114 | if (r->group != NULL) |
125 | EC_GROUP_free(r->group); | 115 | EC_GROUP_free(r->group); |
@@ -218,16 +208,6 @@ EC_KEY *EC_KEY_dup(const EC_KEY *ec_key) | |||
218 | int EC_KEY_up_ref(EC_KEY *r) | 208 | int EC_KEY_up_ref(EC_KEY *r) |
219 | { | 209 | { |
220 | int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_EC); | 210 | int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_EC); |
221 | #ifdef REF_PRINT | ||
222 | REF_PRINT("EC_KEY",r); | ||
223 | #endif | ||
224 | #ifdef REF_CHECK | ||
225 | if (i < 2) | ||
226 | { | ||
227 | fprintf(stderr, "EC_KEY_up, bad reference count\n"); | ||
228 | abort(); | ||
229 | } | ||
230 | #endif | ||
231 | return ((i > 1) ? 1 : 0); | 211 | return ((i > 1) ? 1 : 0); |
232 | } | 212 | } |
233 | 213 | ||
diff --git a/src/lib/libcrypto/engine/eng_init.c b/src/lib/libcrypto/engine/eng_init.c index 7633cf5f1d..870c456668 100644 --- a/src/lib/libcrypto/engine/eng_init.c +++ b/src/lib/libcrypto/engine/eng_init.c | |||
@@ -101,13 +101,7 @@ int engine_unlocked_finish(ENGINE *e, int unlock_for_handlers) | |||
101 | if(!to_return) | 101 | if(!to_return) |
102 | return 0; | 102 | return 0; |
103 | } | 103 | } |
104 | #ifdef REF_CHECK | 104 | |
105 | if(e->funct_ref < 0) | ||
106 | { | ||
107 | fprintf(stderr,"ENGINE_finish, bad functional reference count\n"); | ||
108 | abort(); | ||
109 | } | ||
110 | #endif | ||
111 | /* Release the structural reference too */ | 105 | /* Release the structural reference too */ |
112 | if(!engine_free_util(e, 0)) | 106 | if(!engine_free_util(e, 0)) |
113 | { | 107 | { |
diff --git a/src/lib/libcrypto/engine/eng_lib.c b/src/lib/libcrypto/engine/eng_lib.c index 126bc02296..5ced58c86e 100644 --- a/src/lib/libcrypto/engine/eng_lib.c +++ b/src/lib/libcrypto/engine/eng_lib.c | |||
@@ -118,13 +118,7 @@ int engine_free_util(ENGINE *e, int locked) | |||
118 | i = --e->struct_ref; | 118 | i = --e->struct_ref; |
119 | engine_ref_debug(e, 0, -1) | 119 | engine_ref_debug(e, 0, -1) |
120 | if (i > 0) return 1; | 120 | if (i > 0) return 1; |
121 | #ifdef REF_CHECK | 121 | |
122 | if (i < 0) | ||
123 | { | ||
124 | fprintf(stderr,"ENGINE_free, bad structural reference count\n"); | ||
125 | abort(); | ||
126 | } | ||
127 | #endif | ||
128 | /* Free up any dynamically allocated public key methods */ | 122 | /* Free up any dynamically allocated public key methods */ |
129 | engine_pkey_meths_free(e); | 123 | engine_pkey_meths_free(e); |
130 | engine_pkey_asn1_meths_free(e); | 124 | engine_pkey_asn1_meths_free(e); |
diff --git a/src/lib/libcrypto/err/err.c b/src/lib/libcrypto/err/err.c index 93ed1da943..afc3130d08 100644 --- a/src/lib/libcrypto/err/err.c +++ b/src/lib/libcrypto/err/err.c | |||
@@ -467,18 +467,8 @@ static void int_thread_release(LHASH_OF(ERR_STATE) **hash) | |||
467 | return; | 467 | return; |
468 | 468 | ||
469 | i = CRYPTO_add(&int_thread_hash_references, -1, CRYPTO_LOCK_ERR); | 469 | i = CRYPTO_add(&int_thread_hash_references, -1, CRYPTO_LOCK_ERR); |
470 | |||
471 | #ifdef REF_PRINT | ||
472 | fprintf(stderr,"%4d:%s\n",int_thread_hash_references,"ERR"); | ||
473 | #endif | ||
474 | if (i > 0) return; | 470 | if (i > 0) return; |
475 | #ifdef REF_CHECK | 471 | |
476 | if (i < 0) | ||
477 | { | ||
478 | fprintf(stderr,"int_thread_release, bad reference count\n"); | ||
479 | abort(); /* ok */ | ||
480 | } | ||
481 | #endif | ||
482 | *hash = NULL; | 472 | *hash = NULL; |
483 | } | 473 | } |
484 | 474 | ||
diff --git a/src/lib/libcrypto/evp/p_lib.c b/src/lib/libcrypto/evp/p_lib.c index 7a9da3487a..5f5f5e328d 100644 --- a/src/lib/libcrypto/evp/p_lib.c +++ b/src/lib/libcrypto/evp/p_lib.c | |||
@@ -391,17 +391,8 @@ void EVP_PKEY_free(EVP_PKEY *x) | |||
391 | if (x == NULL) return; | 391 | if (x == NULL) return; |
392 | 392 | ||
393 | i=CRYPTO_add(&x->references,-1,CRYPTO_LOCK_EVP_PKEY); | 393 | i=CRYPTO_add(&x->references,-1,CRYPTO_LOCK_EVP_PKEY); |
394 | #ifdef REF_PRINT | ||
395 | REF_PRINT("EVP_PKEY",x); | ||
396 | #endif | ||
397 | if (i > 0) return; | 394 | if (i > 0) return; |
398 | #ifdef REF_CHECK | 395 | |
399 | if (i < 0) | ||
400 | { | ||
401 | fprintf(stderr,"EVP_PKEY_free, bad reference count\n"); | ||
402 | abort(); | ||
403 | } | ||
404 | #endif | ||
405 | EVP_PKEY_free_it(x); | 396 | EVP_PKEY_free_it(x); |
406 | if (x->attributes) | 397 | if (x->attributes) |
407 | sk_X509_ATTRIBUTE_pop_free(x->attributes, X509_ATTRIBUTE_free); | 398 | sk_X509_ATTRIBUTE_pop_free(x->attributes, X509_ATTRIBUTE_free); |
diff --git a/src/lib/libcrypto/rsa/rsa_lib.c b/src/lib/libcrypto/rsa/rsa_lib.c index e99a3627dc..a618d70f92 100644 --- a/src/lib/libcrypto/rsa/rsa_lib.c +++ b/src/lib/libcrypto/rsa/rsa_lib.c | |||
@@ -208,17 +208,7 @@ void RSA_free(RSA *r) | |||
208 | if (r == NULL) return; | 208 | if (r == NULL) return; |
209 | 209 | ||
210 | i=CRYPTO_add(&r->references,-1,CRYPTO_LOCK_RSA); | 210 | i=CRYPTO_add(&r->references,-1,CRYPTO_LOCK_RSA); |
211 | #ifdef REF_PRINT | ||
212 | REF_PRINT("RSA",r); | ||
213 | #endif | ||
214 | if (i > 0) return; | 211 | if (i > 0) return; |
215 | #ifdef REF_CHECK | ||
216 | if (i < 0) | ||
217 | { | ||
218 | fprintf(stderr,"RSA_free, bad reference count\n"); | ||
219 | abort(); | ||
220 | } | ||
221 | #endif | ||
222 | 212 | ||
223 | if (r->meth->finish) | 213 | if (r->meth->finish) |
224 | r->meth->finish(r); | 214 | r->meth->finish(r); |
@@ -246,16 +236,6 @@ void RSA_free(RSA *r) | |||
246 | int RSA_up_ref(RSA *r) | 236 | int RSA_up_ref(RSA *r) |
247 | { | 237 | { |
248 | int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_RSA); | 238 | int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_RSA); |
249 | #ifdef REF_PRINT | ||
250 | REF_PRINT("RSA",r); | ||
251 | #endif | ||
252 | #ifdef REF_CHECK | ||
253 | if (i < 2) | ||
254 | { | ||
255 | fprintf(stderr, "RSA_up_ref, bad reference count\n"); | ||
256 | abort(); | ||
257 | } | ||
258 | #endif | ||
259 | return ((i > 1) ? 1 : 0); | 239 | return ((i > 1) ? 1 : 0); |
260 | } | 240 | } |
261 | 241 | ||
diff --git a/src/lib/libcrypto/store/str_lib.c b/src/lib/libcrypto/store/str_lib.c index a451e9cb74..197f19e769 100644 --- a/src/lib/libcrypto/store/str_lib.c +++ b/src/lib/libcrypto/store/str_lib.c | |||
@@ -269,9 +269,6 @@ X509 *STORE_get_certificate(STORE *s, OPENSSL_ITEM attributes[], | |||
269 | return 0; | 269 | return 0; |
270 | } | 270 | } |
271 | CRYPTO_add(&object->data.x509.certificate->references,1,CRYPTO_LOCK_X509); | 271 | CRYPTO_add(&object->data.x509.certificate->references,1,CRYPTO_LOCK_X509); |
272 | #ifdef REF_PRINT | ||
273 | REF_PRINT("X509",data); | ||
274 | #endif | ||
275 | x = object->data.x509.certificate; | 272 | x = object->data.x509.certificate; |
276 | STORE_OBJECT_free(object); | 273 | STORE_OBJECT_free(object); |
277 | return x; | 274 | return x; |
@@ -295,9 +292,6 @@ int STORE_store_certificate(STORE *s, X509 *data, OPENSSL_ITEM attributes[], | |||
295 | } | 292 | } |
296 | 293 | ||
297 | CRYPTO_add(&data->references,1,CRYPTO_LOCK_X509); | 294 | CRYPTO_add(&data->references,1,CRYPTO_LOCK_X509); |
298 | #ifdef REF_PRINT | ||
299 | REF_PRINT("X509",data); | ||
300 | #endif | ||
301 | object->data.x509.certificate = data; | 295 | object->data.x509.certificate = data; |
302 | 296 | ||
303 | i = s->meth->store_object(s, STORE_OBJECT_TYPE_X509_CERTIFICATE, | 297 | i = s->meth->store_object(s, STORE_OBJECT_TYPE_X509_CERTIFICATE, |
@@ -399,9 +393,6 @@ X509 *STORE_list_certificate_next(STORE *s, void *handle) | |||
399 | return 0; | 393 | return 0; |
400 | } | 394 | } |
401 | CRYPTO_add(&object->data.x509.certificate->references,1,CRYPTO_LOCK_X509); | 395 | CRYPTO_add(&object->data.x509.certificate->references,1,CRYPTO_LOCK_X509); |
402 | #ifdef REF_PRINT | ||
403 | REF_PRINT("X509",data); | ||
404 | #endif | ||
405 | x = object->data.x509.certificate; | 396 | x = object->data.x509.certificate; |
406 | STORE_OBJECT_free(object); | 397 | STORE_OBJECT_free(object); |
407 | return x; | 398 | return x; |
@@ -453,9 +444,6 @@ EVP_PKEY *STORE_generate_key(STORE *s, OPENSSL_ITEM attributes[], | |||
453 | return 0; | 444 | return 0; |
454 | } | 445 | } |
455 | CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY); | 446 | CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY); |
456 | #ifdef REF_PRINT | ||
457 | REF_PRINT("EVP_PKEY",data); | ||
458 | #endif | ||
459 | pkey = object->data.key; | 447 | pkey = object->data.key; |
460 | STORE_OBJECT_free(object); | 448 | STORE_OBJECT_free(object); |
461 | return pkey; | 449 | return pkey; |
@@ -479,9 +467,6 @@ EVP_PKEY *STORE_get_private_key(STORE *s, OPENSSL_ITEM attributes[], | |||
479 | return 0; | 467 | return 0; |
480 | } | 468 | } |
481 | CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY); | 469 | CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY); |
482 | #ifdef REF_PRINT | ||
483 | REF_PRINT("EVP_PKEY",data); | ||
484 | #endif | ||
485 | pkey = object->data.key; | 470 | pkey = object->data.key; |
486 | STORE_OBJECT_free(object); | 471 | STORE_OBJECT_free(object); |
487 | return pkey; | 472 | return pkey; |
@@ -512,9 +497,6 @@ int STORE_store_private_key(STORE *s, EVP_PKEY *data, OPENSSL_ITEM attributes[], | |||
512 | } | 497 | } |
513 | 498 | ||
514 | CRYPTO_add(&data->references,1,CRYPTO_LOCK_EVP_PKEY); | 499 | CRYPTO_add(&data->references,1,CRYPTO_LOCK_EVP_PKEY); |
515 | #ifdef REF_PRINT | ||
516 | REF_PRINT("EVP_PKEY",data); | ||
517 | #endif | ||
518 | object->data.key = data; | 500 | object->data.key = data; |
519 | 501 | ||
520 | i = s->meth->store_object(s, STORE_OBJECT_TYPE_PRIVATE_KEY, object, | 502 | i = s->meth->store_object(s, STORE_OBJECT_TYPE_PRIVATE_KEY, object, |
@@ -620,9 +602,6 @@ EVP_PKEY *STORE_list_private_key_next(STORE *s, void *handle) | |||
620 | return 0; | 602 | return 0; |
621 | } | 603 | } |
622 | CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY); | 604 | CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY); |
623 | #ifdef REF_PRINT | ||
624 | REF_PRINT("EVP_PKEY",data); | ||
625 | #endif | ||
626 | pkey = object->data.key; | 605 | pkey = object->data.key; |
627 | STORE_OBJECT_free(object); | 606 | STORE_OBJECT_free(object); |
628 | return pkey; | 607 | return pkey; |
@@ -674,9 +653,6 @@ EVP_PKEY *STORE_get_public_key(STORE *s, OPENSSL_ITEM attributes[], | |||
674 | return 0; | 653 | return 0; |
675 | } | 654 | } |
676 | CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY); | 655 | CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY); |
677 | #ifdef REF_PRINT | ||
678 | REF_PRINT("EVP_PKEY",data); | ||
679 | #endif | ||
680 | pkey = object->data.key; | 656 | pkey = object->data.key; |
681 | STORE_OBJECT_free(object); | 657 | STORE_OBJECT_free(object); |
682 | return pkey; | 658 | return pkey; |
@@ -707,9 +683,6 @@ int STORE_store_public_key(STORE *s, EVP_PKEY *data, OPENSSL_ITEM attributes[], | |||
707 | } | 683 | } |
708 | 684 | ||
709 | CRYPTO_add(&data->references,1,CRYPTO_LOCK_EVP_PKEY); | 685 | CRYPTO_add(&data->references,1,CRYPTO_LOCK_EVP_PKEY); |
710 | #ifdef REF_PRINT | ||
711 | REF_PRINT("EVP_PKEY",data); | ||
712 | #endif | ||
713 | object->data.key = data; | 686 | object->data.key = data; |
714 | 687 | ||
715 | i = s->meth->store_object(s, STORE_OBJECT_TYPE_PUBLIC_KEY, object, | 688 | i = s->meth->store_object(s, STORE_OBJECT_TYPE_PUBLIC_KEY, object, |
@@ -815,9 +788,6 @@ EVP_PKEY *STORE_list_public_key_next(STORE *s, void *handle) | |||
815 | return 0; | 788 | return 0; |
816 | } | 789 | } |
817 | CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY); | 790 | CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY); |
818 | #ifdef REF_PRINT | ||
819 | REF_PRINT("EVP_PKEY",data); | ||
820 | #endif | ||
821 | pkey = object->data.key; | 791 | pkey = object->data.key; |
822 | STORE_OBJECT_free(object); | 792 | STORE_OBJECT_free(object); |
823 | return pkey; | 793 | return pkey; |
@@ -869,9 +839,6 @@ X509_CRL *STORE_generate_crl(STORE *s, OPENSSL_ITEM attributes[], | |||
869 | return 0; | 839 | return 0; |
870 | } | 840 | } |
871 | CRYPTO_add(&object->data.crl->references,1,CRYPTO_LOCK_X509_CRL); | 841 | CRYPTO_add(&object->data.crl->references,1,CRYPTO_LOCK_X509_CRL); |
872 | #ifdef REF_PRINT | ||
873 | REF_PRINT("X509_CRL",data); | ||
874 | #endif | ||
875 | crl = object->data.crl; | 842 | crl = object->data.crl; |
876 | STORE_OBJECT_free(object); | 843 | STORE_OBJECT_free(object); |
877 | return crl; | 844 | return crl; |
@@ -895,9 +862,6 @@ X509_CRL *STORE_get_crl(STORE *s, OPENSSL_ITEM attributes[], | |||
895 | return 0; | 862 | return 0; |
896 | } | 863 | } |
897 | CRYPTO_add(&object->data.crl->references,1,CRYPTO_LOCK_X509_CRL); | 864 | CRYPTO_add(&object->data.crl->references,1,CRYPTO_LOCK_X509_CRL); |
898 | #ifdef REF_PRINT | ||
899 | REF_PRINT("X509_CRL",data); | ||
900 | #endif | ||
901 | crl = object->data.crl; | 865 | crl = object->data.crl; |
902 | STORE_OBJECT_free(object); | 866 | STORE_OBJECT_free(object); |
903 | return crl; | 867 | return crl; |
@@ -921,9 +885,6 @@ int STORE_store_crl(STORE *s, X509_CRL *data, OPENSSL_ITEM attributes[], | |||
921 | } | 885 | } |
922 | 886 | ||
923 | CRYPTO_add(&data->references,1,CRYPTO_LOCK_X509_CRL); | 887 | CRYPTO_add(&data->references,1,CRYPTO_LOCK_X509_CRL); |
924 | #ifdef REF_PRINT | ||
925 | REF_PRINT("X509_CRL",data); | ||
926 | #endif | ||
927 | object->data.crl = data; | 888 | object->data.crl = data; |
928 | 889 | ||
929 | i = s->meth->store_object(s, STORE_OBJECT_TYPE_X509_CRL, object, | 890 | i = s->meth->store_object(s, STORE_OBJECT_TYPE_X509_CRL, object, |
@@ -1009,9 +970,6 @@ X509_CRL *STORE_list_crl_next(STORE *s, void *handle) | |||
1009 | return 0; | 970 | return 0; |
1010 | } | 971 | } |
1011 | CRYPTO_add(&object->data.crl->references,1,CRYPTO_LOCK_X509_CRL); | 972 | CRYPTO_add(&object->data.crl->references,1,CRYPTO_LOCK_X509_CRL); |
1012 | #ifdef REF_PRINT | ||
1013 | REF_PRINT("X509_CRL",data); | ||
1014 | #endif | ||
1015 | crl = object->data.crl; | 973 | crl = object->data.crl; |
1016 | STORE_OBJECT_free(object); | 974 | STORE_OBJECT_free(object); |
1017 | return crl; | 975 | return crl; |
diff --git a/src/lib/libssl/src/crypto/asn1/tasn_utl.c b/src/lib/libssl/src/crypto/asn1/tasn_utl.c index dfa63fb2bc..ab4989b6ce 100644 --- a/src/lib/libssl/src/crypto/asn1/tasn_utl.c +++ b/src/lib/libssl/src/crypto/asn1/tasn_utl.c | |||
@@ -115,13 +115,6 @@ int asn1_do_lock(ASN1_VALUE **pval, int op, const ASN1_ITEM *it) | |||
115 | return 1; | 115 | return 1; |
116 | } | 116 | } |
117 | ret = CRYPTO_add(lck, op, aux->ref_lock); | 117 | ret = CRYPTO_add(lck, op, aux->ref_lock); |
118 | #ifdef REF_PRINT | ||
119 | fprintf(stderr, "%s: Reference Count: %d\n", it->sname, *lck); | ||
120 | #endif | ||
121 | #ifdef REF_CHECK | ||
122 | if (ret < 0) | ||
123 | fprintf(stderr, "%s, bad reference count\n", it->sname); | ||
124 | #endif | ||
125 | return ret; | 118 | return ret; |
126 | } | 119 | } |
127 | 120 | ||
diff --git a/src/lib/libssl/src/crypto/asn1/x_info.c b/src/lib/libssl/src/crypto/asn1/x_info.c index c13fad056f..cb5b6634a1 100644 --- a/src/lib/libssl/src/crypto/asn1/x_info.c +++ b/src/lib/libssl/src/crypto/asn1/x_info.c | |||
@@ -91,17 +91,7 @@ void X509_INFO_free(X509_INFO *x) | |||
91 | if (x == NULL) return; | 91 | if (x == NULL) return; |
92 | 92 | ||
93 | i=CRYPTO_add(&x->references,-1,CRYPTO_LOCK_X509_INFO); | 93 | i=CRYPTO_add(&x->references,-1,CRYPTO_LOCK_X509_INFO); |
94 | #ifdef REF_PRINT | ||
95 | REF_PRINT("X509_INFO",x); | ||
96 | #endif | ||
97 | if (i > 0) return; | 94 | if (i > 0) return; |
98 | #ifdef REF_CHECK | ||
99 | if (i < 0) | ||
100 | { | ||
101 | fprintf(stderr,"X509_INFO_free, bad reference count\n"); | ||
102 | abort(); | ||
103 | } | ||
104 | #endif | ||
105 | 95 | ||
106 | if (x->x509 != NULL) X509_free(x->x509); | 96 | if (x->x509 != NULL) X509_free(x->x509); |
107 | if (x->crl != NULL) X509_CRL_free(x->crl); | 97 | if (x->crl != NULL) X509_CRL_free(x->crl); |
diff --git a/src/lib/libssl/src/crypto/asn1/x_pkey.c b/src/lib/libssl/src/crypto/asn1/x_pkey.c index 3bf2f5e915..c37f207e33 100644 --- a/src/lib/libssl/src/crypto/asn1/x_pkey.c +++ b/src/lib/libssl/src/crypto/asn1/x_pkey.c | |||
@@ -131,17 +131,7 @@ void X509_PKEY_free(X509_PKEY *x) | |||
131 | if (x == NULL) return; | 131 | if (x == NULL) return; |
132 | 132 | ||
133 | i=CRYPTO_add(&x->references,-1,CRYPTO_LOCK_X509_PKEY); | 133 | i=CRYPTO_add(&x->references,-1,CRYPTO_LOCK_X509_PKEY); |
134 | #ifdef REF_PRINT | ||
135 | REF_PRINT("X509_PKEY",x); | ||
136 | #endif | ||
137 | if (i > 0) return; | 134 | if (i > 0) return; |
138 | #ifdef REF_CHECK | ||
139 | if (i < 0) | ||
140 | { | ||
141 | fprintf(stderr,"X509_PKEY_free, bad reference count\n"); | ||
142 | abort(); | ||
143 | } | ||
144 | #endif | ||
145 | 135 | ||
146 | if (x->enc_algor != NULL) X509_ALGOR_free(x->enc_algor); | 136 | if (x->enc_algor != NULL) X509_ALGOR_free(x->enc_algor); |
147 | if (x->enc_pkey != NULL) M_ASN1_OCTET_STRING_free(x->enc_pkey); | 137 | if (x->enc_pkey != NULL) M_ASN1_OCTET_STRING_free(x->enc_pkey); |
diff --git a/src/lib/libssl/src/crypto/bio/bio_lib.c b/src/lib/libssl/src/crypto/bio/bio_lib.c index 485374931b..47ab0c8a45 100644 --- a/src/lib/libssl/src/crypto/bio/bio_lib.c +++ b/src/lib/libssl/src/crypto/bio/bio_lib.c | |||
@@ -116,17 +116,8 @@ BIO_free(BIO *a) | |||
116 | return (0); | 116 | return (0); |
117 | 117 | ||
118 | i = CRYPTO_add(&a->references, -1, CRYPTO_LOCK_BIO); | 118 | i = CRYPTO_add(&a->references, -1, CRYPTO_LOCK_BIO); |
119 | #ifdef REF_PRINT | ||
120 | REF_PRINT("BIO", a); | ||
121 | #endif | ||
122 | if (i > 0) | 119 | if (i > 0) |
123 | return (1); | 120 | return (1); |
124 | #ifdef REF_CHECK | ||
125 | if (i < 0) { | ||
126 | fprintf(stderr, "BIO_free, bad reference count\n"); | ||
127 | abort(); | ||
128 | } | ||
129 | #endif | ||
130 | if ((a->callback != NULL) && | 121 | if ((a->callback != NULL) && |
131 | ((i = (int)a->callback(a, BIO_CB_FREE, NULL, 0, 0L, 1L)) <= 0)) | 122 | ((i = (int)a->callback(a, BIO_CB_FREE, NULL, 0, 0L, 1L)) <= 0)) |
132 | return (i); | 123 | return (i); |
diff --git a/src/lib/libssl/src/crypto/cryptlib.c b/src/lib/libssl/src/crypto/cryptlib.c index ca583d59a9..1024dec09e 100644 --- a/src/lib/libssl/src/crypto/cryptlib.c +++ b/src/lib/libssl/src/crypto/cryptlib.c | |||
@@ -293,12 +293,6 @@ CRYPTO_destroy_dynlockid(int i) | |||
293 | pointer = sk_CRYPTO_dynlock_value(dyn_locks, i); | 293 | pointer = sk_CRYPTO_dynlock_value(dyn_locks, i); |
294 | if (pointer != NULL) { | 294 | if (pointer != NULL) { |
295 | --pointer->references; | 295 | --pointer->references; |
296 | #ifdef REF_CHECK | ||
297 | if (pointer->references < 0) { | ||
298 | fprintf(stderr, "CRYPTO_destroy_dynlockid, bad reference count\n"); | ||
299 | abort(); | ||
300 | } else | ||
301 | #endif | ||
302 | if (pointer->references <= 0) { | 296 | if (pointer->references <= 0) { |
303 | (void)sk_CRYPTO_dynlock_set(dyn_locks, i, NULL); | 297 | (void)sk_CRYPTO_dynlock_set(dyn_locks, i, NULL); |
304 | } else | 298 | } else |
diff --git a/src/lib/libssl/src/crypto/dh/dh_lib.c b/src/lib/libssl/src/crypto/dh/dh_lib.c index 4e3d25b7e5..e09c5fdd21 100644 --- a/src/lib/libssl/src/crypto/dh/dh_lib.c +++ b/src/lib/libssl/src/crypto/dh/dh_lib.c | |||
@@ -178,17 +178,7 @@ void DH_free(DH *r) | |||
178 | int i; | 178 | int i; |
179 | if(r == NULL) return; | 179 | if(r == NULL) return; |
180 | i = CRYPTO_add(&r->references, -1, CRYPTO_LOCK_DH); | 180 | i = CRYPTO_add(&r->references, -1, CRYPTO_LOCK_DH); |
181 | #ifdef REF_PRINT | ||
182 | REF_PRINT("DH",r); | ||
183 | #endif | ||
184 | if (i > 0) return; | 181 | if (i > 0) return; |
185 | #ifdef REF_CHECK | ||
186 | if (i < 0) | ||
187 | { | ||
188 | fprintf(stderr,"DH_free, bad reference count\n"); | ||
189 | abort(); | ||
190 | } | ||
191 | #endif | ||
192 | 182 | ||
193 | if (r->meth->finish) | 183 | if (r->meth->finish) |
194 | r->meth->finish(r); | 184 | r->meth->finish(r); |
@@ -213,16 +203,6 @@ void DH_free(DH *r) | |||
213 | int DH_up_ref(DH *r) | 203 | int DH_up_ref(DH *r) |
214 | { | 204 | { |
215 | int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_DH); | 205 | int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_DH); |
216 | #ifdef REF_PRINT | ||
217 | REF_PRINT("DH",r); | ||
218 | #endif | ||
219 | #ifdef REF_CHECK | ||
220 | if (i < 2) | ||
221 | { | ||
222 | fprintf(stderr, "DH_up, bad reference count\n"); | ||
223 | abort(); | ||
224 | } | ||
225 | #endif | ||
226 | return ((i > 1) ? 1 : 0); | 206 | return ((i > 1) ? 1 : 0); |
227 | } | 207 | } |
228 | 208 | ||
diff --git a/src/lib/libssl/src/crypto/dsa/dsa_lib.c b/src/lib/libssl/src/crypto/dsa/dsa_lib.c index 27a4c66618..7c7cd60883 100644 --- a/src/lib/libssl/src/crypto/dsa/dsa_lib.c +++ b/src/lib/libssl/src/crypto/dsa/dsa_lib.c | |||
@@ -188,17 +188,7 @@ void DSA_free(DSA *r) | |||
188 | if (r == NULL) return; | 188 | if (r == NULL) return; |
189 | 189 | ||
190 | i=CRYPTO_add(&r->references,-1,CRYPTO_LOCK_DSA); | 190 | i=CRYPTO_add(&r->references,-1,CRYPTO_LOCK_DSA); |
191 | #ifdef REF_PRINT | ||
192 | REF_PRINT("DSA",r); | ||
193 | #endif | ||
194 | if (i > 0) return; | 191 | if (i > 0) return; |
195 | #ifdef REF_CHECK | ||
196 | if (i < 0) | ||
197 | { | ||
198 | fprintf(stderr,"DSA_free, bad reference count\n"); | ||
199 | abort(); | ||
200 | } | ||
201 | #endif | ||
202 | 192 | ||
203 | if(r->meth->finish) | 193 | if(r->meth->finish) |
204 | r->meth->finish(r); | 194 | r->meth->finish(r); |
@@ -222,16 +212,6 @@ void DSA_free(DSA *r) | |||
222 | int DSA_up_ref(DSA *r) | 212 | int DSA_up_ref(DSA *r) |
223 | { | 213 | { |
224 | int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_DSA); | 214 | int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_DSA); |
225 | #ifdef REF_PRINT | ||
226 | REF_PRINT("DSA",r); | ||
227 | #endif | ||
228 | #ifdef REF_CHECK | ||
229 | if (i < 2) | ||
230 | { | ||
231 | fprintf(stderr, "DSA_up_ref, bad reference count\n"); | ||
232 | abort(); | ||
233 | } | ||
234 | #endif | ||
235 | return ((i > 1) ? 1 : 0); | 215 | return ((i > 1) ? 1 : 0); |
236 | } | 216 | } |
237 | 217 | ||
diff --git a/src/lib/libssl/src/crypto/dso/dso_lib.c b/src/lib/libssl/src/crypto/dso/dso_lib.c index 68f5430ea8..00e65938b9 100644 --- a/src/lib/libssl/src/crypto/dso/dso_lib.c +++ b/src/lib/libssl/src/crypto/dso/dso_lib.c | |||
@@ -139,17 +139,7 @@ int DSO_free(DSO *dso) | |||
139 | } | 139 | } |
140 | 140 | ||
141 | i=CRYPTO_add(&dso->references,-1,CRYPTO_LOCK_DSO); | 141 | i=CRYPTO_add(&dso->references,-1,CRYPTO_LOCK_DSO); |
142 | #ifdef REF_PRINT | ||
143 | REF_PRINT("DSO",dso); | ||
144 | #endif | ||
145 | if(i > 0) return(1); | 142 | if(i > 0) return(1); |
146 | #ifdef REF_CHECK | ||
147 | if(i < 0) | ||
148 | { | ||
149 | fprintf(stderr,"DSO_free, bad reference count\n"); | ||
150 | abort(); | ||
151 | } | ||
152 | #endif | ||
153 | 143 | ||
154 | if((dso->meth->dso_unload != NULL) && !dso->meth->dso_unload(dso)) | 144 | if((dso->meth->dso_unload != NULL) && !dso->meth->dso_unload(dso)) |
155 | { | 145 | { |
diff --git a/src/lib/libssl/src/crypto/ec/ec_key.c b/src/lib/libssl/src/crypto/ec/ec_key.c index 4375514ef5..4f0559591e 100644 --- a/src/lib/libssl/src/crypto/ec/ec_key.c +++ b/src/lib/libssl/src/crypto/ec/ec_key.c | |||
@@ -109,17 +109,7 @@ void EC_KEY_free(EC_KEY *r) | |||
109 | if (r == NULL) return; | 109 | if (r == NULL) return; |
110 | 110 | ||
111 | i=CRYPTO_add(&r->references,-1,CRYPTO_LOCK_EC); | 111 | i=CRYPTO_add(&r->references,-1,CRYPTO_LOCK_EC); |
112 | #ifdef REF_PRINT | ||
113 | REF_PRINT("EC_KEY",r); | ||
114 | #endif | ||
115 | if (i > 0) return; | 112 | if (i > 0) return; |
116 | #ifdef REF_CHECK | ||
117 | if (i < 0) | ||
118 | { | ||
119 | fprintf(stderr,"EC_KEY_free, bad reference count\n"); | ||
120 | abort(); | ||
121 | } | ||
122 | #endif | ||
123 | 113 | ||
124 | if (r->group != NULL) | 114 | if (r->group != NULL) |
125 | EC_GROUP_free(r->group); | 115 | EC_GROUP_free(r->group); |
@@ -218,16 +208,6 @@ EC_KEY *EC_KEY_dup(const EC_KEY *ec_key) | |||
218 | int EC_KEY_up_ref(EC_KEY *r) | 208 | int EC_KEY_up_ref(EC_KEY *r) |
219 | { | 209 | { |
220 | int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_EC); | 210 | int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_EC); |
221 | #ifdef REF_PRINT | ||
222 | REF_PRINT("EC_KEY",r); | ||
223 | #endif | ||
224 | #ifdef REF_CHECK | ||
225 | if (i < 2) | ||
226 | { | ||
227 | fprintf(stderr, "EC_KEY_up, bad reference count\n"); | ||
228 | abort(); | ||
229 | } | ||
230 | #endif | ||
231 | return ((i > 1) ? 1 : 0); | 211 | return ((i > 1) ? 1 : 0); |
232 | } | 212 | } |
233 | 213 | ||
diff --git a/src/lib/libssl/src/crypto/engine/eng_init.c b/src/lib/libssl/src/crypto/engine/eng_init.c index 7633cf5f1d..870c456668 100644 --- a/src/lib/libssl/src/crypto/engine/eng_init.c +++ b/src/lib/libssl/src/crypto/engine/eng_init.c | |||
@@ -101,13 +101,7 @@ int engine_unlocked_finish(ENGINE *e, int unlock_for_handlers) | |||
101 | if(!to_return) | 101 | if(!to_return) |
102 | return 0; | 102 | return 0; |
103 | } | 103 | } |
104 | #ifdef REF_CHECK | 104 | |
105 | if(e->funct_ref < 0) | ||
106 | { | ||
107 | fprintf(stderr,"ENGINE_finish, bad functional reference count\n"); | ||
108 | abort(); | ||
109 | } | ||
110 | #endif | ||
111 | /* Release the structural reference too */ | 105 | /* Release the structural reference too */ |
112 | if(!engine_free_util(e, 0)) | 106 | if(!engine_free_util(e, 0)) |
113 | { | 107 | { |
diff --git a/src/lib/libssl/src/crypto/engine/eng_lib.c b/src/lib/libssl/src/crypto/engine/eng_lib.c index 126bc02296..5ced58c86e 100644 --- a/src/lib/libssl/src/crypto/engine/eng_lib.c +++ b/src/lib/libssl/src/crypto/engine/eng_lib.c | |||
@@ -118,13 +118,7 @@ int engine_free_util(ENGINE *e, int locked) | |||
118 | i = --e->struct_ref; | 118 | i = --e->struct_ref; |
119 | engine_ref_debug(e, 0, -1) | 119 | engine_ref_debug(e, 0, -1) |
120 | if (i > 0) return 1; | 120 | if (i > 0) return 1; |
121 | #ifdef REF_CHECK | 121 | |
122 | if (i < 0) | ||
123 | { | ||
124 | fprintf(stderr,"ENGINE_free, bad structural reference count\n"); | ||
125 | abort(); | ||
126 | } | ||
127 | #endif | ||
128 | /* Free up any dynamically allocated public key methods */ | 122 | /* Free up any dynamically allocated public key methods */ |
129 | engine_pkey_meths_free(e); | 123 | engine_pkey_meths_free(e); |
130 | engine_pkey_asn1_meths_free(e); | 124 | engine_pkey_asn1_meths_free(e); |
diff --git a/src/lib/libssl/src/crypto/err/err.c b/src/lib/libssl/src/crypto/err/err.c index 93ed1da943..afc3130d08 100644 --- a/src/lib/libssl/src/crypto/err/err.c +++ b/src/lib/libssl/src/crypto/err/err.c | |||
@@ -467,18 +467,8 @@ static void int_thread_release(LHASH_OF(ERR_STATE) **hash) | |||
467 | return; | 467 | return; |
468 | 468 | ||
469 | i = CRYPTO_add(&int_thread_hash_references, -1, CRYPTO_LOCK_ERR); | 469 | i = CRYPTO_add(&int_thread_hash_references, -1, CRYPTO_LOCK_ERR); |
470 | |||
471 | #ifdef REF_PRINT | ||
472 | fprintf(stderr,"%4d:%s\n",int_thread_hash_references,"ERR"); | ||
473 | #endif | ||
474 | if (i > 0) return; | 470 | if (i > 0) return; |
475 | #ifdef REF_CHECK | 471 | |
476 | if (i < 0) | ||
477 | { | ||
478 | fprintf(stderr,"int_thread_release, bad reference count\n"); | ||
479 | abort(); /* ok */ | ||
480 | } | ||
481 | #endif | ||
482 | *hash = NULL; | 472 | *hash = NULL; |
483 | } | 473 | } |
484 | 474 | ||
diff --git a/src/lib/libssl/src/crypto/evp/p_lib.c b/src/lib/libssl/src/crypto/evp/p_lib.c index 7a9da3487a..5f5f5e328d 100644 --- a/src/lib/libssl/src/crypto/evp/p_lib.c +++ b/src/lib/libssl/src/crypto/evp/p_lib.c | |||
@@ -391,17 +391,8 @@ void EVP_PKEY_free(EVP_PKEY *x) | |||
391 | if (x == NULL) return; | 391 | if (x == NULL) return; |
392 | 392 | ||
393 | i=CRYPTO_add(&x->references,-1,CRYPTO_LOCK_EVP_PKEY); | 393 | i=CRYPTO_add(&x->references,-1,CRYPTO_LOCK_EVP_PKEY); |
394 | #ifdef REF_PRINT | ||
395 | REF_PRINT("EVP_PKEY",x); | ||
396 | #endif | ||
397 | if (i > 0) return; | 394 | if (i > 0) return; |
398 | #ifdef REF_CHECK | 395 | |
399 | if (i < 0) | ||
400 | { | ||
401 | fprintf(stderr,"EVP_PKEY_free, bad reference count\n"); | ||
402 | abort(); | ||
403 | } | ||
404 | #endif | ||
405 | EVP_PKEY_free_it(x); | 396 | EVP_PKEY_free_it(x); |
406 | if (x->attributes) | 397 | if (x->attributes) |
407 | sk_X509_ATTRIBUTE_pop_free(x->attributes, X509_ATTRIBUTE_free); | 398 | sk_X509_ATTRIBUTE_pop_free(x->attributes, X509_ATTRIBUTE_free); |
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_lib.c b/src/lib/libssl/src/crypto/rsa/rsa_lib.c index e99a3627dc..a618d70f92 100644 --- a/src/lib/libssl/src/crypto/rsa/rsa_lib.c +++ b/src/lib/libssl/src/crypto/rsa/rsa_lib.c | |||
@@ -208,17 +208,7 @@ void RSA_free(RSA *r) | |||
208 | if (r == NULL) return; | 208 | if (r == NULL) return; |
209 | 209 | ||
210 | i=CRYPTO_add(&r->references,-1,CRYPTO_LOCK_RSA); | 210 | i=CRYPTO_add(&r->references,-1,CRYPTO_LOCK_RSA); |
211 | #ifdef REF_PRINT | ||
212 | REF_PRINT("RSA",r); | ||
213 | #endif | ||
214 | if (i > 0) return; | 211 | if (i > 0) return; |
215 | #ifdef REF_CHECK | ||
216 | if (i < 0) | ||
217 | { | ||
218 | fprintf(stderr,"RSA_free, bad reference count\n"); | ||
219 | abort(); | ||
220 | } | ||
221 | #endif | ||
222 | 212 | ||
223 | if (r->meth->finish) | 213 | if (r->meth->finish) |
224 | r->meth->finish(r); | 214 | r->meth->finish(r); |
@@ -246,16 +236,6 @@ void RSA_free(RSA *r) | |||
246 | int RSA_up_ref(RSA *r) | 236 | int RSA_up_ref(RSA *r) |
247 | { | 237 | { |
248 | int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_RSA); | 238 | int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_RSA); |
249 | #ifdef REF_PRINT | ||
250 | REF_PRINT("RSA",r); | ||
251 | #endif | ||
252 | #ifdef REF_CHECK | ||
253 | if (i < 2) | ||
254 | { | ||
255 | fprintf(stderr, "RSA_up_ref, bad reference count\n"); | ||
256 | abort(); | ||
257 | } | ||
258 | #endif | ||
259 | return ((i > 1) ? 1 : 0); | 239 | return ((i > 1) ? 1 : 0); |
260 | } | 240 | } |
261 | 241 | ||
diff --git a/src/lib/libssl/src/crypto/store/str_lib.c b/src/lib/libssl/src/crypto/store/str_lib.c index a451e9cb74..197f19e769 100644 --- a/src/lib/libssl/src/crypto/store/str_lib.c +++ b/src/lib/libssl/src/crypto/store/str_lib.c | |||
@@ -269,9 +269,6 @@ X509 *STORE_get_certificate(STORE *s, OPENSSL_ITEM attributes[], | |||
269 | return 0; | 269 | return 0; |
270 | } | 270 | } |
271 | CRYPTO_add(&object->data.x509.certificate->references,1,CRYPTO_LOCK_X509); | 271 | CRYPTO_add(&object->data.x509.certificate->references,1,CRYPTO_LOCK_X509); |
272 | #ifdef REF_PRINT | ||
273 | REF_PRINT("X509",data); | ||
274 | #endif | ||
275 | x = object->data.x509.certificate; | 272 | x = object->data.x509.certificate; |
276 | STORE_OBJECT_free(object); | 273 | STORE_OBJECT_free(object); |
277 | return x; | 274 | return x; |
@@ -295,9 +292,6 @@ int STORE_store_certificate(STORE *s, X509 *data, OPENSSL_ITEM attributes[], | |||
295 | } | 292 | } |
296 | 293 | ||
297 | CRYPTO_add(&data->references,1,CRYPTO_LOCK_X509); | 294 | CRYPTO_add(&data->references,1,CRYPTO_LOCK_X509); |
298 | #ifdef REF_PRINT | ||
299 | REF_PRINT("X509",data); | ||
300 | #endif | ||
301 | object->data.x509.certificate = data; | 295 | object->data.x509.certificate = data; |
302 | 296 | ||
303 | i = s->meth->store_object(s, STORE_OBJECT_TYPE_X509_CERTIFICATE, | 297 | i = s->meth->store_object(s, STORE_OBJECT_TYPE_X509_CERTIFICATE, |
@@ -399,9 +393,6 @@ X509 *STORE_list_certificate_next(STORE *s, void *handle) | |||
399 | return 0; | 393 | return 0; |
400 | } | 394 | } |
401 | CRYPTO_add(&object->data.x509.certificate->references,1,CRYPTO_LOCK_X509); | 395 | CRYPTO_add(&object->data.x509.certificate->references,1,CRYPTO_LOCK_X509); |
402 | #ifdef REF_PRINT | ||
403 | REF_PRINT("X509",data); | ||
404 | #endif | ||
405 | x = object->data.x509.certificate; | 396 | x = object->data.x509.certificate; |
406 | STORE_OBJECT_free(object); | 397 | STORE_OBJECT_free(object); |
407 | return x; | 398 | return x; |
@@ -453,9 +444,6 @@ EVP_PKEY *STORE_generate_key(STORE *s, OPENSSL_ITEM attributes[], | |||
453 | return 0; | 444 | return 0; |
454 | } | 445 | } |
455 | CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY); | 446 | CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY); |
456 | #ifdef REF_PRINT | ||
457 | REF_PRINT("EVP_PKEY",data); | ||
458 | #endif | ||
459 | pkey = object->data.key; | 447 | pkey = object->data.key; |
460 | STORE_OBJECT_free(object); | 448 | STORE_OBJECT_free(object); |
461 | return pkey; | 449 | return pkey; |
@@ -479,9 +467,6 @@ EVP_PKEY *STORE_get_private_key(STORE *s, OPENSSL_ITEM attributes[], | |||
479 | return 0; | 467 | return 0; |
480 | } | 468 | } |
481 | CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY); | 469 | CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY); |
482 | #ifdef REF_PRINT | ||
483 | REF_PRINT("EVP_PKEY",data); | ||
484 | #endif | ||
485 | pkey = object->data.key; | 470 | pkey = object->data.key; |
486 | STORE_OBJECT_free(object); | 471 | STORE_OBJECT_free(object); |
487 | return pkey; | 472 | return pkey; |
@@ -512,9 +497,6 @@ int STORE_store_private_key(STORE *s, EVP_PKEY *data, OPENSSL_ITEM attributes[], | |||
512 | } | 497 | } |
513 | 498 | ||
514 | CRYPTO_add(&data->references,1,CRYPTO_LOCK_EVP_PKEY); | 499 | CRYPTO_add(&data->references,1,CRYPTO_LOCK_EVP_PKEY); |
515 | #ifdef REF_PRINT | ||
516 | REF_PRINT("EVP_PKEY",data); | ||
517 | #endif | ||
518 | object->data.key = data; | 500 | object->data.key = data; |
519 | 501 | ||
520 | i = s->meth->store_object(s, STORE_OBJECT_TYPE_PRIVATE_KEY, object, | 502 | i = s->meth->store_object(s, STORE_OBJECT_TYPE_PRIVATE_KEY, object, |
@@ -620,9 +602,6 @@ EVP_PKEY *STORE_list_private_key_next(STORE *s, void *handle) | |||
620 | return 0; | 602 | return 0; |
621 | } | 603 | } |
622 | CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY); | 604 | CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY); |
623 | #ifdef REF_PRINT | ||
624 | REF_PRINT("EVP_PKEY",data); | ||
625 | #endif | ||
626 | pkey = object->data.key; | 605 | pkey = object->data.key; |
627 | STORE_OBJECT_free(object); | 606 | STORE_OBJECT_free(object); |
628 | return pkey; | 607 | return pkey; |
@@ -674,9 +653,6 @@ EVP_PKEY *STORE_get_public_key(STORE *s, OPENSSL_ITEM attributes[], | |||
674 | return 0; | 653 | return 0; |
675 | } | 654 | } |
676 | CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY); | 655 | CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY); |
677 | #ifdef REF_PRINT | ||
678 | REF_PRINT("EVP_PKEY",data); | ||
679 | #endif | ||
680 | pkey = object->data.key; | 656 | pkey = object->data.key; |
681 | STORE_OBJECT_free(object); | 657 | STORE_OBJECT_free(object); |
682 | return pkey; | 658 | return pkey; |
@@ -707,9 +683,6 @@ int STORE_store_public_key(STORE *s, EVP_PKEY *data, OPENSSL_ITEM attributes[], | |||
707 | } | 683 | } |
708 | 684 | ||
709 | CRYPTO_add(&data->references,1,CRYPTO_LOCK_EVP_PKEY); | 685 | CRYPTO_add(&data->references,1,CRYPTO_LOCK_EVP_PKEY); |
710 | #ifdef REF_PRINT | ||
711 | REF_PRINT("EVP_PKEY",data); | ||
712 | #endif | ||
713 | object->data.key = data; | 686 | object->data.key = data; |
714 | 687 | ||
715 | i = s->meth->store_object(s, STORE_OBJECT_TYPE_PUBLIC_KEY, object, | 688 | i = s->meth->store_object(s, STORE_OBJECT_TYPE_PUBLIC_KEY, object, |
@@ -815,9 +788,6 @@ EVP_PKEY *STORE_list_public_key_next(STORE *s, void *handle) | |||
815 | return 0; | 788 | return 0; |
816 | } | 789 | } |
817 | CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY); | 790 | CRYPTO_add(&object->data.key->references,1,CRYPTO_LOCK_EVP_PKEY); |
818 | #ifdef REF_PRINT | ||
819 | REF_PRINT("EVP_PKEY",data); | ||
820 | #endif | ||
821 | pkey = object->data.key; | 791 | pkey = object->data.key; |
822 | STORE_OBJECT_free(object); | 792 | STORE_OBJECT_free(object); |
823 | return pkey; | 793 | return pkey; |
@@ -869,9 +839,6 @@ X509_CRL *STORE_generate_crl(STORE *s, OPENSSL_ITEM attributes[], | |||
869 | return 0; | 839 | return 0; |
870 | } | 840 | } |
871 | CRYPTO_add(&object->data.crl->references,1,CRYPTO_LOCK_X509_CRL); | 841 | CRYPTO_add(&object->data.crl->references,1,CRYPTO_LOCK_X509_CRL); |
872 | #ifdef REF_PRINT | ||
873 | REF_PRINT("X509_CRL",data); | ||
874 | #endif | ||
875 | crl = object->data.crl; | 842 | crl = object->data.crl; |
876 | STORE_OBJECT_free(object); | 843 | STORE_OBJECT_free(object); |
877 | return crl; | 844 | return crl; |
@@ -895,9 +862,6 @@ X509_CRL *STORE_get_crl(STORE *s, OPENSSL_ITEM attributes[], | |||
895 | return 0; | 862 | return 0; |
896 | } | 863 | } |
897 | CRYPTO_add(&object->data.crl->references,1,CRYPTO_LOCK_X509_CRL); | 864 | CRYPTO_add(&object->data.crl->references,1,CRYPTO_LOCK_X509_CRL); |
898 | #ifdef REF_PRINT | ||
899 | REF_PRINT("X509_CRL",data); | ||
900 | #endif | ||
901 | crl = object->data.crl; | 865 | crl = object->data.crl; |
902 | STORE_OBJECT_free(object); | 866 | STORE_OBJECT_free(object); |
903 | return crl; | 867 | return crl; |
@@ -921,9 +885,6 @@ int STORE_store_crl(STORE *s, X509_CRL *data, OPENSSL_ITEM attributes[], | |||
921 | } | 885 | } |
922 | 886 | ||
923 | CRYPTO_add(&data->references,1,CRYPTO_LOCK_X509_CRL); | 887 | CRYPTO_add(&data->references,1,CRYPTO_LOCK_X509_CRL); |
924 | #ifdef REF_PRINT | ||
925 | REF_PRINT("X509_CRL",data); | ||
926 | #endif | ||
927 | object->data.crl = data; | 888 | object->data.crl = data; |
928 | 889 | ||
929 | i = s->meth->store_object(s, STORE_OBJECT_TYPE_X509_CRL, object, | 890 | i = s->meth->store_object(s, STORE_OBJECT_TYPE_X509_CRL, object, |
@@ -1009,9 +970,6 @@ X509_CRL *STORE_list_crl_next(STORE *s, void *handle) | |||
1009 | return 0; | 970 | return 0; |
1010 | } | 971 | } |
1011 | CRYPTO_add(&object->data.crl->references,1,CRYPTO_LOCK_X509_CRL); | 972 | CRYPTO_add(&object->data.crl->references,1,CRYPTO_LOCK_X509_CRL); |
1012 | #ifdef REF_PRINT | ||
1013 | REF_PRINT("X509_CRL",data); | ||
1014 | #endif | ||
1015 | crl = object->data.crl; | 973 | crl = object->data.crl; |
1016 | STORE_OBJECT_free(object); | 974 | STORE_OBJECT_free(object); |
1017 | return crl; | 975 | return crl; |
diff --git a/src/lib/libssl/src/e_os.h b/src/lib/libssl/src/e_os.h index e66179273f..8efb7f234b 100644 --- a/src/lib/libssl/src/e_os.h +++ b/src/lib/libssl/src/e_os.h | |||
@@ -74,12 +74,6 @@ | |||
74 | extern "C" { | 74 | extern "C" { |
75 | #endif | 75 | #endif |
76 | 76 | ||
77 | /* Used to checking reference counts, most while doing perl5 stuff :-) */ | ||
78 | #ifdef REF_PRINT | ||
79 | #undef REF_PRINT | ||
80 | #define REF_PRINT(a,b) fprintf(stderr,"%08X:%4d:%s\n",(int)b,b->references,a) | ||
81 | #endif | ||
82 | |||
83 | #define OPENSSL_CONF "openssl.cnf" | 77 | #define OPENSSL_CONF "openssl.cnf" |
84 | #define RFILE ".rnd" | 78 | #define RFILE ".rnd" |
85 | 79 | ||
diff --git a/src/lib/libssl/src/ssl/ssl_cert.c b/src/lib/libssl/src/ssl/ssl_cert.c index 87dc80be20..cf5cfb97f6 100644 --- a/src/lib/libssl/src/ssl/ssl_cert.c +++ b/src/lib/libssl/src/ssl/ssl_cert.c | |||
@@ -352,17 +352,8 @@ ssl_cert_free(CERT *c) | |||
352 | return; | 352 | return; |
353 | 353 | ||
354 | i = CRYPTO_add(&c->references, -1, CRYPTO_LOCK_SSL_CERT); | 354 | i = CRYPTO_add(&c->references, -1, CRYPTO_LOCK_SSL_CERT); |
355 | #ifdef REF_PRINT | ||
356 | REF_PRINT("CERT", c); | ||
357 | #endif | ||
358 | if (i > 0) | 355 | if (i > 0) |
359 | return; | 356 | return; |
360 | #ifdef REF_CHECK | ||
361 | if (i < 0) { | ||
362 | fprintf(stderr, "ssl_cert_free, bad reference count\n"); | ||
363 | abort(); /* ok */ | ||
364 | } | ||
365 | #endif | ||
366 | 357 | ||
367 | #ifndef OPENSSL_NO_RSA | 358 | #ifndef OPENSSL_NO_RSA |
368 | if (c->rsa_tmp) | 359 | if (c->rsa_tmp) |
@@ -444,17 +435,8 @@ ssl_sess_cert_free(SESS_CERT *sc) | |||
444 | return; | 435 | return; |
445 | 436 | ||
446 | i = CRYPTO_add(&sc->references, -1, CRYPTO_LOCK_SSL_SESS_CERT); | 437 | i = CRYPTO_add(&sc->references, -1, CRYPTO_LOCK_SSL_SESS_CERT); |
447 | #ifdef REF_PRINT | ||
448 | REF_PRINT("SESS_CERT", sc); | ||
449 | #endif | ||
450 | if (i > 0) | 438 | if (i > 0) |
451 | return; | 439 | return; |
452 | #ifdef REF_CHECK | ||
453 | if (i < 0) { | ||
454 | fprintf(stderr, "ssl_sess_cert_free, bad reference count\n"); | ||
455 | abort(); /* ok */ | ||
456 | } | ||
457 | #endif | ||
458 | 440 | ||
459 | /* i == 0 */ | 441 | /* i == 0 */ |
460 | if (sc->cert_chain != NULL) | 442 | if (sc->cert_chain != NULL) |
diff --git a/src/lib/libssl/src/ssl/ssl_lib.c b/src/lib/libssl/src/ssl/ssl_lib.c index 589bd625bb..3ab652a6a4 100644 --- a/src/lib/libssl/src/ssl/ssl_lib.c +++ b/src/lib/libssl/src/ssl/ssl_lib.c | |||
@@ -142,9 +142,6 @@ | |||
142 | * OTHERWISE. | 142 | * OTHERWISE. |
143 | */ | 143 | */ |
144 | 144 | ||
145 | #ifdef REF_CHECK | ||
146 | # include <assert.h> | ||
147 | #endif | ||
148 | #include <stdio.h> | 145 | #include <stdio.h> |
149 | #include "ssl_locl.h" | 146 | #include "ssl_locl.h" |
150 | #include "kssl_lcl.h" | 147 | #include "kssl_lcl.h" |
@@ -503,17 +500,8 @@ SSL_free(SSL *s) | |||
503 | return; | 500 | return; |
504 | 501 | ||
505 | i = CRYPTO_add(&s->references, -1, CRYPTO_LOCK_SSL); | 502 | i = CRYPTO_add(&s->references, -1, CRYPTO_LOCK_SSL); |
506 | #ifdef REF_PRINT | ||
507 | REF_PRINT("SSL", s); | ||
508 | #endif | ||
509 | if (i > 0) | 503 | if (i > 0) |
510 | return; | 504 | return; |
511 | #ifdef REF_CHECK | ||
512 | if (i < 0) { | ||
513 | fprintf(stderr, "SSL_free, bad reference count\n"); | ||
514 | abort(); /* ok */ | ||
515 | } | ||
516 | #endif | ||
517 | 505 | ||
518 | if (s->param) | 506 | if (s->param) |
519 | X509_VERIFY_PARAM_free(s->param); | 507 | X509_VERIFY_PARAM_free(s->param); |
@@ -1875,17 +1863,8 @@ SSL_CTX_free(SSL_CTX *a) | |||
1875 | return; | 1863 | return; |
1876 | 1864 | ||
1877 | i = CRYPTO_add(&a->references, -1, CRYPTO_LOCK_SSL_CTX); | 1865 | i = CRYPTO_add(&a->references, -1, CRYPTO_LOCK_SSL_CTX); |
1878 | #ifdef REF_PRINT | ||
1879 | REF_PRINT("SSL_CTX", a); | ||
1880 | #endif | ||
1881 | if (i > 0) | 1866 | if (i > 0) |
1882 | return; | 1867 | return; |
1883 | #ifdef REF_CHECK | ||
1884 | if (i < 0) { | ||
1885 | fprintf(stderr, "SSL_CTX_free, bad reference count\n"); | ||
1886 | abort(); /* ok */ | ||
1887 | } | ||
1888 | #endif | ||
1889 | 1868 | ||
1890 | if (a->param) | 1869 | if (a->param) |
1891 | X509_VERIFY_PARAM_free(a->param); | 1870 | X509_VERIFY_PARAM_free(a->param); |
@@ -2814,9 +2793,6 @@ ssl_free_wbio_buffer(SSL *s) | |||
2814 | if (s->bbio == s->wbio) { | 2793 | if (s->bbio == s->wbio) { |
2815 | /* remove buffering */ | 2794 | /* remove buffering */ |
2816 | s->wbio = BIO_pop(s->wbio); | 2795 | s->wbio = BIO_pop(s->wbio); |
2817 | #ifdef REF_CHECK /* not the usual REF_CHECK, but this avoids adding one more preprocessor symbol */ | ||
2818 | assert(s->wbio != NULL); | ||
2819 | #endif | ||
2820 | } | 2796 | } |
2821 | BIO_free(s->bbio); | 2797 | BIO_free(s->bbio); |
2822 | s->bbio = NULL; | 2798 | s->bbio = NULL; |
diff --git a/src/lib/libssl/src/ssl/ssl_sess.c b/src/lib/libssl/src/ssl/ssl_sess.c index f9f6ee5ecb..cbfff0b398 100644 --- a/src/lib/libssl/src/ssl/ssl_sess.c +++ b/src/lib/libssl/src/ssl/ssl_sess.c | |||
@@ -694,17 +694,8 @@ SSL_SESSION_free(SSL_SESSION *ss) | |||
694 | return; | 694 | return; |
695 | 695 | ||
696 | i = CRYPTO_add(&ss->references, -1, CRYPTO_LOCK_SSL_SESSION); | 696 | i = CRYPTO_add(&ss->references, -1, CRYPTO_LOCK_SSL_SESSION); |
697 | #ifdef REF_PRINT | ||
698 | REF_PRINT("SSL_SESSION", ss); | ||
699 | #endif | ||
700 | if (i > 0) | 697 | if (i > 0) |
701 | return; | 698 | return; |
702 | #ifdef REF_CHECK | ||
703 | if (i < 0) { | ||
704 | fprintf(stderr, "SSL_SESSION_free, bad reference count\n"); | ||
705 | abort(); /* ok */ | ||
706 | } | ||
707 | #endif | ||
708 | 699 | ||
709 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL_SESSION, ss, &ss->ex_data); | 700 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL_SESSION, ss, &ss->ex_data); |
710 | 701 | ||
diff --git a/src/lib/libssl/ssl_cert.c b/src/lib/libssl/ssl_cert.c index 87dc80be20..cf5cfb97f6 100644 --- a/src/lib/libssl/ssl_cert.c +++ b/src/lib/libssl/ssl_cert.c | |||
@@ -352,17 +352,8 @@ ssl_cert_free(CERT *c) | |||
352 | return; | 352 | return; |
353 | 353 | ||
354 | i = CRYPTO_add(&c->references, -1, CRYPTO_LOCK_SSL_CERT); | 354 | i = CRYPTO_add(&c->references, -1, CRYPTO_LOCK_SSL_CERT); |
355 | #ifdef REF_PRINT | ||
356 | REF_PRINT("CERT", c); | ||
357 | #endif | ||
358 | if (i > 0) | 355 | if (i > 0) |
359 | return; | 356 | return; |
360 | #ifdef REF_CHECK | ||
361 | if (i < 0) { | ||
362 | fprintf(stderr, "ssl_cert_free, bad reference count\n"); | ||
363 | abort(); /* ok */ | ||
364 | } | ||
365 | #endif | ||
366 | 357 | ||
367 | #ifndef OPENSSL_NO_RSA | 358 | #ifndef OPENSSL_NO_RSA |
368 | if (c->rsa_tmp) | 359 | if (c->rsa_tmp) |
@@ -444,17 +435,8 @@ ssl_sess_cert_free(SESS_CERT *sc) | |||
444 | return; | 435 | return; |
445 | 436 | ||
446 | i = CRYPTO_add(&sc->references, -1, CRYPTO_LOCK_SSL_SESS_CERT); | 437 | i = CRYPTO_add(&sc->references, -1, CRYPTO_LOCK_SSL_SESS_CERT); |
447 | #ifdef REF_PRINT | ||
448 | REF_PRINT("SESS_CERT", sc); | ||
449 | #endif | ||
450 | if (i > 0) | 438 | if (i > 0) |
451 | return; | 439 | return; |
452 | #ifdef REF_CHECK | ||
453 | if (i < 0) { | ||
454 | fprintf(stderr, "ssl_sess_cert_free, bad reference count\n"); | ||
455 | abort(); /* ok */ | ||
456 | } | ||
457 | #endif | ||
458 | 440 | ||
459 | /* i == 0 */ | 441 | /* i == 0 */ |
460 | if (sc->cert_chain != NULL) | 442 | if (sc->cert_chain != NULL) |
diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c index 589bd625bb..3ab652a6a4 100644 --- a/src/lib/libssl/ssl_lib.c +++ b/src/lib/libssl/ssl_lib.c | |||
@@ -142,9 +142,6 @@ | |||
142 | * OTHERWISE. | 142 | * OTHERWISE. |
143 | */ | 143 | */ |
144 | 144 | ||
145 | #ifdef REF_CHECK | ||
146 | # include <assert.h> | ||
147 | #endif | ||
148 | #include <stdio.h> | 145 | #include <stdio.h> |
149 | #include "ssl_locl.h" | 146 | #include "ssl_locl.h" |
150 | #include "kssl_lcl.h" | 147 | #include "kssl_lcl.h" |
@@ -503,17 +500,8 @@ SSL_free(SSL *s) | |||
503 | return; | 500 | return; |
504 | 501 | ||
505 | i = CRYPTO_add(&s->references, -1, CRYPTO_LOCK_SSL); | 502 | i = CRYPTO_add(&s->references, -1, CRYPTO_LOCK_SSL); |
506 | #ifdef REF_PRINT | ||
507 | REF_PRINT("SSL", s); | ||
508 | #endif | ||
509 | if (i > 0) | 503 | if (i > 0) |
510 | return; | 504 | return; |
511 | #ifdef REF_CHECK | ||
512 | if (i < 0) { | ||
513 | fprintf(stderr, "SSL_free, bad reference count\n"); | ||
514 | abort(); /* ok */ | ||
515 | } | ||
516 | #endif | ||
517 | 505 | ||
518 | if (s->param) | 506 | if (s->param) |
519 | X509_VERIFY_PARAM_free(s->param); | 507 | X509_VERIFY_PARAM_free(s->param); |
@@ -1875,17 +1863,8 @@ SSL_CTX_free(SSL_CTX *a) | |||
1875 | return; | 1863 | return; |
1876 | 1864 | ||
1877 | i = CRYPTO_add(&a->references, -1, CRYPTO_LOCK_SSL_CTX); | 1865 | i = CRYPTO_add(&a->references, -1, CRYPTO_LOCK_SSL_CTX); |
1878 | #ifdef REF_PRINT | ||
1879 | REF_PRINT("SSL_CTX", a); | ||
1880 | #endif | ||
1881 | if (i > 0) | 1866 | if (i > 0) |
1882 | return; | 1867 | return; |
1883 | #ifdef REF_CHECK | ||
1884 | if (i < 0) { | ||
1885 | fprintf(stderr, "SSL_CTX_free, bad reference count\n"); | ||
1886 | abort(); /* ok */ | ||
1887 | } | ||
1888 | #endif | ||
1889 | 1868 | ||
1890 | if (a->param) | 1869 | if (a->param) |
1891 | X509_VERIFY_PARAM_free(a->param); | 1870 | X509_VERIFY_PARAM_free(a->param); |
@@ -2814,9 +2793,6 @@ ssl_free_wbio_buffer(SSL *s) | |||
2814 | if (s->bbio == s->wbio) { | 2793 | if (s->bbio == s->wbio) { |
2815 | /* remove buffering */ | 2794 | /* remove buffering */ |
2816 | s->wbio = BIO_pop(s->wbio); | 2795 | s->wbio = BIO_pop(s->wbio); |
2817 | #ifdef REF_CHECK /* not the usual REF_CHECK, but this avoids adding one more preprocessor symbol */ | ||
2818 | assert(s->wbio != NULL); | ||
2819 | #endif | ||
2820 | } | 2796 | } |
2821 | BIO_free(s->bbio); | 2797 | BIO_free(s->bbio); |
2822 | s->bbio = NULL; | 2798 | s->bbio = NULL; |
diff --git a/src/lib/libssl/ssl_sess.c b/src/lib/libssl/ssl_sess.c index f9f6ee5ecb..cbfff0b398 100644 --- a/src/lib/libssl/ssl_sess.c +++ b/src/lib/libssl/ssl_sess.c | |||
@@ -694,17 +694,8 @@ SSL_SESSION_free(SSL_SESSION *ss) | |||
694 | return; | 694 | return; |
695 | 695 | ||
696 | i = CRYPTO_add(&ss->references, -1, CRYPTO_LOCK_SSL_SESSION); | 696 | i = CRYPTO_add(&ss->references, -1, CRYPTO_LOCK_SSL_SESSION); |
697 | #ifdef REF_PRINT | ||
698 | REF_PRINT("SSL_SESSION", ss); | ||
699 | #endif | ||
700 | if (i > 0) | 697 | if (i > 0) |
701 | return; | 698 | return; |
702 | #ifdef REF_CHECK | ||
703 | if (i < 0) { | ||
704 | fprintf(stderr, "SSL_SESSION_free, bad reference count\n"); | ||
705 | abort(); /* ok */ | ||
706 | } | ||
707 | #endif | ||
708 | 699 | ||
709 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL_SESSION, ss, &ss->ex_data); | 700 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL_SESSION, ss, &ss->ex_data); |
710 | 701 | ||