openssl/crypto/aes
Emilia Kasper 8b37e5c14f Fix undefined behaviour in shifts.
Td4 and Te4 are arrays of u8. A u8 << int promotes the u8 to an int first then shifts.
If the mathematical result of a shift (as modelled by lhs * 2^{rhs}) is not representable
in an integer, behaviour is undefined. In other words, you can't shift into the sign bit
of a signed integer. Fix this by casting to u32 whenever we're shifting left by 24.

(For consistency, cast other shifts, too.)

Caught by -fsanitize=shift

Submitted by Nick Lewycky (Google)

Reviewed-by: Andy Polyakov <appro@openssl.org>
2015-03-13 21:10:13 -07:00
..
asm aes/asm/bsaes-armv7: fix kernel-side XTS and harmonize with Linux. 2015-02-24 10:08:57 +01:00
aes_cbc.c Run util/openssl-format-source -v -c . 2015-01-22 09:20:09 +00:00
aes_cfb.c Run util/openssl-format-source -v -c . 2015-01-22 09:20:09 +00:00
aes_core.c Fix undefined behaviour in shifts. 2015-03-13 21:10:13 -07:00
aes_ecb.c Run util/openssl-format-source -v -c . 2015-01-22 09:20:09 +00:00
aes_ige.c Run util/openssl-format-source -v -c . 2015-01-22 09:20:09 +00:00
aes_locl.h Run util/openssl-format-source -v -c . 2015-01-22 09:20:09 +00:00
aes_misc.c Run util/openssl-format-source -v -c . 2015-01-22 09:20:09 +00:00
aes_ofb.c Run util/openssl-format-source -v -c . 2015-01-22 09:20:09 +00:00
aes_wrap.c Run util/openssl-format-source -v -c . 2015-01-22 09:20:09 +00:00
aes_x86core.c Fix undefined behaviour in shifts. 2015-03-13 21:10:13 -07:00
aes.h "#if 0" removal: header files 2015-01-27 17:44:12 -05:00
Makefile Fix crash in SPARC T4 XTS. 2015-02-24 10:11:36 +01:00