CVSROOT: /cvs Module name: src Changes by: m...@cvs.openbsd.org 2014/07/11 16:57:25
Modified files: lib/libssl/src/ssl: d1_clnt.c s3_clnt.c s3_srvr.c Log message: As reported by David Ramos, most consumer of ssl_get_message() perform late bounds check, after reading the 2-, 3- or 4-byte size of the next chunk to process. But the size fields themselves are not checked for being entirely contained in the buffer. Since reading past your bounds is bad practice, and may not possible if you are using a secure memory allocator, we need to add the necessary bounds check, at the expense of some readability. As a bonus, a wrong size GOST session key will now trigger an error instead of a printf to stderr and it being handled as if it had the correct size. Creating this diff made my eyes bleed (in the real sense); reviewing it made guenther@'s and beck@'s eyes bleed too (in the literal sense). ok guenther@ beck@