-
Notifications
You must be signed in to change notification settings - Fork 8k
Commit 57b362b
random: Do not trust arc4random_buf() on glibc (#10390)
This effectively reverts #8984.
As discussed in #10327 which will enable the use of the getrandom(2) syscall on
NetBSD instead of relying on the userland arc4random_buf(), the CSPRNG should
prioritize security over speed [1] and history has shown that userland
implementations unavoidably fall short on the security side. In fact the glibc
implementation is a thin wrapper around the syscall due to security concerns
and thus does not provide any benefit over just calling getrandom(2) ourselves.
Even without any performance optimizations the CSPRNG should be plenty fast for
the vast majority of applications, because they often only need a few bytes of
randomness to generate a session ID. If speed is desired, the OO API offers
faster, but non-cryptographically secure engines.1 parent 8173205 commit 57b362b
2 files changed
+4
-1
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 | + | ||
12 | + | ||
13 | + | ||
11 | 14 |
| |
12 | 15 |
| |
13 | 16 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
505 | 505 |
| |
506 | 506 |
| |
507 | 507 |
| |
508 | - | ||
508 | + | ||
509 | 509 |
| |
510 | 510 |
| |
511 | 511 |
| |
|
0 commit comments