We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0b01935 commit 077d01fCopy full SHA for 077d01f
src/random.cpp
@@ -227,10 +227,12 @@ void GetOSRand(unsigned char *ent32)
227
RandFailure();
228
}
229
230
-#elif defined(HAVE_GETENTROPY)
+#elif defined(HAVE_GETENTROPY) && defined(__OpenBSD__)
231
/* On OpenBSD this can return up to 256 bytes of entropy, will return an
232
* error if more are requested.
233
* The call cannot return less than the requested number of bytes.
234
+ getentropy is explicitly limited to openbsd here, as a similar (but not
235
+ the same) function may exist on other platforms via glibc.
236
*/
237
if (getentropy(ent32, NUM_OS_RANDOM_BYTES) != 0) {
238
0 commit comments