summaryrefslogtreecommitdiff
path: root/networking/tls.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--networking/tls.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/networking/tls.c b/networking/tls.c
index db0034e66..d2385efe8 100644
--- a/networking/tls.c
+++ b/networking/tls.c
@@ -351,8 +351,14 @@ static void dump_tls_record(const void *vp, int len)
351 351
352void FAST_FUNC tls_get_random(void *buf, unsigned len) 352void FAST_FUNC tls_get_random(void *buf, unsigned len)
353{ 353{
354#if !ENABLE_PLATFORM_MINGW32
354 if (len != open_read_close("/dev/urandom", buf, len)) 355 if (len != open_read_close("/dev/urandom", buf, len))
355 xfunc_die(); 356 xfunc_die();
357#else
358 int fd = mingw_open("/dev/urandom", O_RDONLY|O_SPECIAL);
359 if (fd < 0 || len != read_close(fd, buf, len))
360 xfunc_die();
361#endif
356} 362}
357 363
358static void xorbuf3(void *dst, const void *src1, const void *src2, unsigned count) 364static void xorbuf3(void *dst, const void *src1, const void *src2, unsigned count)