projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
check length sanity before correcting in EVP_CTRL_AEAD_TLS1_AAD
[openssl.git]
/
crypto
/
evp
/
e_aes_cbc_hmac_sha256.c
diff --git
a/crypto/evp/e_aes_cbc_hmac_sha256.c
b/crypto/evp/e_aes_cbc_hmac_sha256.c
index bef603a3a5970f06a315bac571edc83e6489916c..daae825ee16ec6abe36617c3f0b89788d4b45692 100644
(file)
--- a/
crypto/evp/e_aes_cbc_hmac_sha256.c
+++ b/
crypto/evp/e_aes_cbc_hmac_sha256.c
@@
-788,6
+788,8
@@
static int aesni_cbc_hmac_sha256_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
key->payload_length = len;
if ((key->aux.tls_ver =
p[arg - 4] << 8 | p[arg - 3]) >= TLS1_1_VERSION) {
+ if (len < AES_BLOCK_SIZE)
+ return 0;
len -= AES_BLOCK_SIZE;
p[arg - 2] = len >> 8;
p[arg - 1] = len;