summaryrefslogtreecommitdiff
path: root/lib/vtls/mbedtls.h
diff options
context:
space:
mode:
authorAntoine Aubert <a.aubert@overkiz.com>2017-01-27 08:39:28 +0100
committerDaniel Stenberg <daniel@haxx.se>2017-01-29 11:37:22 +0100
commita90a5bccd47ba5425949a51e6d77b91a2a1e7fe6 (patch)
treea860289f28afee6e3112f871c44c2548566b67e6 /lib/vtls/mbedtls.h
parenta1a5dd14d7dd7957903d33f4d9a8f7ce22faa4a3 (diff)
downloadcurl-a90a5bccd47ba5425949a51e6d77b91a2a1e7fe6.tar.gz
mbedtls: implement CTR-DRBG and HAVEGE random generators
closes #1227
Diffstat (limited to 'lib/vtls/mbedtls.h')
-rw-r--r--lib/vtls/mbedtls.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/vtls/mbedtls.h b/lib/vtls/mbedtls.h
index 1021d5461..5b0bcf6d7 100644
--- a/lib/vtls/mbedtls.h
+++ b/lib/vtls/mbedtls.h
@@ -50,6 +50,9 @@ void Curl_mbedtls_session_free(void *ptr);
size_t Curl_mbedtls_version(char *buffer, size_t size);
int Curl_mbedtls_shutdown(struct connectdata *conn, int sockindex);
+CURLcode Curl_mbedtls_random(struct Curl_easy *data, unsigned char *entropy,
+ size_t length);
+
/* this backends supports CURLOPT_PINNEDPUBLICKEY */
#define have_curlssl_pinnedpubkey 1
@@ -70,11 +73,7 @@ int Curl_mbedtls_shutdown(struct connectdata *conn, int sockindex);
#define curlssl_data_pending(x,y) Curl_mbedtls_data_pending(x, y)
#define CURL_SSL_BACKEND CURLSSLBACKEND_MBEDTLS
#define curlssl_sha256sum(a,b,c,d) mbedtls_sha256(a,b,c,0)
-
-/* This might cause libcurl to use a weeker random!
- TODO: implement proper use of Polarssl's CTR-DRBG or HMAC-DRBG and use that
-*/
-#define curlssl_random(x,y,z) (x=x, y=y, z=z, CURLE_NOT_BUILT_IN)
+#define curlssl_random(x,y,z) Curl_mbedtls_random(x, y, z)
#endif /* USE_MBEDTLS */
#endif /* HEADER_CURL_MBEDTLS_H */