diff options
author | Martin Willi <martin@strongswan.org> | 2006-04-10 08:07:38 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2006-04-10 08:07:38 +0000 |
commit | 5113680f95e522c677cdd37072cfffbdca06831e (patch) | |
tree | 973ac57accbc66b042e5307942c6cbbbf4f19579 /Source/lib/asn1 | |
parent | 6862128151fb78f63685a8da5575783c426d64a7 (diff) | |
download | strongswan-5113680f95e522c677cdd37072cfffbdca06831e.tar.bz2 strongswan-5113680f95e522c677cdd37072cfffbdca06831e.tar.xz |
- split up in libstrong, charon, stroke, testing done
- new leak detective with malloc hook in library
- useable, but needs improvements
- logger_manager has now a single instance per library
- allows use of loggers from any linking prog
- a LOT of other things
Diffstat (limited to 'Source/lib/asn1')
-rw-r--r-- | Source/lib/asn1/der_decoder.c | 10 | ||||
-rw-r--r-- | Source/lib/asn1/der_encoder.c | 7 |
2 files changed, 8 insertions, 9 deletions
diff --git a/Source/lib/asn1/der_decoder.c b/Source/lib/asn1/der_decoder.c index f9a8425c1..75ad1167e 100644 --- a/Source/lib/asn1/der_decoder.c +++ b/Source/lib/asn1/der_decoder.c @@ -23,10 +23,10 @@ */ #include <gmp.h> +#include <string.h> #include "der_decoder.h" -#include <utils/allocator.h> #include <daemon.h> @@ -280,7 +280,7 @@ status_t read_bitstring(private_der_decoder_t *this, chunk_t data) chunk_t *chunk = (chunk_t*)((u_int8_t*)this->output + this->rule->data_offset); - *chunk = allocator_clone_chunk(data); + *chunk = chunk_clone(data); this->logger->log_chunk(this->logger, CONTROL|LEVEL2, "ASN1_BITSTRING", data); return SUCCESS; @@ -293,7 +293,7 @@ status_t read_any(private_der_decoder_t *this, chunk_t data) { chunk_t *chunk = (chunk_t*)((u_int8_t*)this->output + this->rule->data_offset); - *chunk = allocator_clone_chunk(data); + *chunk = chunk_clone(data); this->logger->log_chunk(this->logger, CONTROL|LEVEL2, "ASN1_ANY", data); return SUCCESS; @@ -481,7 +481,7 @@ status_t decode(private_der_decoder_t *this, chunk_t input, void *output) static void destroy(private_der_decoder_t *this) { this->logger->destroy(this->logger); - allocator_free(this); + free(this); } /* @@ -489,7 +489,7 @@ static void destroy(private_der_decoder_t *this) */ der_decoder_t *der_decoder_create(asn1_rule_t *rules) { - private_der_decoder_t *this = allocator_alloc_thing(private_der_decoder_t); + private_der_decoder_t *this = malloc_thing(private_der_decoder_t); /* public functions */ this->public.decode = (status_t (*) (der_decoder_t*,chunk_t,void*))decode; diff --git a/Source/lib/asn1/der_encoder.c b/Source/lib/asn1/der_encoder.c index 07beb5891..f1fde3b82 100644 --- a/Source/lib/asn1/der_encoder.c +++ b/Source/lib/asn1/der_encoder.c @@ -23,7 +23,6 @@ #include "der_encoder.h" -#include <utils/allocator.h> #include <daemon.h> @@ -197,7 +196,7 @@ static status_t decode(private_der_encoder_t *this, chunk_t input, void *output) */ static void destroy(private_der_encoder_t *this) { - allocator_free(this); + free(this); } /* @@ -205,14 +204,14 @@ static void destroy(private_der_encoder_t *this) */ der_encoder_t *der_encoder_create(asn1_rule_t *rules) { - private_der_encoder_t *this = allocator_alloc_thing(private_der_encoder_t); + private_der_encoder_t *this = malloc_thing(private_der_encoder_t); /* public functions */ this->public.decode = (status_t (*) (der_encoder_t*,chunk_t,void*))decode; this->public.destroy = (void (*) (der_encoder_t*))destroy; this->first_rule = rules; - this->logger = charon->logger_manager->get_logger(charon->logger_manager, DER_DECODER); + this->logger = logger_manager>logger_manager->get_logger(logger_manager>logger_manager, DER_DECODER); return &(this->public); } |