From f682156a4fc6c43fb38db4abda49b9a1bc1ed368 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 11 Nov 2016 14:53:36 +0100 Subject: Curl_rand: fixed and moved to rand.c Now Curl_rand() is made to fail if it cannot get the necessary random level. Changed the proto of Curl_rand() slightly to provide a number of ints at once. Moved out from vtls, since it isn't a TLS function and vtls provides Curl_ssl_random() for this to use. Discussion: https://curl.haxx.se/mail/lib-2016-11/0119.html --- lib/vtls/vtls.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'lib/vtls/vtls.h') diff --git a/lib/vtls/vtls.h b/lib/vtls/vtls.h index a41ecc325..69d206f52 100644 --- a/lib/vtls/vtls.h +++ b/lib/vtls/vtls.h @@ -56,8 +56,6 @@ bool Curl_clone_ssl_config(struct ssl_config_data* source, struct ssl_config_data* dest); void Curl_free_ssl_config(struct ssl_config_data* sslc); -unsigned int Curl_rand(struct Curl_easy *); - int Curl_ssl_backend(void); #ifdef USE_SSL @@ -140,10 +138,9 @@ void Curl_ssl_kill_session(struct curl_ssl_session *session); */ void Curl_ssl_delsessionid(struct connectdata *conn, void *ssl_sessionid); -/* get N random bytes into the buffer, return 0 if a find random is filled - in */ -int Curl_ssl_random(struct Curl_easy *data, unsigned char *buffer, - size_t length); +/* get N random bytes into the buffer */ +CURLcode Curl_ssl_random(struct Curl_easy *data, unsigned char *buffer, + size_t length); CURLcode Curl_ssl_md5sum(unsigned char *tmp, /* input */ size_t tmplen, unsigned char *md5sum, /* output */ -- cgit v1.2.1