aboutsummaryrefslogtreecommitdiff
path: root/networking/tls.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/tls.c')
-rw-r--r--networking/tls.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/networking/tls.c b/networking/tls.c
index 99722cfb4..ec5a56d57 100644
--- a/networking/tls.c
+++ b/networking/tls.c
@@ -289,8 +289,14 @@ static void dump_tls_record(const void *vp, int len)
289 289
290void tls_get_random(void *buf, unsigned len) 290void tls_get_random(void *buf, unsigned len)
291{ 291{
292#if !ENABLE_PLATFORM_MINGW32
292 if (len != open_read_close("/dev/urandom", buf, len)) 293 if (len != open_read_close("/dev/urandom", buf, len))
293 xfunc_die(); 294 xfunc_die();
295#else
296 int fd = mingw_open("/dev/urandom", O_RDONLY|O_SPECIAL);
297 if (fd < 0 || len != read_close(fd, buf, len))
298 xfunc_die();
299#endif
294} 300}
295 301
296/* Nondestructively see the current hash value */ 302/* Nondestructively see the current hash value */