Changes between Initial Version and Version 1 of Ticket #14937


Ignore:
Timestamp:
Feb 28, 2019, 6:13:54 PM (6 years ago)
Author:
kallisti5
Comment:

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.
    22
    33{{{
    4 
    54#include <errno.h>
    65#include <stdio.h>
     
    1110#include <fcntl.h>
    1211#include <inttypes.h>
     12
    1313
    1414int
     
    2929                ssize_t remaining = len - ret;
    3030                ssize_t got = read(fd, key + ret, remaining);
    31 
    32                 fprintf(stdout, "Attempt %d: Got %d, giving %d total!\n", attempts, got, ret);
    3331                ret += got;
    3432                if (attempts > 512) {
     
    3735                        return -1;
    3836                }
     37                fprintf(stdout, "Attempt %d: Got %d, giving %d total!\n", attempts, got, ret);
    3938                attempts++;
    4039        }
     
    4746{{{
    4847~> ./a.out
    49 Attempt 0: Got 8, giving 0 total!
    50 Attempt 1: Got 16, giving 8 total!
    51 Attempt 2: Got 16, giving 24 total!
    52 Attempt 3: Got 16, giving 40 total!
    53 Attempt 4: Got 16, giving 56 total!
    54 Attempt 5: Got 16, giving 72 total!
    55 Attempt 6: Got 16, giving 88 total!
    56 Attempt 7: Got 16, giving 104 total!
    57 Attempt 8: Got 8, giving 120 total!
     48Attempt 0: Got 8, giving 8 total!
     49Attempt 1: Got 16, giving 24 total!
     50Attempt 2: Got 16, giving 40 total!
     51Attempt 3: Got 16, giving 56 total!
     52Attempt 4: Got 16, giving 72 total!
     53Attempt 5: Got 16, giving 88 total!
     54Attempt 6: Got 16, giving 104 total!
     55Attempt 7: Got 16, giving 120 total!
     56Attempt 8: Got 8, giving 128 total!
    5857}}}
    5958
     
    6160{{{
    6261$ ./a.out
    63 Attempt 0: Got 128, giving 0 total!
     62Attempt 0: Got 128, giving 128 total!
    6463$ ./a.out
    65 Attempt 0: Got 128, giving 0 total!
     64Attempt 0: Got 128, giving 128 total!
    6665$ ./a.out
    67 Attempt 0: Got 128, giving 0 total!
     66Attempt 0: Got 128, giving 128 total!
    6867$ ./a.out
    69 Attempt 0: Got 128, giving 0 total!
     68Attempt 0: Got 128, giving 128 total!
    7069$ ./a.out
    71 Attempt 0: Got 128, giving 0 total!
     70Attempt 0: Got 128, giving 128 total!
    7271$ ./a.out
    73 Attempt 0: Got 128, giving 0 total!
     72Attempt 0: Got 128, giving 128 total!
    7473$ ./a.out
    75 Attempt 0: Got 128, giving 0 total!
     74Attempt 0: Got 128, giving 128 total!
    7675}}}