X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fevp%2Fe_aes_cbc_hmac_sha256.c;h=3ac59abc34da8b34ad76fed3605e5f9d7d59f792;hp=956cd58a05005cb7e9c3297c957f70f887529069;hb=70428eada9bc4cf31424d723d1f992baffeb0dfb;hpb=2c7fe4dc9ae0c84d2c398d57143983800cc3f18d diff --git a/crypto/evp/e_aes_cbc_hmac_sha256.c b/crypto/evp/e_aes_cbc_hmac_sha256.c index 956cd58a05..3ac59abc34 100644 --- a/crypto/evp/e_aes_cbc_hmac_sha256.c +++ b/crypto/evp/e_aes_cbc_hmac_sha256.c @@ -59,6 +59,7 @@ #include #include #include "modes_lcl.h" +#include "internal/constant_time_locl.h" #include "internal/evp_int.h" #ifndef EVP_CIPH_FLAG_AEAD_CIPHER @@ -594,6 +595,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;