Make rand_pool buffers more dynamic in their sizing.
authorPauli <paul.dale@oracle.com>
Tue, 23 Jul 2019 08:07:19 +0000 (18:07 +1000)
committerPauli <paul.dale@oracle.com>
Tue, 23 Jul 2019 13:30:12 +0000 (23:30 +1000)
commitb4b42d441d350b48449ea93aaa035152123f70ae
tree05b66afd9b998f24aa6d048eb2e087ca5b7dc4df
parente8d866dcb170dbe22dcda418cd5df655f67dbc0b
Make rand_pool buffers more dynamic in their sizing.

The rand pool support allocates maximal sized buffers -- this is typically
12288 bytes in size.  These pools are allocated in secure memory which is a
scarse resource.  They are also allocated per DRBG of which there are up to two
per thread.

This change allocates 64 byte pools and grows them dynamically if required.
64 is chosen to be sufficiently large so that pools do not normally need to
grow.

Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/9428)

(cherry picked from commit a6a66e4511eec0f4ecc2943117a42b3723eb2222)
CHANGES
crypto/err/openssl.txt
crypto/rand/rand_err.c
crypto/rand/rand_lcl.h
crypto/rand/rand_lib.c
include/openssl/randerr.h