Changes between Initial Version and Version 1 of Ticket #14937
- Timestamp:
- Feb 28, 2019, 6:13:54 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #14937 – Description
initial v1 1 /dev/urandom on Haiku seems to only offer up small 16 byte chunks of entropy. This behaviour differs from other platforms. 1 /dev/urandom on Haiku seems to only offer up small 16 byte chunks of entropy. This behaviour differs from other platforms. I saw this while working on WireGuard under Haiku. 2 2 3 3 {{{ 4 5 4 #include <errno.h> 6 5 #include <stdio.h> … … 11 10 #include <fcntl.h> 12 11 #include <inttypes.h> 12 13 13 14 14 int … … 29 29 ssize_t remaining = len - ret; 30 30 ssize_t got = read(fd, key + ret, remaining); 31 32 fprintf(stdout, "Attempt %d: Got %d, giving %d total!\n", attempts, got, ret);33 31 ret += got; 34 32 if (attempts > 512) { … … 37 35 return -1; 38 36 } 37 fprintf(stdout, "Attempt %d: Got %d, giving %d total!\n", attempts, got, ret); 39 38 attempts++; 40 39 } … … 47 46 {{{ 48 47 ~> ./a.out 49 Attempt 0: Got 8, giving 0total!50 Attempt 1: Got 16, giving 8total!51 Attempt 2: Got 16, giving 24total!52 Attempt 3: Got 16, giving 40total!53 Attempt 4: Got 16, giving 56total!54 Attempt 5: Got 16, giving 72total!55 Attempt 6: Got 16, giving 88total!56 Attempt 7: Got 16, giving 1 04total!57 Attempt 8: Got 8, giving 12 0total!48 Attempt 0: Got 8, giving 8 total! 49 Attempt 1: Got 16, giving 24 total! 50 Attempt 2: Got 16, giving 40 total! 51 Attempt 3: Got 16, giving 56 total! 52 Attempt 4: Got 16, giving 72 total! 53 Attempt 5: Got 16, giving 88 total! 54 Attempt 6: Got 16, giving 104 total! 55 Attempt 7: Got 16, giving 120 total! 56 Attempt 8: Got 8, giving 128 total! 58 57 }}} 59 58 … … 61 60 {{{ 62 61 $ ./a.out 63 Attempt 0: Got 128, giving 0total!62 Attempt 0: Got 128, giving 128 total! 64 63 $ ./a.out 65 Attempt 0: Got 128, giving 0total!64 Attempt 0: Got 128, giving 128 total! 66 65 $ ./a.out 67 Attempt 0: Got 128, giving 0total!66 Attempt 0: Got 128, giving 128 total! 68 67 $ ./a.out 69 Attempt 0: Got 128, giving 0total!68 Attempt 0: Got 128, giving 128 total! 70 69 $ ./a.out 71 Attempt 0: Got 128, giving 0total!70 Attempt 0: Got 128, giving 128 total! 72 71 $ ./a.out 73 Attempt 0: Got 128, giving 0total!72 Attempt 0: Got 128, giving 128 total! 74 73 $ ./a.out 75 Attempt 0: Got 128, giving 0total!74 Attempt 0: Got 128, giving 128 total! 76 75 }}}