Commit 5545e33
authored
Fix fread check for reading randomness (#384)
* Fix fread check for reading randomness
Fallback CSPRNG on generic UNIX will read `urandom` for randomness. The read has a bug where if `fread` reads say 10 bytes but the size is 32. The buffer is only partially updated and returned successful.
This patch ensures the fallback read returns success only when the buffer is fully filled.
* Fix fread condition to check for equality
* Use microseconds1 parent 85245fa commit 5545e33
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
444 | | - | |
| 444 | + | |
445 | 445 | | |
446 | 446 | | |
447 | 447 | | |
| |||
533 | 533 | | |
534 | 534 | | |
535 | 535 | | |
536 | | - | |
| 536 | + | |
537 | 537 | | |
538 | | - | |
| 538 | + | |
539 | 539 | | |
540 | 540 | | |
541 | 541 | | |
| |||
0 commit comments