summaryrefslogtreecommitdiff
path: root/lib/cipher.c
diff options
context:
space:
mode:
authorTim Rühsen <tim.ruehsen@gmx.de>2019-10-09 18:44:35 +0200
committerTim Rühsen <tim.ruehsen@gmx.de>2019-10-13 12:27:19 +0200
commit971f8114864a50cf266fe09d179139bf728aed65 (patch)
treea9534f60b023f9a463fe12779af7270910cf146c /lib/cipher.c
parentc53e78bc547a7ff5904ff10c622be372ac2d3c38 (diff)
downloadgnutls-971f8114864a50cf266fe09d179139bf728aed65.tar.gz
cipher: Let _gnutls_auth_cipher_setiv() return int
Fixes Coverity issue 1454646 Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
Diffstat (limited to 'lib/cipher.c')
-rw-r--r--lib/cipher.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/cipher.c b/lib/cipher.c
index 5cae5d5543..908304ac7d 100644
--- a/lib/cipher.c
+++ b/lib/cipher.c
@@ -322,9 +322,11 @@ encrypt_packet(gnutls_session_t session,
/* copy the random IV.
*/
memcpy(data_ptr, nonce, blocksize);
- _gnutls_auth_cipher_setiv(&params->write.
+ ret = _gnutls_auth_cipher_setiv(&params->write.
ctx.tls12, data_ptr,
blocksize);
+ if (ret < 0)
+ return gnutls_assert_val(ret);
/*data_ptr += blocksize;*/
cipher_data += blocksize;
@@ -734,10 +736,12 @@ decrypt_packet(gnutls_session_t session,
/* ignore the IV in TLS 1.1+
*/
if (explicit_iv) {
- _gnutls_auth_cipher_setiv(&params->read.
+ ret = _gnutls_auth_cipher_setiv(&params->read.
ctx.tls12,
ciphertext->data,
blocksize);
+ if (ret < 0)
+ return gnutls_assert_val(ret);
memcpy(nonce, ciphertext->data, blocksize);
ciphertext->size -= blocksize;