From 939ef2ea114235f94124832c804161f735cec6c8 Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Sat, 27 Oct 2018 11:31:21 +0200 Subject: Avoid two memory allocations in each RAND_DRBG_bytes Reviewed-by: Matthias St. Pierre Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/7518) --- crypto/include/internal/rand_int.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'crypto/include') diff --git a/crypto/include/internal/rand_int.h b/crypto/include/internal/rand_int.h index 3c966ab96e..888cab1b8f 100644 --- a/crypto/include/internal/rand_int.h +++ b/crypto/include/internal/rand_int.h @@ -45,9 +45,9 @@ size_t rand_drbg_get_nonce(RAND_DRBG *drbg, void rand_drbg_cleanup_nonce(RAND_DRBG *drbg, unsigned char *out, size_t outlen); -size_t rand_drbg_get_additional_data(unsigned char **pout, size_t max_len); +size_t rand_drbg_get_additional_data(RAND_POOL *pool, unsigned char **pout); -void rand_drbg_cleanup_additional_data(unsigned char *out, size_t outlen); +void rand_drbg_cleanup_additional_data(RAND_POOL *pool, unsigned char *out); /* * RAND_POOL functions @@ -59,6 +59,7 @@ void rand_pool_free(RAND_POOL *pool); const unsigned char *rand_pool_buffer(RAND_POOL *pool); unsigned char *rand_pool_detach(RAND_POOL *pool); +void rand_pool_reattach(RAND_POOL *pool, unsigned char *buffer); size_t rand_pool_entropy(RAND_POOL *pool); size_t rand_pool_length(RAND_POOL *pool); -- cgit v1.2.3