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/diffie_hellman.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'Source/lib/crypto/diffie_hellman.c') diff --git a/Source/lib/crypto/diffie_hellman.c b/Source/lib/crypto/diffie_hellman.c index 84cf1e54a..e458fb80f 100644 --- a/Source/lib/crypto/diffie_hellman.c +++ b/Source/lib/crypto/diffie_hellman.c @@ -28,7 +28,6 @@ #include "diffie_hellman.h" #include -#include #include @@ -553,7 +552,7 @@ static void destroy(private_diffie_hellman_t *this) /* other public value gets initialized together with shared secret */ mpz_clear(this->shared_secret); } - allocator_free(this); + free(this); } /* @@ -561,7 +560,7 @@ static void destroy(private_diffie_hellman_t *this) */ diffie_hellman_t *diffie_hellman_create(diffie_hellman_group_t dh_group_number) { - private_diffie_hellman_t *this = allocator_alloc_thing(private_diffie_hellman_t); + private_diffie_hellman_t *this = malloc_thing(private_diffie_hellman_t); randomizer_t *randomizer; chunk_t random_bytes; @@ -587,24 +586,24 @@ diffie_hellman_t *diffie_hellman_create(diffie_hellman_group_t dh_group_number) /* set this->modulus */ if (this->set_modulus(this) != SUCCESS) { - allocator_free(this); + free(this); return NULL; } randomizer = randomizer_create(); if (randomizer == NULL) { - allocator_free(this); + free(this); return NULL; } if (randomizer->allocate_pseudo_random_bytes(randomizer, this->modulus_length, &random_bytes) != SUCCESS) { randomizer->destroy(randomizer); - allocator_free(this); + free(this); return NULL; } mpz_import(this->my_private_value, random_bytes.len, 1, 1, 1, 0, random_bytes.ptr); - allocator_free_chunk(&random_bytes); + chunk_free(&random_bytes); randomizer->destroy(randomizer); -- cgit v1.2.3