guenther
9475b44edc
From ISO/IEC 9899:1999 and 9899:201x,
6.11.5 - Storage-class specifiers:
The placement of a storage-class specifier other than at the
beginning of the declaration specifiers in a declaration is
an obsolescent feature.
Diff from Jean-Philippe Ouellet (jean-philippe (at) ouellet.biz)
10 years ago
deraadt
d107050d39
Demonstrate how new linux getrandom() will be called, at least until
it shows up in libraries. Even the system call is probably not finalized.
Bit dissapointed it has turned out to be a descriptor-less read() with
EINVAL and EINTR error conditions, but we can work with it.
10 years ago
deraadt
403b6a2c61
remove disabled main hook; we use phdr now; ok bcook
10 years ago
naddy
44b039650c
arc4random re-seeds with getentropy() now; ok deraadt@ jmc@
10 years ago
deraadt
2d56bb72a9
tab love
10 years ago
bcook
9b651cf7ae
Move _ARC4_ATFORK handlers from thread_private.h in portable.
10 years ago
bcook
b61a1138bd
move _ARC4_LOCK/UNLOCK primitives from thread_private into OS-specific modules
10 years ago
bcook
8a64d61e25
fixup typos
10 years ago
deraadt
884e90e06c
Change _rs_allocate so it can combine the two regions (rs and rsx)
into one if a system has an awesome getentropy(). In that case it
is valid to totally throw away the rsx state in the child. If the
getentropy() is not very good and has a lazy reseed operation, this
combining is a bad idea, and the reseed should probably continue to
use the "something old, something new" mix. _rs_allocate() can
accomodate either method, but not on the fly.
ok matthew
10 years ago
matthew
908da16e8c
Cleanup portable arc4random fork detection code:
1. Use "len" parameter instead of sizeof(*rs).
2. Simplify the atfork handler to be strictly async signal safe by
simply writing to a global volatile sig_atomic_t object, and then
checking for this in _rs_forkdetect(). (Idea from discussions with
Szabolcs Nagy and Rich Felker.)
3. Use memset(rs, 0, sizeof(*rs)) to match OpenBSD's MAP_INHERIT_ZERO
fork semantics to avoid any skew in behavior across platforms.
ok deraadt
10 years ago
matthew
c4eeb8ba1e
Remove "const" from the lsearch(3) manual's synopsis too.
Reminded by Rafael Neves
10 years ago
jmc
df5413a7ec
zap trailing whitespace;
10 years ago
matthew
3d494c5a79
Change lsearch()'s "base" argument to require a non-const pointer to
align with POSIX and other systems.
Pointed out by Elliott Hughes on tech
ok deraadt
10 years ago
deraadt
19c7eca85b
Seperate arc4random's os-dependent parts into static inline functions,
making it much easier for libressl -portable to fill in the gaps.
ok bcook beck
10 years ago
deraadt
e95464400c
it is 2014, and we still need to encourage people away from srand()
and random(). Sigh.
10 years ago
deraadt
a4e31d35a0
"Race-free because we're running single-threaded in a new
address space, and once allocated rs is never deallocated."
document the forkhandler to save reviewers time, with matthew
10 years ago
kettenis
2c152452b6
Only call getauxval(3) if HAVE_GETAUXVAL is defined. Fixes build on older
Linux (such as Ubuntu 12.04LTS) that don't have it yet. Seems the AT_XXX
defines are pulled in by <link.h> now.
ok beck@
10 years ago
deraadt
9c21f5c33d
#ifdef wrap the _rs_forkhandler
10 years ago
bcook
fca7f5a866
added handler for an atfork hook from kettenis@
ok deraadt@ beck@ kettenis@
10 years ago
tedu
1d810a359a
include stdint.h for standard ints. from Jean-Philippe Ouellet
10 years ago
tedu
37a5836398
oops, i deleted the wrong word
10 years ago
tedu
13ffbefb0f
remove a lie spotted by guenther
10 years ago
tedu
d3e68c8356
once srandomdev() is called, switch to using arc4random() but mask off the
high bit as required by posix. wouldn't want to break any standards.
idea and ok deraadt
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
6289d57278
While we thought this would make portable life easier it actually
makes it much harder.
ok bcook@ kettenis@
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
455c599158
getentropy on Windows. It compiles but has not been thoroughly tested yet.
OK: beck@
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
miod
9b1d48d8cc
Remove private_{Camellia,RC4}_set_key FIPS indirection tentacles, as has been
done for other symmetric algorithms recently.
10 years ago
deraadt
30150934f0
Wrap "thread_private.h" with #ifdef __OpenBSD__ so that other systems
can copy this file (plus chacha_private.h) directly and reuse it
trivially. Well, as long as they have a getentropy() as well..
ok beck
10 years ago
beck
279cc5b646
guard inclusion of sys/sysctl.h so we can detect at compile time and
keep linux distros happy that don't have it.
ok bcook@
10 years ago
deraadt
bf34b69892
remove gratuitous differences, ok beck
10 years ago
deraadt
96303f230c
remove gratuitous differences, ok beck bcook
10 years ago
deraadt
3f9dd576c8
Split arc4random_uniform into it's own file, to assist other projects
now using this as upstream code. The particular problem is systems
that contain older arc4random derivations lacking arc4random_uniform().
ok tedu miod
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
deraadt
25da0193d5
odds are that some ABI change occured today, no matter how careful everyone
is
10 years ago
tedu
5bee4066ca
i'm a dumbdumb. fix build.
10 years ago
tedu
447cee822e
move all the feature settings to a common header.
probably ok beck jsing miod
10 years ago
beck
2e9cadcb9c
Make sure we leave OPENSSL_NO_PSK in the conf files so things
can know...
ok jsing@
10 years ago
kettenis
78bf858a52
Add locking for __cxa_finalize() as it modifies the page permissions of the
__atexit tables and touches global variables. From Srinavasa Nagaraju
through Android/Elliott Hughes.
ok tedu@, guenther@
10 years ago
tedu
ae7f8bb30d
better document perils of setuid getenv and xr with issetugid
ok deraadt
10 years ago
tedu
beacb71783
as noted by google/android via kettenis, atexit handlers can install new
handlers. if this happens, restart the loop.
ok kettenis matthew millert miod
10 years ago
tedu
705f1bf46e
reduce obvious dependency on global g_pool by moving to local aliases
ok otto
10 years ago
naddy
33c9c303eb
rephrase the stpcpy() warning
new wording agreed by at least kettenis@ millert@ otto@
10 years ago
beck
97abe91297
Clean up after arc4random u_int32_t uint32_t change
ok jsing@
10 years ago
bcook
165f09edc7
changes to improve portability
ok beck@ deraadt@ jsing@ guenther@
10 years ago
bcook
a3816c6eb6
remove unused variables getentropy for OS X
ok beck@
10 years ago
miod
32c03af696
RSA_NULL used to be a compile option allowing the RSA interfaces to be
compiled-in, with nonfunctional code, to be able to cope with the RSA
patent.
However, we don't use this option, and the RSA patent has expired more than 10
years ago, so just drop this piece.
10 years ago
miod
892a9183d4
Remove undocumented _des_crypt() interface and its companion header file,
which had never been installed, so it's unlikely something ever used this
in the last 15~20 years.
ok deraadt@ jsing@ beck@
10 years ago