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
..
2015-03-13 21:10:13 -07:00
2015-03-16 15:54:19 +00:00
2015-03-12 09:18:22 +00:00
2015-02-13 13:50:36 +00:00
2015-02-24 10:11:36 +01:00
2015-03-05 09:09:57 +00:00
2015-03-12 09:22:56 +00:00
2015-03-12 09:23:42 +00:00
2015-03-05 09:09:57 +00:00
2015-03-15 15:56:24 +00:00
2015-03-15 15:56:24 +00:00
2015-02-06 16:49:17 -05:00
2015-03-17 13:39:53 +00:00
2015-03-05 09:09:57 +00:00
2015-03-12 14:12:17 +00:00
2015-02-06 16:49:17 -05:00
2015-02-24 10:11:36 +01:00
2015-03-16 15:54:19 +00:00
2015-03-16 15:54:19 +00:00
2015-03-05 09:09:57 +00:00
2015-03-12 09:26:14 +00:00
2015-03-17 13:39:53 +00:00
2015-03-05 09:09:57 +00:00
2015-03-12 14:12:17 +00:00
2015-03-16 15:54:19 +00:00
2015-03-12 14:12:17 +00:00
2015-01-23 15:38:41 +01:00
2015-03-05 18:20:06 +01:00
2015-01-27 17:44:12 -05:00
2015-02-09 12:53:36 +00:00
2015-01-22 09:20:09 +00:00
2015-01-23 15:38:41 +01:00
2015-01-23 19:09:01 +01:00
2015-01-22 09:20:09 +00:00
2015-01-22 09:20:09 +00:00
2015-01-22 09:20:09 +00:00
2015-01-23 11:58:26 -05:00
2015-01-22 09:20:09 +00:00
2015-03-12 14:12:17 +00:00
2014-06-04 08:34:18 +02:00
2015-02-06 14:52:40 -05:00
2015-01-22 09:20:09 +00:00