Commit c3f6099
INTERNAL: Try to generate passwords in a more secure way
The included unit test covers the code path that I haven't been able to reach on actual systems.
The `getrandom` system call will never block once the entropy pool has been initialized, which seems to happen before any of our code would ever run, probably due to only needing to collect 4096 bits of entropy, and modern CPUs having hardware random number seed generation. The RDRAND x86 instruction has been available since 2012 and the Linux kernel will use it to initialize the entropy pool.1 parent 3dc1890 commit c3f6099
2 files changed
Lines changed: 27 additions & 1 deletion
File tree
- common/src/stack/pylib/stack
- test-framework/test-suites/unit/tests/pylib/stack
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
19 | 33 | | |
20 | 34 | | |
21 | 35 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
0 commit comments