Fix a buffer overflow in drbg_ctr_generate
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Tue, 2 Jun 2020 09:52:24 +0000 (11:52 +0200)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Wed, 3 Jun 2020 11:15:36 +0000 (13:15 +0200)
commit42fa3e66697baa121220b4eacf03607280e4ff89
tree8fc5f24210e5b79f79bfb25b708146cbf046b641
parent2b584ff372b2b25bb6801172bbeb90074b26f88c
Fix a buffer overflow in drbg_ctr_generate

This can happen if the 32-bit counter overflows
and the last block is not a multiple of 16 bytes.

Fixes #12012

[extended tests]

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: Patrick Steuer <patrick.steuer@de.ibm.com>
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
(Merged from https://github.com/openssl/openssl/pull/12016)
crypto/rand/drbg_ctr.c