Hash :
2d08d875
Author :
Date :
2024-11-17T13:05:55
doc: Prefer https urls where possible. * doc/gnulib.texi (POSIXURL): Use https url. * doc/multithread.texi: Use https instead of http where possible. * doc/glibc-functions/*.texi: Likewise. * doc/posix-functions/*.texi: Likewise. * lib/glthread/lock.c: Likewise. * lib/hamt.h: Likewise. * lib/localcharset.c: Likewise. * lib/pipe2.c: Likewise. * lib/pipe.c: Likewise. * lib/sigsegv.c: Likewise. * lib/sigsegv.in.h: Likewise. * lib/sm3.c: Likewise. * lib/sm3.h: Likewise. * lib/sm3-stream.c: Likewise. * lib/stackvma.c: Likewise. * lib/stdio-impl.h: Likewise. * lib/stdnoreturn.in.h: Likewise. * m4/getopt.m4: Likewise. * m4/largefile.m4: Likewise. * m4/stdalign.m4: Likewise. * STATUS-libposix: Likewise. * tests/test-float.c: Likewise. * tests/test-getopt.h: Likewise. * tests/test-setenv.c: Likewise. * tests/test-spawn-pipe-child.c: Likewise. * tests/test-strerror.c: Likewise. * tests/test-strerror_r.c: Likewise. * tests/test-unsetenv.c: Likewise. * users.txt: Likewise.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
@node getentropy
@subsection @code{getentropy}
@findex getentropy
POSIX specification:@* @url{https://pubs.opengroup.org/onlinepubs/9799919799/functions/getentropy.html}
Documentation:
@itemize
@item
@ifinfo
@ref{Unpredictable Bytes,,Generating Unpredictable Bytes,libc},
@end ifinfo
@ifnotinfo
@url{https://www.gnu.org/software/libc/manual/html_node/Unpredictable-Bytes.html},
@end ifnotinfo
@item
@uref{https://www.kernel.org/doc/man-pages/online/pages/man3/getentropy.3.html,,man getentropy}.
@end itemize
Gnulib module: getentropy
@mindex getentropy
Portability problems fixed by Gnulib:
@itemize
@item
This function is missing on some platforms:
glibc 2.24, Mac OS X 10.11, FreeBSD 11.0, NetBSD 9.3, OpenBSD 5.5, Minix 3.3, AIX 7.1, HP-UX 11.31, Solaris 11.0, Cygwin 1.7.x, mingw, MSVC 14, Android 8.1.
@item
This function is declared in @code{<sys/random.h>}, not in @code{<unistd.h>},
on some platforms:
macOS 14, Solaris 11.4, Android 9.0.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@end itemize
@noindent
Although this function is intended to produce random data, the data's
security properties may not be appropriate for your application.
For example, identical ``random'' data streams might be produced by
rebooted virtual machines. If this is of concern you may need to use
additional techniques such as hedging.@footnote{Ristenpart T, Yilek
S@. @url{https://pages.cs.wisc.edu/~rist/papers/sslhedge.pdf, When good
randomness goes bad: virtual machine vulnerabilities and hedging
deployed cryptography}. NDSS 2010.}
@mindex getrandom
@mindex crypto/gc-random
Related modules include @code{getrandom}, which has a more-flexible
but more-complex API, and @code{crypto/gc-random}, which is likely a
better match for code already using the other @code{crypto} APIs.