From 993ebac9ed38481e4d3795c437d4e98b985c68ce Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Wed, 15 Jan 2020 16:34:55 +0000 Subject: Convert rand_bytes_ex and rand_priv_bytes_ex to public functions These were initially added as internal functions only. However they will also need to be used by libssl as well. Therefore it make sense to move them into the public API. Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/10864) --- include/crypto/rand.h | 6 ------ include/openssl/rand.h | 7 +++++++ 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/crypto/rand.h b/include/crypto/rand.h index 81bcb60508..16fa737554 100644 --- a/include/crypto/rand.h +++ b/include/crypto/rand.h @@ -186,10 +186,4 @@ void rand_pool_cleanup(void); */ void rand_pool_keep_random_devices_open(int keep); -/* Equivalent of RAND_priv_bytes() but additionally taking an OPENSSL_CTX */ -int rand_priv_bytes_ex(OPENSSL_CTX *ctx, unsigned char *buf, int num); - -/* Equivalent of RAND_bytes() but additionally taking an OPENSSL_CTX */ -int rand_bytes_ex(OPENSSL_CTX *ctx, unsigned char *buf, int num); - #endif diff --git a/include/openssl/rand.h b/include/openssl/rand.h index 1cffab7c54..574592a69f 100644 --- a/include/openssl/rand.h +++ b/include/openssl/rand.h @@ -47,6 +47,13 @@ RAND_METHOD *RAND_OpenSSL(void); # endif int RAND_bytes(unsigned char *buf, int num); int RAND_priv_bytes(unsigned char *buf, int num); + +/* Equivalent of RAND_priv_bytes() but additionally taking an OPENSSL_CTX */ +int RAND_priv_bytes_ex(OPENSSL_CTX *ctx, unsigned char *buf, int num); + +/* Equivalent of RAND_bytes() but additionally taking an OPENSSL_CTX */ +int RAND_bytes_ex(OPENSSL_CTX *ctx, unsigned char *buf, int num); + DEPRECATEDIN_1_1_0(int RAND_pseudo_bytes(unsigned char *buf, int num)) void RAND_seed(const void *buf, int num); -- cgit v1.2.3