openssl/crypto/rand
Benjamin Kaduk b8a437ffa0 Fix out-of-bounds read in ctr_XOR
Looking at
http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-90Ar1.pdf
we see that in the CTR_DRBG_Update() algorithm (internal page number 51),
the provided input data is (after truncation to seedlen) xor-d with the
key and V vector (of length keylen and blocklen respectively).  The comment
in ctr_XOR notes that xor-ing with 0 is the identity function, so we can
just ignore the case when the provided input is shorter than seedlen.

The code in ctr_XOR() then proceeds to xor the key with the input, up
to the amount of input present, and computes the remaining input that
could be used to xor with the V vector, before accessing a full 16-byte
stretch of the input vector and ignoring the calculated length.  The correct
behavior is to respect the supplied input length and only xor the
indicated number of bytes.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3971)
2017-07-20 12:12:36 -05:00
..
build.info Add DRBG random method 2017-07-19 03:25:16 -04:00
drbg_lib.c Add range-checking to RAND_DRBG_set_reseed_interval 2017-07-20 05:49:09 -04:00
drbg_rand.c Fix out-of-bounds read in ctr_XOR 2017-07-20 12:12:36 -05:00
ossl_rand.c Add DRBG random method 2017-07-19 03:25:16 -04:00
rand_egd.c Rewrite RAND_egd 2017-07-12 11:09:39 -04:00
rand_err.c Add DRBG random method 2017-07-19 03:25:16 -04:00
rand_lcl.h typedef's for RAND_DRBG methods 2017-07-20 12:12:36 -05:00
rand_lib.c Rename internal rand.h file 2017-07-20 10:20:47 -04:00
rand_unix.c Start to overhaul RAND API 2017-07-15 01:51:34 -04:00
rand_vms.c Start to overhaul RAND API 2017-07-15 01:51:34 -04:00
rand_win.c Fix one more instance of incorrect OPENSSL_API_COMPAT value 2016-06-27 11:51:50 +01:00
randfile.c Fix use-after-free 2017-07-17 07:46:49 -04:00