aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/curl/lib/rand.h
diff options
context:
space:
mode:
authorAlexSm <alex@ydb.tech>2024-01-18 11:28:56 +0100
committerGitHub <noreply@github.com>2024-01-18 11:28:56 +0100
commit9d0a3761b3201e0d9db879a7adf91876ebdb0564 (patch)
tree541d11ac878c18efd7ebca81e35112aa0fef995b /contrib/libs/curl/lib/rand.h
parent404ef8886ecc9736bc58ade6da2fbd83b486a408 (diff)
downloadydb-9d0a3761b3201e0d9db879a7adf91876ebdb0564.tar.gz
Library import 8 (#1074)
* Library import 8 * Add contrib/libs/cxxsupp/libcxx/include/__verbose_abort
Diffstat (limited to 'contrib/libs/curl/lib/rand.h')
-rw-r--r--contrib/libs/curl/lib/rand.h25
1 files changed, 9 insertions, 16 deletions
diff --git a/contrib/libs/curl/lib/rand.h b/contrib/libs/curl/lib/rand.h
index 30fc29615a..bc05239e45 100644
--- a/contrib/libs/curl/lib/rand.h
+++ b/contrib/libs/curl/lib/rand.h
@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -24,20 +24,6 @@
*
***************************************************************************/
-/*
- * Curl_rand() stores 'num' number of random unsigned characters in the buffer
- * 'rnd' points to.
- *
- * If libcurl is built without TLS support or with a TLS backend that lacks a
- * proper random API (Gskit or mbedTLS), this function will use "weak" random.
- *
- * When built *with* TLS support and a backend that offers strong random, it
- * will return error if it cannot provide strong random values.
- *
- * NOTE: 'data' may be passed in as NULL when coming from external API without
- * easy handle!
- *
- */
CURLcode Curl_rand(struct Curl_easy *data, unsigned char *rnd, size_t num);
/*
@@ -48,7 +34,14 @@ CURLcode Curl_rand(struct Curl_easy *data, unsigned char *rnd, size_t num);
CURLcode Curl_rand_hex(struct Curl_easy *data, unsigned char *rnd,
size_t num);
-#ifdef WIN32
+/*
+ * Curl_rand_alnum() fills the 'rnd' buffer with a given 'num' size with random
+ * alphanumerical chars PLUS a null-terminating byte.
+ */
+CURLcode Curl_rand_alnum(struct Curl_easy *data, unsigned char *rnd,
+ size_t num);
+
+#ifdef _WIN32
/* Random generator shared between the Schannel vtls and Curl_rand*()
functions */
CURLcode Curl_win32_random(unsigned char *entropy, size_t length);