summaryrefslogtreecommitdiff
path: root/www/chromium/files/patch-third__party_sqlite_src_amalgamation_sqlite3.c
blob: fe8a5aad6c53ac0fb57989bdc4178359054c7b5e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--- third_party/sqlite/src/amalgamation/sqlite3.c.orig	2022-09-14 21:13:04 UTC
+++ third_party/sqlite/src/amalgamation/sqlite3.c
@@ -42109,7 +42109,12 @@ static int unixRandomness(sqlite3_vfs *NotUsed, int nB
   memset(zBuf, 0, nBuf);
   randomnessPid = osGetpid(0);
 #if !defined(SQLITE_TEST) && !defined(SQLITE_OMIT_RANDOMNESS)
+#if defined(__OpenBSD__)
   {
+    arc4random_buf(zBuf, nBuf);
+  }
+#else
+  {
     int fd, got;
     fd = robust_open("/dev/urandom", O_RDONLY, 0);
     if( fd<0 ){
@@ -42124,6 +42129,7 @@ static int unixRandomness(sqlite3_vfs *NotUsed, int nB
       robust_close(0, fd, __LINE__);
     }
   }
+#endif
 #endif
   return nBuf;
 }