diff options
author | 2014-05-29 04:57:47 +0000 | |
---|---|---|
committer | 2014-05-29 04:57:47 +0000 | |
commit | bd12c41ff59019054538af31e2302ede8fe8e2a9 (patch) | |
tree | b95e83b77dfd0b9369a04d6962b52ab22f69c605 | |
parent | tweak previous; (diff) | |
download | wireguard-openbsd-bd12c41ff59019054538af31e2302ede8fe8e2a9.tar.xz wireguard-openbsd-bd12c41ff59019054538af31e2302ede8fe8e2a9.zip |
To get a random seed, just call arc4random() instead of reading a
word from the (deprecated) /dev/arandom. This also makes it work
in chroot environments.
ok deraadt@ afresh@
-rw-r--r-- | gnu/usr.bin/perl/util.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gnu/usr.bin/perl/util.c b/gnu/usr.bin/perl/util.c index de1ed1b1d63..be1f9a22a3d 100644 --- a/gnu/usr.bin/perl/util.c +++ b/gnu/usr.bin/perl/util.c @@ -5586,6 +5586,9 @@ Perl_parse_unicode_opts(pTHX_ const char **popt) U32 Perl_seed(pTHX) { +#if defined(__OpenBSD__) + return arc4random(); +#else dVAR; /* * This is really just a quick hack which grabs various garbage @@ -5662,6 +5665,7 @@ Perl_seed(pTHX) u += SEED_C5 * (U32)PTR2UV(&when); #endif return u; +#endif } void |