From ce73fc19dbc36d089e595e452356deccd8afcd6f Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Fri, 6 Jul 2012 16:57:17 +0200 Subject: Add a return value to crypter_t.set_key() --- src/libtls/tls_crypto.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/libtls/tls_crypto.c') diff --git a/src/libtls/tls_crypto.c b/src/libtls/tls_crypto.c index fde03b800..074479478 100644 --- a/src/libtls/tls_crypto.c +++ b/src/libtls/tls_crypto.c @@ -1560,13 +1560,19 @@ static bool expand_keys(private_tls_crypto_t *this, if (this->tls->is_server(this->tls)) { - this->crypter_in->set_key(this->crypter_in, client_write); - this->crypter_out->set_key(this->crypter_out, server_write); + if (!this->crypter_in->set_key(this->crypter_in, client_write) || + !this->crypter_out->set_key(this->crypter_out, server_write)) + { + return FALSE; + } } else { - this->crypter_out->set_key(this->crypter_out, client_write); - this->crypter_in->set_key(this->crypter_in, server_write); + if (!this->crypter_out->set_key(this->crypter_out, client_write) || + !this->crypter_in->set_key(this->crypter_in, server_write)) + { + return FALSE; + } } if (ivs) { -- cgit v1.2.3