diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libtls/tls_crypto.c | 12 |
1 files changed, 6 insertions, 6 deletions
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, |