if (!dcrypt_ctx_sym_update(estream->ctx_sym, ptr + off,
bl, &buf, &error)) {
+ stream->ostream.stream_errno = EIO;
io_stream_set_error(&stream->iostream,
"Encryption failure: %s",
error);
/* update mac */
if (!dcrypt_ctx_hmac_update(estream->ctx_mac,
buf.data, buf.used, &error)) {
+ stream->ostream.stream_errno = EIO;
io_stream_set_error(&stream->iostream,
"MAC failure: %s", error);
return -1;
buffer_t *buf = t_buffer_create(
dcrypt_ctx_sym_get_block_size(estream->ctx_sym));
if (!dcrypt_ctx_sym_final(estream->ctx_sym, buf, &error)) {
+ stream->ostream.stream_errno = EIO;
io_stream_set_error(&estream->ostream.iostream,
"Encryption failure: %s", error);
return -1;
IO_STREAM_ENC_INTEGRITY_HMAC)) {
if (!dcrypt_ctx_hmac_update(estream->ctx_mac, buf->data,
buf->used, &error)) {
+ stream->ostream.stream_errno = EIO;
io_stream_set_error(&estream->ostream.iostream,
"MAC failure: %s", error);
return -1;
if ((estream->flags & IO_STREAM_ENC_INTEGRITY_HMAC) ==
IO_STREAM_ENC_INTEGRITY_HMAC) {
if (!dcrypt_ctx_hmac_final(estream->ctx_mac, buf, &error)) {
+ stream->ostream.stream_errno = EIO;
io_stream_set_error(&estream->ostream.iostream,
"MAC failure: %s", error);
return -1;