From: Matt Caswell Date: Mon, 23 Jan 2017 12:44:48 +0000 (+0000) Subject: Properly handle a partial block in OCB mode X-Git-Tag: OpenSSL_1_1_0d~11 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=6af62ee9af06d057f03ec2abc8b9dfd4ac11b16f;p=oweals%2Fopenssl.git Properly handle a partial block in OCB mode If we have previously been passed a partial block in an "Update" call then make sure we properly increment the output buffer when we use it. Fixes #2273 Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/2275) (cherry picked from commit 7c12c7b61c5b37c9dff930ccc68421fb7de00271) --- diff --git a/crypto/evp/e_aes.c b/crypto/evp/e_aes.c index de73b3f529..115da20e65 100644 --- a/crypto/evp/e_aes.c +++ b/crypto/evp/e_aes.c @@ -2587,6 +2587,8 @@ static int aes_ocb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, } written_len = AES_BLOCK_SIZE; *buf_len = 0; + if (out != NULL) + out += AES_BLOCK_SIZE; } /* Do we have a partial block to handle at the end? */