From 66c1d05b38aa3cbfdce71a5a1a4ad7ab85fe4ceb Mon Sep 17 00:00:00 2001 From: espie Date: Fri, 22 Mar 2019 12:39:42 +0000 Subject: that "device" is an abstraction to the underlying OS PRNG. In OpenBSD's case, we know it has optimal entropy properties, so just say so. okay mikeb@, "why not" deraadt@ --- lib/libcxx/src/random.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/libcxx/src/random.cpp') diff --git a/lib/libcxx/src/random.cpp b/lib/libcxx/src/random.cpp index 4a2468368d0..9efac7a66a7 100644 --- a/lib/libcxx/src/random.cpp +++ b/lib/libcxx/src/random.cpp @@ -34,6 +34,7 @@ #include #endif +#include _LIBCPP_BEGIN_NAMESPACE_STD @@ -173,7 +174,11 @@ random_device::operator()() double random_device::entropy() const _NOEXCEPT { +#ifdef __OpenBSD__ + return std::numeric_limits::digits; +#else return 0; +#endif } _LIBCPP_END_NAMESPACE_STD -- cgit v1.2.3-59-g8ed1b