Set error if EVP_CipherUpdate fails.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(cherry picked from commit ee6ce5cc36)

Conflicts:
	crypto/evp/bio_enc.c
This commit is contained in:
Dr. Stephen Henson 2016-07-26 16:51:49 +01:00
parent 325da8231c
commit 97a7b2ebd9

View file

@ -201,9 +201,14 @@ static int enc_read(BIO *b, char *out, int outl)
break;
}
} else {
EVP_CipherUpdate(&(ctx->cipher),
(unsigned char *)ctx->buf, &ctx->buf_len,
(unsigned char *)&(ctx->buf[BUF_OFFSET]), i);
if (!EVP_CipherUpdate(&ctx->cipher,
(unsigned char *)ctx->buf, &ctx->buf_len,
(unsigned char *)&(ctx->buf[BUF_OFFSET]),
i)) {
BIO_clear_retry_flags(b);
ctx->ok = 0;
return 0;
}
ctx->cont = 1;
/*
* Note: it is possible for EVP_CipherUpdate to decrypt zero