projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix some missing OBJ_dup failure checks.
[openssl.git]
/
crypto
/
evp
/
e_aes_cbc_hmac_sha1.c
diff --git
a/crypto/evp/e_aes_cbc_hmac_sha1.c
b/crypto/evp/e_aes_cbc_hmac_sha1.c
index 4d8c973c5ff94d878696e13acb39c015e5a88f0a..2d5131f2842997d2168eb94eb9c16f36270390cb 100644
(file)
--- a/
crypto/evp/e_aes_cbc_hmac_sha1.c
+++ b/
crypto/evp/e_aes_cbc_hmac_sha1.c
@@
-59,6
+59,7
@@
#include <openssl/rand.h>
#include "modes_lcl.h"
#include "internal/evp_int.h"
#include <openssl/rand.h>
#include "modes_lcl.h"
#include "internal/evp_int.h"
+#include "internal/constant_time_locl.h"
#ifndef EVP_CIPH_FLAG_AEAD_CIPHER
# define EVP_CIPH_FLAG_AEAD_CIPHER 0x200000
#ifndef EVP_CIPH_FLAG_AEAD_CIPHER
# define EVP_CIPH_FLAG_AEAD_CIPHER 0x200000
@@
-90,8
+91,7
@@
typedef struct {
#if defined(AES_ASM) && ( \
defined(__x86_64) || defined(__x86_64__) || \
#if defined(AES_ASM) && ( \
defined(__x86_64) || defined(__x86_64__) || \
- defined(_M_AMD64) || defined(_M_X64) || \
- defined(__INTEL__) )
+ defined(_M_AMD64) || defined(_M_X64) )
extern unsigned int OPENSSL_ia32cap_P[];
# define AESNI_CAPABLE (1<<(57-32))
extern unsigned int OPENSSL_ia32cap_P[];
# define AESNI_CAPABLE (1<<(57-32))
@@
-584,6
+584,8
@@
static int aesni_cbc_hmac_sha1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
maxpad |= (255 - maxpad) >> (sizeof(maxpad) * 8 - 8);
maxpad &= 255;
maxpad |= (255 - maxpad) >> (sizeof(maxpad) * 8 - 8);
maxpad &= 255;
+ ret &= constant_time_ge(maxpad, pad);
+
inp_len = len - (SHA_DIGEST_LENGTH + pad + 1);
mask = (0 - ((inp_len - len) >> (sizeof(inp_len) * 8 - 1)));
inp_len &= mask;
inp_len = len - (SHA_DIGEST_LENGTH + pad + 1);
mask = (0 - ((inp_len - len) >> (sizeof(inp_len) * 8 - 1)));
inp_len &= mask;