diff options
author | mav <mav@FreeBSD.org> | 2016-09-13 07:15:39 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2016-09-13 07:15:39 +0000 |
commit | b31f1c992e6cebc40c3bb756ff601ffb0f3e189f (patch) | |
tree | 6151f773eb56f1761686f03c5d9e0e50be2ff67b /sys/cddl | |
parent | aa85f9cc2bc506d06b3f2c28c50a7fe6af1c1455 (diff) | |
download | FreeBSD-src-b31f1c992e6cebc40c3bb756ff601ffb0f3e189f.zip FreeBSD-src-b31f1c992e6cebc40c3bb756ff601ffb0f3e189f.tar.gz |
MFC r305679: Switch random_get_pseudo_bytes() shim to arc4rand().
Our shim for Solaris random_get_bytes() uses read_random(), that looks
reasonable, since it guaranties reliably seeded random data. On the other
side Solaris random_get_pseudo_bytes() does not provide this guarantie,
and its original Solaris implementation is equivalent to our arc4rand(),
using software crypto without stressing slower hardware RNG.
Diffstat (limited to 'sys/cddl')
-rw-r--r-- | sys/cddl/compat/opensolaris/sys/random.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/cddl/compat/opensolaris/sys/random.h b/sys/cddl/compat/opensolaris/sys/random.h index 0cdea34..e0ecd9c 100644 --- a/sys/cddl/compat/opensolaris/sys/random.h +++ b/sys/cddl/compat/opensolaris/sys/random.h @@ -32,6 +32,6 @@ #include_next <sys/random.h> #define random_get_bytes(p, s) read_random((p), (int)(s)) -#define random_get_pseudo_bytes(p, s) read_random((p), (int)(s)) +#define random_get_pseudo_bytes(p, s) arc4rand((p), (int)(s), 0) #endif /* !_OPENSOLARIS_SYS_RANDOM_H_ */ |