From 79b8aa19851524b98d046f74a7338fea7f0aba69 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Wed, 7 Dec 2005 07:27:28 +0000 Subject: - fixed gmp initialization bugs - fixed spi check bug in ike_sa_init_requested --- Source/charon/transforms/diffie_hellman.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Source/charon/transforms/diffie_hellman.c') diff --git a/Source/charon/transforms/diffie_hellman.c b/Source/charon/transforms/diffie_hellman.c index e45b0b368..27aa80cc0 100644 --- a/Source/charon/transforms/diffie_hellman.c +++ b/Source/charon/transforms/diffie_hellman.c @@ -538,11 +538,11 @@ static void destroy(private_diffie_hellman_t *this) mpz_clear(this->modulus); mpz_clear(this->my_prime); mpz_clear(this->my_public_value); + mpz_clear(this->other_public_value); if (this->shared_secret_is_computed) { /* other public value gets initialized together with shared secret */ - mpz_clear(this->other_public_value); mpz_clear(this->shared_secret); } allocator_free(this); @@ -569,6 +569,8 @@ diffie_hellman_t *diffie_hellman_create(diffie_hellman_group_t dh_group_number) /* private variables */ this->dh_group_number = dh_group_number; + mpz_init(this->modulus); + mpz_init(this->other_public_value); /* set this->modulus */ if (this->set_modulus(this) != SUCCESS) -- cgit v1.2.3