aboutsummaryrefslogtreecommitdiff
path: root/networking/tls.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-01-24 12:41:19 +0000
committerRon Yorston <rmy@pobox.com>2021-01-24 13:07:11 +0000
commit6422b0ef38d0835c86b40e6e642f18cdfb933e85 (patch)
tree4e235a00fe2f61e7c4466272b52b943e9117270a /networking/tls.c
parent3c85cc0c4821f7131d90f5010b2930bdb0eae4d4 (diff)
downloadbusybox-w32-6422b0ef38d0835c86b40e6e642f18cdfb933e85.tar.gz
busybox-w32-6422b0ef38d0835c86b40e6e642f18cdfb933e85.tar.bz2
busybox-w32-6422b0ef38d0835c86b40e6e642f18cdfb933e85.zip
tls: avoid unnecessary changes to POSIX build
Calls to tls_error_die() embed the line number of the error in the binary. Since some lines had been added to tls.c for the WIN32 port a POSIX build of the busybox-w32 source differed from upstream. Avoid this by pushing the special handling of /dev/urandom down into open_read_close(). tls.c is now unchanged from upstream. The only differences in the POSIX build reported by 'objdump -s' are now the GNU build id, the copyright date and the date of the configuration.
Diffstat (limited to '')
-rw-r--r--networking/tls.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/networking/tls.c b/networking/tls.c
index 869456a6a..e34acd69f 100644
--- a/networking/tls.c
+++ b/networking/tls.c
@@ -349,14 +349,8 @@ static void dump_tls_record(const void *vp, int len)
349 349
350void FAST_FUNC tls_get_random(void *buf, unsigned len) 350void FAST_FUNC tls_get_random(void *buf, unsigned len)
351{ 351{
352#if !ENABLE_PLATFORM_MINGW32
353 if (len != open_read_close("/dev/urandom", buf, len)) 352 if (len != open_read_close("/dev/urandom", buf, len))
354 xfunc_die(); 353 xfunc_die();
355#else
356 int fd = mingw_open("/dev/urandom", O_RDONLY|O_SPECIAL);
357 if (fd < 0 || len != read_close(fd, buf, len))
358 xfunc_die();
359#endif
360} 354}
361 355
362static void xorbuf3(void *dst, const void *src1, const void *src2, unsigned count) 356static void xorbuf3(void *dst, const void *src1, const void *src2, unsigned count)