From 5113680f95e522c677cdd37072cfffbdca06831e Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Mon, 10 Apr 2006 08:07:38 +0000 Subject: - 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 --- Source/lib/crypto/hmac.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'Source/lib/crypto/hmac.c') diff --git a/Source/lib/crypto/hmac.c b/Source/lib/crypto/hmac.c index dc31af3eb..84d6044fd 100644 --- a/Source/lib/crypto/hmac.c +++ b/Source/lib/crypto/hmac.c @@ -19,11 +19,10 @@ * for more details. */ +#include #include "hmac.h" -#include - typedef struct private_hmac_t private_hmac_t; @@ -111,7 +110,7 @@ static void allocate_mac(private_hmac_t *this, chunk_t data, chunk_t *out) else { out->len = this->h->get_block_size(this->h); - out->ptr = allocator_alloc(out->len); + out->ptr = malloc(out->len); this->hmac.get_mac(&(this->hmac), data, out->ptr); } } @@ -163,9 +162,9 @@ static void set_key(private_hmac_t *this, chunk_t key) static void destroy(private_hmac_t *this) { this->h->destroy(this->h); - allocator_free(this->opaded_key.ptr); - allocator_free(this->ipaded_key.ptr); - allocator_free(this); + free(this->opaded_key.ptr); + free(this->ipaded_key.ptr); + free(this); } /* @@ -175,7 +174,7 @@ hmac_t *hmac_create(hash_algorithm_t hash_algorithm) { private_hmac_t *this; - this = allocator_alloc_thing(private_hmac_t); + this = malloc_thing(private_hmac_t); /* set hmac_t methods */ this->hmac.get_mac = (void (*)(hmac_t *,chunk_t,u_int8_t*))get_mac; @@ -192,7 +191,7 @@ hmac_t *hmac_create(hash_algorithm_t hash_algorithm) this->b = 64; break; default: - allocator_free(this); + free(this); return NULL; } @@ -200,10 +199,10 @@ hmac_t *hmac_create(hash_algorithm_t hash_algorithm) this->h = hasher_create(hash_algorithm); /* build ipad and opad */ - this->opaded_key.ptr = allocator_alloc(this->b); + this->opaded_key.ptr = malloc(this->b); this->opaded_key.len = this->b; - this->ipaded_key.ptr = allocator_alloc(this->b); + this->ipaded_key.ptr = malloc(this->b); this->ipaded_key.len = this->b; return &(this->hmac); -- cgit v1.2.3