From 8dcfecc6c76effa8afe0d4b6eca95023d51f1e03 Mon Sep 17 00:00:00 2001 From: Gary Lin Date: Thu, 21 Jul 2016 12:28:11 +0800 Subject: Update to openssl 1.0.2h Signed-off-by: Gary Lin --- Cryptlib/OpenSSL/crypto/evp/e_aes_cbc_hmac_sha256.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Cryptlib/OpenSSL/crypto/evp/e_aes_cbc_hmac_sha256.c') diff --git a/Cryptlib/OpenSSL/crypto/evp/e_aes_cbc_hmac_sha256.c b/Cryptlib/OpenSSL/crypto/evp/e_aes_cbc_hmac_sha256.c index 37800213..46c9d033 100644 --- a/Cryptlib/OpenSSL/crypto/evp/e_aes_cbc_hmac_sha256.c +++ b/Cryptlib/OpenSSL/crypto/evp/e_aes_cbc_hmac_sha256.c @@ -60,6 +60,7 @@ # include # include # include "modes_lcl.h" +# include "constant_time_locl.h" # ifndef EVP_CIPH_FLAG_AEAD_CIPHER # define EVP_CIPH_FLAG_AEAD_CIPHER 0x200000 @@ -589,6 +590,8 @@ static int aesni_cbc_hmac_sha256_cipher(EVP_CIPHER_CTX *ctx, maxpad |= (255 - maxpad) >> (sizeof(maxpad) * 8 - 8); maxpad &= 255; + ret &= constant_time_ge(maxpad, pad); + inp_len = len - (SHA256_DIGEST_LENGTH + pad + 1); mask = (0 - ((inp_len - len) >> (sizeof(inp_len) * 8 - 1))); inp_len &= mask; -- cgit v1.2.3