diff options
Diffstat (limited to 'www/chromium/files/patch-base_rand__util__posix.cc')
-rw-r--r-- | www/chromium/files/patch-base_rand__util__posix.cc | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/www/chromium/files/patch-base_rand__util__posix.cc b/www/chromium/files/patch-base_rand__util__posix.cc index 2fdaf4b8cc62..47e1b91ef1ad 100644 --- a/www/chromium/files/patch-base_rand__util__posix.cc +++ b/www/chromium/files/patch-base_rand__util__posix.cc @@ -1,15 +1,15 @@ ---- base/rand_util_posix.cc.orig 2025-05-05 10:57:53 UTC +--- base/rand_util_posix.cc.orig 2025-08-07 06:57:29 UTC +++ base/rand_util_posix.cc -@@ -29,7 +29,7 @@ - #include "base/time/time.h" +@@ -30,7 +30,7 @@ #include "build/build_config.h" + #include "third_party/boringssl/src/include/openssl/rand.h" --#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !BUILDFLAG(IS_NACL) -+#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !BUILDFLAG(IS_BSD) #include "third_party/lss/linux_syscall_support.h" #elif BUILDFLAG(IS_MAC) // TODO(crbug.com/40641285): Waiting for this header to appear in the iOS SDK. -@@ -45,6 +45,7 @@ namespace base { +@@ -42,6 +42,7 @@ namespace base { namespace { @@ -17,28 +17,26 @@ #if BUILDFLAG(IS_AIX) // AIX has no 64-bit support for O_CLOEXEC. static constexpr int kOpenFlags = O_RDONLY; -@@ -69,10 +70,11 @@ class URandomFd { +@@ -66,8 +67,9 @@ class URandomFd { private: const int fd_; }; +#endif - #if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ - BUILDFLAG(IS_ANDROID)) && \ -- !BUILDFLAG(IS_NACL) -+ !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) ++#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)) && !BUILDFLAG(IS_BSD) bool KernelSupportsGetRandom() { return base::SysInfo::KernelVersionNumber::Current() >= -@@ -129,6 +131,7 @@ bool UseBoringSSLForRandBytes() { +@@ -122,6 +124,7 @@ bool UseBoringSSLForRandBytes() { namespace { void RandBytesInternal(span<uint8_t> output, bool avoid_allocation) { +#if !BUILDFLAG(IS_BSD) - #if !BUILDFLAG(IS_NACL) // The BoringSSL experiment takes priority over everything else. if (!avoid_allocation && internal::UseBoringSSLForRandBytes()) { -@@ -163,6 +166,9 @@ void RandBytesInternal(span<uint8_t> output, bool avoi + // BoringSSL's RAND_bytes always returns 1. Any error aborts the program. +@@ -152,6 +155,9 @@ void RandBytesInternal(span<uint8_t> output, bool avoi const int urandom_fd = GetUrandomFD(); const bool success = ReadFromFD(urandom_fd, as_writable_chars(output)); CHECK(success); @@ -48,7 +46,7 @@ } } // namespace -@@ -182,9 +188,11 @@ void RandBytes(span<uint8_t> output) { +@@ -171,9 +177,11 @@ void RandBytes(span<uint8_t> output) { RandBytesInternal(output, /*avoid_allocation=*/false); } |