aboutsummaryrefslogtreecommitdiffstats
path: root/Source/lib/crypto/diffie_hellman.c
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2006-04-10 08:07:38 +0000
committerMartin Willi <martin@strongswan.org>2006-04-10 08:07:38 +0000
commit5113680f95e522c677cdd37072cfffbdca06831e (patch)
tree973ac57accbc66b042e5307942c6cbbbf4f19579 /Source/lib/crypto/diffie_hellman.c
parent6862128151fb78f63685a8da5575783c426d64a7 (diff)
downloadstrongswan-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/crypto/diffie_hellman.c')
-rw-r--r--Source/lib/crypto/diffie_hellman.c13
1 files changed, 6 insertions, 7 deletions
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 <daemon.h>
-#include <utils/allocator.h>
#include <utils/randomizer.h>
@@ -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);