From: Andreas Steffen Date: Sat, 21 Aug 2010 10:51:54 +0000 (+0200) Subject: fixed build_cipher_suite_list() X-Git-Tag: 4.5.0~435 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=56a1167b0788b59687970c10fd1a2891b33c5858;p=thirdparty%2Fstrongswan.git fixed build_cipher_suite_list() --- diff --git a/src/libtls/tls_crypto.c b/src/libtls/tls_crypto.c index 801a12772c..f3df4970fd 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,