diff options
author | Andy Polyakov <appro@openssl.org> | 2014-02-05 16:38:22 +0100 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2014-02-05 16:38:22 +0100 |
commit | 5a42c8f07f2062b6a964bb8d38b0cfe3a8fb0775 (patch) | |
tree | a739e1615f6e53d7813d703bed2a224d0c50945c /crypto/evp/e_aes_cbc_hmac_sha1.c | |
parent | ssl/s3_pkt.c: move multi-block processing to ssl3_write_bytes. (diff) | |
download | openssl-5a42c8f07f2062b6a964bb8d38b0cfe3a8fb0775.tar.xz openssl-5a42c8f07f2062b6a964bb8d38b0cfe3a8fb0775.zip |
e_aes_cbc_hmac_sha[1|256].c: fix compiler warning.
Diffstat (limited to 'crypto/evp/e_aes_cbc_hmac_sha1.c')
-rw-r--r-- | crypto/evp/e_aes_cbc_hmac_sha1.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/crypto/evp/e_aes_cbc_hmac_sha1.c b/crypto/evp/e_aes_cbc_hmac_sha1.c index b14d8371c8..09f928190d 100644 --- a/crypto/evp/e_aes_cbc_hmac_sha1.c +++ b/crypto/evp/e_aes_cbc_hmac_sha1.c @@ -208,6 +208,9 @@ static size_t tls1_1_multi_block_encrypt(EVP_AES_HMAC_SHA1 *key, unsigned int frag, last, packlen, i, x4=4*n4x; size_t ret = 0; u8 *IVs; +#if defined(BSWAP8) + u64 seqnum; +#endif ctx = (SHA1_MB_CTX *)(storage+32-((size_t)storage%32)); /* align */ @@ -221,6 +224,10 @@ static size_t tls1_1_multi_block_encrypt(EVP_AES_HMAC_SHA1 *key, hash_d[0].ptr = inp; for (i=1;i<x4;i++) hash_d[i].ptr = hash_d[i-1].ptr+frag; +#if defined(BSWAP8) + memcpy(blocks[0].c,key->md.data,8); + seqnum = BSWAP8(blocks[0].q[0]); +#endif for (i=0;i<x4;i++) { unsigned int len = (i==(x4-1)?last:frag); @@ -232,7 +239,7 @@ static size_t tls1_1_multi_block_encrypt(EVP_AES_HMAC_SHA1 *key, /* fix seqnum */ #if defined(BSWAP8) - blocks[i].q[0] = BSWAP8(BSWAP8(*(u64*)key->md.data)+i); + blocks[i].q[0] = BSWAP8(seqnum+i); #else blocks[i].c[7] += ((u8*)key->md.data)[7]+i; if (blocks[i].c[7] < i) { |