Go to file
David Benjamin ced555394f Fix undefined behavior in shifts.
Td4 is an array 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)

(Imported from upstream's 8b37e5c14f0eddb10c7f91ef91004622d90ef361.)

Change-Id: Id0f98d1d65738533c6ddcc3c21bc38b569d74793
Reviewed-on: https://boringssl-review.googlesource.com/4040
Reviewed-by: Adam Langley <agl@google.com>
2015-03-19 11:33:46 +00:00
crypto Fix undefined behavior in shifts. 2015-03-19 11:33:46 +00:00
doc Inital import. 2014-06-20 13:17:32 -07:00
include/openssl Typo fix in comment. 2015-03-18 22:01:26 +00:00
ssl Check for RAND_bytes failures in the ClientHello. 2015-03-19 11:08:25 +00:00
tool Fix bssl speed. 2015-03-17 23:57:02 +00:00
util Add AEADs for AES-CTR with HMAC-SHA256. 2015-03-18 21:16:55 +00:00
.clang-format Inital import. 2014-06-20 13:17:32 -07:00
.gitignore Add generated documentation to .gitignore 2015-01-26 18:37:55 +00:00
BUILDING Generate error data at build time. 2015-03-06 18:59:25 +00:00
CMakeLists.txt Generate error data at build time. 2015-03-06 18:59:25 +00:00
codereview.settings Add a codereview.settings file. 2014-11-18 22:21:33 +00:00
STYLE Style guide tweaks. 2015-02-19 18:33:20 +00:00