summaryrefslogtreecommitdiffstats
path: root/Utilities/cmcurl/lib/rand.c
diff options
context:
space:
mode:
Diffstat (limited to 'Utilities/cmcurl/lib/rand.c')
-rw-r--r--Utilities/cmcurl/lib/rand.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Utilities/cmcurl/lib/rand.c b/Utilities/cmcurl/lib/rand.c
index 4b6ac07..9abb722 100644
--- a/Utilities/cmcurl/lib/rand.c
+++ b/Utilities/cmcurl/lib/rand.c
@@ -30,6 +30,10 @@
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
+#ifdef HAVE_ARC4RANDOM
+/* Some platforms might have the prototype missing (ubuntu + libressl) */
+uint32_t arc4random(void);
+#endif
#include <curl/curl.h>
#include "vtls/vtls.h"
@@ -143,6 +147,11 @@ static CURLcode randit(struct Curl_easy *data, unsigned int *rnd)
}
#endif
+#ifdef HAVE_ARC4RANDOM
+ *rnd = (unsigned int)arc4random();
+ return CURLE_OK;
+#endif
+
#if defined(RANDOM_FILE) && !defined(WIN32)
if(!seeded) {
/* if there's a random file to read a seed from, use it */