예제 #1
0
int
random_get_pseudo_bytes(uint8_t *ptr, size_t len)
{
    // TODO find a better location for initialization
    if (-1==urandom_fd)
        VERIFY((urandom_fd = open("/dev/urandom", O_RDONLY)) != -1); // FIXME leaked fd

	return (random_get_bytes_common(ptr, len, urandom_fd));
}
예제 #2
0
int
random_get_pseudo_bytes(uint8_t *ptr, size_t len)
{
	return (random_get_bytes_common(ptr, len, "/dev/urandom"));
}