opnsense-ports/devel/electron32/files/patch-third__party_unrar_src_crypt.cpp
Franco Fichtner fd3bf1794a */*: sync with upstream
Taken from: FreeBSD
2024-09-23 09:02:17 +02:00

11 lines
429 B
C++

--- third_party/unrar/src/crypt.cpp.orig 2024-08-14 20:56:02 UTC
+++ third_party/unrar/src/crypt.cpp
@@ -116,6 +116,8 @@ void GetRnd(byte *RndBuf,size_t BufSize)
Success=CryptGenRandom(hProvider, (DWORD)BufSize, RndBuf) != FALSE;
CryptReleaseContext(hProvider, 0);
}
+#elif defined(__OpenBSD__)
+ arc4random_buf(RndBuf, BufSize);
#elif defined(_UNIX)
FILE *rndf = fopen("/dev/urandom", "r");
if (rndf!=NULL)