projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cbd6489
)
e_aes_cbc_hmac_sha1.c: fix rare bad record mac on AES-NI plaforms.
author
Andy Polyakov
<appro@openssl.org>
Mon, 18 Mar 2013 18:29:41 +0000
(19:29 +0100)
committer
Andy Polyakov
<appro@openssl.org>
Mon, 18 Mar 2013 18:29:41 +0000
(19:29 +0100)
PR: 3002
crypto/evp/e_aes_cbc_hmac_sha1.c
patch
|
blob
|
history
diff --git
a/crypto/evp/e_aes_cbc_hmac_sha1.c
b/crypto/evp/e_aes_cbc_hmac_sha1.c
index 2658b9520ab1ce0150095d29d528a3fad3a56214..b8fb706eec9995f07a4c52a6b0a1e6cf20a32147 100644
(file)
--- a/
crypto/evp/e_aes_cbc_hmac_sha1.c
+++ b/
crypto/evp/e_aes_cbc_hmac_sha1.c
@@
-327,10
+327,11
@@
static int aesni_cbc_hmac_sha1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
if (res!=SHA_CBLOCK) continue;
- mask = 0-((inp_len+8-j)>>(sizeof(j)*8-1));
+ /* j is not incremented yet */
+ mask = 0-((inp_len+7-j)>>(sizeof(j)*8-1));
data->u[SHA_LBLOCK-1] |= bitlen&mask;
sha1_block_data_order(&key->md,data,1);
- mask &= 0-((j-inp_len-7
3
)>>(sizeof(j)*8-1));
+ mask &= 0-((j-inp_len-7
2
)>>(sizeof(j)*8-1));
pmac->u[0] |= key->md.h0 & mask;
pmac->u[1] |= key->md.h1 & mask;
pmac->u[2] |= key->md.h2 & mask;