From 693cfd520304105736117c03399e6cdc8596a0b1 Mon Sep 17 00:00:00 2001 From: mav Date: Tue, 13 Sep 2016 09:25:38 +0000 Subject: [PATCH] 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. --- sys/cddl/compat/opensolaris/sys/random.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cddl/compat/opensolaris/sys/random.h b/sys/cddl/compat/opensolaris/sys/random.h index 0cdea34a93d7..e0ecd9c8d4e9 100644 --- a/sys/cddl/compat/opensolaris/sys/random.h +++ b/sys/cddl/compat/opensolaris/sys/random.h @@ -32,6 +32,6 @@ #include_next #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_ */