diff options
author | jkim <jkim@FreeBSD.org> | 2016-05-03 18:00:27 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2016-05-03 18:00:27 +0000 |
commit | acb827e3083196de4c00b67ac9ae3bf860ffd4a9 (patch) | |
tree | 2dd85c58056a364765d9ae59d6a1774d41f88523 /crypto/evp/e_aes_cbc_hmac_sha256.c | |
parent | 72d32bf80dfdcfe0e69da200b66f195e919653f7 (diff) | |
download | FreeBSD-src-acb827e3083196de4c00b67ac9ae3bf860ffd4a9.zip FreeBSD-src-acb827e3083196de4c00b67ac9ae3bf860ffd4a9.tar.gz |
Import OpenSSL 1.0.2h.
Diffstat (limited to 'crypto/evp/e_aes_cbc_hmac_sha256.c')
-rw-r--r-- | crypto/evp/e_aes_cbc_hmac_sha256.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/evp/e_aes_cbc_hmac_sha256.c b/crypto/evp/e_aes_cbc_hmac_sha256.c index 3780021..46c9d03 100644 --- a/crypto/evp/e_aes_cbc_hmac_sha256.c +++ b/crypto/evp/e_aes_cbc_hmac_sha256.c @@ -60,6 +60,7 @@ # include <openssl/sha.h> # include <openssl/rand.h> # 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; |