From 56a1167b0788b59687970c10fd1a2891b33c5858 Mon Sep 17 00:00:00 2001 From: Andreas Steffen Date: Sat, 21 Aug 2010 12:51:54 +0200 Subject: fixed build_cipher_suite_list() --- src/libtls/tls_crypto.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/libtls/tls_crypto.c') diff --git a/src/libtls/tls_crypto.c b/src/libtls/tls_crypto.c index 801a12772..f3df4970f 100644 --- a/src/libtls/tls_crypto.c +++ b/src/libtls/tls_crypto.c @@ -486,16 +486,16 @@ static void build_cipher_suite_list(private_tls_crypto_t *this, filter_suite(this, suites, &count, offsetof(suite_algs_t, hash), lib->crypto->create_hasher_enumerator); + free(this->suites); + this->suite_count = count; + this->suites = malloc(sizeof(tls_cipher_suite_t) * count); + DBG2(DBG_CFG, "%d supported TLS cipher suites:", count); for (i = 0; i < count; i++) { - DBG2(DBG_CFG, " %N", tls_cipher_suite_names, suites[i]); + DBG2(DBG_CFG, " %N", tls_cipher_suite_names, suites[i].suite); + this->suites[i] = suites[i].suite; } - - free(this->suites); - this->suite_count = count; - this->suites = malloc(sizeof(tls_cipher_suite_t) * count); - memcpy(this->suites, suites, sizeof(tls_cipher_suite_t) * this->suite_count); } METHOD(tls_crypto_t, get_cipher_suites, int, -- cgit v1.2.3