deraadt
5e398339ba
As done everywhere else, use a local version of MINIMUM() and avoid
conflict against a potential define min() from some other scope.
4 years ago
deraadt
cc1a839b83
Saw a mention somewhere a while back that the gotdata() function in
here could creates non-uniformity since very short fetches of 0 would
be excluded. blocks of 0 are just as random as any other data, including
blocks of 4 4 4.. This is a misguided attempt to identify errors from the
entropy churn/gather code doesn't make sense, errors don't happen.
ok bcook
5 years ago
tb
646f43cf69
Update the link for the getentropy(2) manual to man.openbsd.org/
ok deraadt@
8 years ago
deraadt
31a603a934
unify files further
8 years ago
deraadt
8e631f698c
unify versions, so they are easier to diff.
8 years ago
bcook
bfaebb4169
mix in more virtual memory and process information
9 years ago
bcook
015bfd5abc
add initial HP-UX getentropy/arc4random support.
patch from Kinichiro Inoguchi, tested on HP-UX 11.31
ok deraadt@
9 years ago
guenther
6fd1ff93b6
Use explicit_bzero() instead of memset() on buffers going out of scope.
Also, zero the SHA256 context.
suggested by "eric" in a comment on an opensslrampage.org post
ok miod@ deraadt@
10 years ago
deraadt
403b6a2c61
remove disabled main hook; we use phdr now; ok bcook
10 years ago
deraadt
1efcd9909f
Use dl_iterate_phdr() to iterate over the segments and throw the addresses
into the hash; hoping the system has some ASLR or PIE. This replaces and
substantially improves upon &main which proved problematic with some picky
linkers.
Work with kettenis, testing by beck
10 years ago
deraadt
757bd836f8
Provide a link to the canonical API specification.
ok beck
10 years ago
beck
7f965a2eac
Take away the use of the address of main as a source of entropy. Causes
distractions to people testing and seeing link errors in some setups.
This will come back in another form
ok deraadt@
10 years ago
wouter
ca0c9eb852
Remove signed/unsigned warning, statement before declaration and
add a function to use function pointers that does not take sizeof(fptr).
OK beck@
10 years ago
deraadt
96303f230c
remove gratuitous differences, ok beck bcook
10 years ago
beck
a99ff4bd9f
Solaris uses a symbolic link for /dev/urandom which harms best practice of
using O_NOFOLLOW - cope with it as best as possible by trying two
different paths. - written by deraadt@ and kettenis@
10 years ago
beck
91875b6d33
getentropy for osx and solaris. will be needed for a portable release
10 years ago
beck
b7e16f9d19
fix oops, accidental delete.. darn copying of files between machines
10 years ago
beck
8de43bf12f
j should be an int, like repeat
10 years ago
beck
287fe24a2f
unbreak last commit - but same intent, make re-seed less expensive
10 years ago
deraadt
bc5b290d46
repeat calls to getentrypy() with the same pid likely indicate reseeds.
Since we assume the PRNG above is doing "something old, something new"
folding, shortcut and do fewer repeats through the timing loop.
ok beck
10 years ago
deraadt
0dedf80951
fix HD() misuse; from brent cook
10 years ago
beck
344e312a56
AT_BASE returns us the *address* of the start of ld.so, so
use the address, not what it points to (which is always the same)
ok deraadt@
10 years ago
beck
aed4dc98fb
get the page of data at AT_SYSINFO_EHDR
ok deraadt@
10 years ago
beck
802d41544e
comment fixes from theo
10 years ago
beck
eaa7e91438
Possibly obtain a little bit of entropy from addresses returned
by getauxval if we have it.
ok deraadt@
10 years ago
beck
839b9ab79f
O_NOFOLLOW would be very nice to have here if the version of linux
we are running supports it.
from enh@google.com
10 years ago
beck
dca54ba442
unbreak build of getentropy_sysctl - we need linux/sysctl.h, and
RANDOM_UUID is an enum member.
10 years ago
beck
13d2b96f86
unbreak - main needs to be extern in here somewhere.
10 years ago
deraadt
40d09112d0
repair indentation for an inner loop; shorten some macros and variable
names to shorten line lengths
ok beck
10 years ago
deraadt
7eb671100b
hash in correct pointer
10 years ago
beck
ac370875b0
KNF
10 years ago
deraadt
8f4e03ef5a
indent
10 years ago
otto
1878cbb6e4
rearrange so that the main function with the important comments is at the top
ok deraadt@ beck@
10 years ago
beck
a1d1946997
Work in progress on how to deal with the inherit unreliability of
/dev/urandom. Does well in the fallback case. Get it in tree so
it can be worked on.
ok otto@ deraadt@
10 years ago