openssl/crypto/modes
Matt Caswell 3475c7a185 Fix unintended sign extension
The function CRYPTO_128_unwrap_pad uses an 8 byte AIV (Alternative Initial
Value). The least significant 4 bytes of this is placed into the local
variable |ptext_len|. This is done as follows:

    ptext_len = (aiv[4] << 24) | (aiv[5] << 16) | (aiv[6] << 8) | aiv[7];

aiv[4] is an unsigned char, but (aiv[4] << 24) is promoted to a *signed*
int - therefore we could end up shifting into the sign bit and end up with
a negative value. |ptext_len| is a size_t (typically 64-bits). If the
result of the shifts is negative then the upper bits of |ptext_len| will
all be 1.

This commit fixes the issue by explicitly casting to an unsigned int.

Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-17 13:39:53 +00:00
..
asm ARMv4 assembly pack: add Cortex-A15 performance data. 2015-03-08 14:09:32 +01:00
cbc128.c Run util/openssl-format-source -v -c . 2015-01-22 09:20:09 +00:00
ccm128.c Run util/openssl-format-source -v -c . 2015-01-22 09:20:09 +00:00
cfb128.c Run util/openssl-format-source -v -c . 2015-01-22 09:20:09 +00:00
ctr128.c Run util/openssl-format-source -v -c . 2015-01-22 09:20:09 +00:00
cts128.c Run util/openssl-format-source -v -c . 2015-01-22 09:20:09 +00:00
gcm128.c Dead code: crypto/dh,modes,pkcs12,ripemd,rsa,srp 2015-02-03 11:20:56 -05:00
Makefile Remove fipscanister build functionality from makefiles. 2014-12-08 13:23:45 +00:00
modes_lcl.h Run util/openssl-format-source -v -c . 2015-01-22 09:20:09 +00:00
modes.h Run util/openssl-format-source -v -c . 2015-01-22 09:20:09 +00:00
ocb128.c Fix warning on some compilers where variable index shadows a global 2015-01-28 10:57:14 +00:00
ofb128.c Run util/openssl-format-source -v -c . 2015-01-22 09:20:09 +00:00
wrap128.c Fix unintended sign extension 2015-03-17 13:39:53 +00:00
xts128.c Run util/openssl-format-source -v -c . 2015-01-22 09:20:09 +00:00