]> granicus.if.org Git - curl/commitdiff
polarssl: provide a (weak) random function
authorDaniel Stenberg <daniel@haxx.se>
Wed, 30 Jul 2014 18:59:16 +0000 (20:59 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 30 Jul 2014 18:59:16 +0000 (20:59 +0200)
This now provides a weak random function since PolarSSL doesn't have a
quick and easy way to provide a good one. It does however provide the
framework to make one so it _can_ and _should_ be done...

lib/vtls/polarssl.h

index af3b28b89a6b15cd40ab85ff5acb6ef66096091b..6c5b872c86ac7a5b5df2c79a5a438916cd5f8527 100644 (file)
@@ -63,5 +63,10 @@ int Curl_polarssl_shutdown(struct connectdata *conn, int sockindex);
 #define curlssl_check_cxn(x) (x=x, -1)
 #define curlssl_data_pending(x,y) (x=x, y=y, 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)
+
 #endif /* USE_POLARSSL */
 #endif /* HEADER_CURL_POLARSSL_H */