/* copy the random IV.
*/
memcpy(data_ptr, nonce, blocksize);
- _gnutls_auth_cipher_setiv(¶ms->write.
+ ret = _gnutls_auth_cipher_setiv(¶ms->write.
ctx.tls12, data_ptr,
blocksize);
+ if (ret < 0)
+ return gnutls_assert_val(ret);
/*data_ptr += blocksize;*/
cipher_data += blocksize;
/* ignore the IV in TLS 1.1+
*/
if (explicit_iv) {
- _gnutls_auth_cipher_setiv(¶ms->read.
+ ret = _gnutls_auth_cipher_setiv(¶ms->read.
ctx.tls12,
ciphertext->data,
blocksize);
+ if (ret < 0)
+ return gnutls_assert_val(ret);
memcpy(nonce, ciphertext->data, blocksize);
ciphertext->size -= blocksize;
int _gnutls_auth_cipher_tag(auth_cipher_hd_st * handle, void *tag,
int tag_size);
-inline static void _gnutls_auth_cipher_setiv(const auth_cipher_hd_st *
+inline static int _gnutls_auth_cipher_setiv(const auth_cipher_hd_st *
handle, const void *iv,
size_t ivlen)
{
- _gnutls_cipher_setiv(&handle->cipher, iv, ivlen);
+ return _gnutls_cipher_setiv(&handle->cipher, iv, ivlen);
}
inline static size_t _gnutls_auth_cipher_tag_len(auth_cipher_hd_st *