Commit Graph

299 Commits

Author SHA1 Message Date
Bob Beck
3e21619bcf Crank version on HEAD to 2.1.0 2.0 cointinues on OPENBSD_5_6 branch 2014-07-31 18:53:48 -06:00
Brent Cook
105da446ba define MAP_ANON for systems with MAP_ANONYMOUS
switch the sense of this check
2014-07-30 22:16:01 -05:00
Brent Cook
8d89fb071c merge endian definitions between AIX/HP-UX/Solaris 2014-07-30 07:12:42 -05:00
inoguchi
ff58a2e3cb update include/machine/endian.h for hpux portability.
ok bcook@
2014-07-30 07:12:36 -05:00
Brent Cook
b9ff0728e1 harmonize asprintf with OpenSSH
* use the original name for the file from OpenSSH (remove duplicate version)
 * add va_copy/__va_copy checks to configure
 * incorporate proposed fixes to openssh version:
   + include more system headers directly for various definitions
   + limit the scope of va_copy/va_end to their affected vsnprintf calls
   + simplify error handling, removing a dead assignment
2014-07-30 06:53:02 -05:00
Brent Cook
a07e337020 include comment on windows services 2014-07-29 18:21:58 -05:00
Brent Cook
af705b3f7d add sys/mman.h shim to define MAP_ANON if needed
thanks to kinichiro for pointing this out

ok deraadt@ beck@
2014-07-29 11:17:48 -05:00
Brent Cook
983103b0db stub win32 issetugid implementation
ok deraadt@ beck@
2014-07-29 11:17:44 -05:00
Brent Cook
46dd7aac40 added dist.sh script - generates tarball
ok deraadt@ beck@
2014-07-29 11:17:32 -05:00
Brent Cook
d328203f63 produce a error if platform has no arc4random hook
ok deraadt@ beck@
2014-07-29 11:17:27 -05:00
Brent Cook
35e2d8d048 add asprintf / vasprintf from OpenSSH portable
ok deraadt@ beck@
2014-07-29 11:17:22 -05:00
pgmassey
02ad0041c4 Update endian.h for AIX/IRIX
Added AIX/IRIX compatibility for endian detection.

ok bcook@ deraadt@ beck@
2014-07-29 11:17:18 -05:00
Brent Cook
981fc3618a Guard individual compatibility header prototypes.
This is to avoid redefining prototypes from the libc headers. Also,
simplify the autoconf function checks and remove some copy/paste
errors checking for 'write'.

ok wouter@
2014-07-28 13:52:07 -05:00
Brent Cook
cd168d519b split big line 2014-07-28 07:50:48 -05:00
Brent Cook
e48e4f0e69 prefer - over /dev/stdin for cmp test 2014-07-28 07:26:42 -05:00
Brent Cook
f8195c9c22 check link requirements for dl_iterate_phdr
Note that gcc chose to disable this rather than cause link issues with
older copies of Solaris 10:
https://gcc.gnu.org/ml/gcc-patches/2012-01/msg00816.html

If we want to support Solaris <10.10 (I'd rather support up-to-date
versions), getentropy_solaris would need to change.
2014-07-28 07:26:42 -05:00
Brent Cook
1b62d5e416 remove bash-isms from test scripts 2014-07-28 07:26:27 -05:00
Brent Cook
0a74a4d464 add strndup/strnlen compat functions from OpenBSD 2014-07-28 07:07:23 -05:00
Brent Cook
fb67b92eb2 include system headers for err.h compat macros 2014-07-28 07:07:23 -05:00
Brent Cook
6383a0722c remove thread_private.h, no longer needed 2014-07-27 06:09:51 -05:00
Brent Cook
a5c82283e0 remove per-OS arc4random_buf overrides
If an OS provides an arc4random_buf implementation in its C library,
prefer it over an in-library version. This allows OS-specific
implementations to become more robust over time. It also prevents
possible link-time confusion as to which arc4random_buf implementation
is in use by an application when linked with LibreSSL.

The built-in unit tests will identify some common issues, such as fork
safety and PID wrap handling. Other elements, such as seeding
mechanisms, should be audited by the vendor or user for correctness.

ok deraadt@ beck@
2014-07-24 21:36:38 -05:00
Brent Cook
55d07e70dc clarify license and origin for pidwraptest
The original author clarified the license, so we are fine to ship with
the PID wraparound test. Run it by default if libressl is using the
native arc4random supplied from the OS.

ok deraadt@
2014-07-23 20:10:17 -05:00
Bob Beck
8bf6bdeba4 add calloc to the list (integer overflow..) 2014-07-21 21:07:26 -06:00
Bob Beck
ee6e88285a Update README to indicate general policy about intrinsics 2014-07-21 21:02:21 -06:00
Brent Cook
dd883345d3 bump version 2014-07-21 20:36:14 -05:00
Brent Cook
ea6e7116c9 build openbsd memmem implementation for explicit_bzero test
memmem is not always available, and not all memmem's work the same way

ok beck@ guenther@
2014-07-21 20:29:49 -05:00
Brent Cook
451dbd967c compute absolute paths to source
removes relative path hackery

ok beck@ guenther@
2014-07-21 20:27:14 -05:00
Brent Cook
33bc05ca9c better handle disabled tests and exclude files
ok beck@ guenther@
2014-07-21 20:27:14 -05:00
Brent Cook
23dc97f8c2 rename local tests to end in test.c
ok beck@ guenther@
2014-07-21 19:54:21 -05:00
Brent Cook
f425f564d5 test for and use system explicit_bzero if it exists
ok beck@ guenther@
2014-07-21 19:54:07 -05:00
Brent Cook
0ec7cdcbad include err.h shim
Includes compatible replacements, or uses system err.h if available.

ok beck@ guenther@
2014-07-21 19:53:53 -05:00
Brent Cook
4335a49f51 use correct link order for app and tests
ok beck@ guenther@
2014-07-21 19:53:52 -05:00
Brent Cook
8a44ab84f0 preserve timestamps on copy from upstream checkout
this saves time on rebuilds when testing tarballs

ok beck@ guenther@
2014-07-21 19:53:28 -05:00
Brent Cook
f4d98ff1b2 conditionally disable -Wpointer-sign where supported
ok beck@
2014-07-20 16:30:56 -05:00
Brent Cook
136ddd7a9b update guard, add win32 support for endian.h
Thanks to Jonas 'Sortie' Termansen for pointing the guard inconsistency out.

ok beck@
2014-07-20 16:30:50 -05:00
Brent Cook
9c2c499bf3 Use correct static link order for unit tests.
thanks to Jonas 'Sortie' Termansen

ok beck@
2014-07-20 16:30:44 -05:00
Brent Cook
237250e07a include <_bsd_types.h> on MinGW
ok beck@
2014-07-20 16:30:38 -05:00
Brent Cook
edebb7a66e remove thread_private.h defines, moved to arc4random_*.h 2014-07-19 10:49:08 -05:00
Brent Cook
1b1bce16b1 update to newly-refactored arc4random compatibility shims
the thread-private bits can move next

ok beck@
2014-07-18 09:19:23 -05:00
Brent Cook
d697fdb4af initial underpinnings for mingw/cross compilation support
Use canonical host rather than target so that this works:
 CC=i686-w64-mingw32-gcc ./configure --host=i686-w64-mingw32

 Conditionally compile Linux issetugid compatibility function

ok beck@
2014-07-18 09:19:17 -05:00
Brent Cook
0bc4bdde5f move fork_rand.sh so it does not get run every time
the test takes many minutes to run on an OS with a slow fork() call

ok beck@
2014-07-15 17:22:39 -05:00
Brent Cook
d3746d3a6e indicate failure to the test harness
ok beck@
2014-07-15 17:20:09 -05:00
Brent Cook
477f1f0187 added fork_rand test to check for PID wraparound
ok beck@
2014-07-15 16:43:00 -05:00
Bob Beck
c41fb098b9 crank version 2014-07-15 20:14:37 -06:00
Brent Cook
32d9eeeecf register the atfork handler from arc4random
From kettenis@

People have suggested using pthread_atfork(3) before, but discarded
the idea because it involves linking with -lpthread, which has other
undesirable consequences.  However:

* Most systems actually have pthread_atfork(3) in libc.  I verified
  this on OS X and Solaris.  I believe this is the case on Linux
  systems that use musl as well.

* On Linux systems that use glibc, this isn't the case.  However,
  those systems have __register_atfork(3), which is fully documented
  in the "Linux Standard Base Core Specification".

ok kettenis@ deraadt@ beck@
2014-07-15 14:50:05 -05:00
Brent Cook
7f2fab20bc enable the asn1 test 2014-07-15 14:49:34 -05:00
Bob Beck
c5c2aa37be Add the public signing key so it can be fetched from github 2014-07-14 20:50:52 -06:00
Mark Kettenis
bbd51d0e32 give section 1 man pages a .1 suffix instead of .3
ok beck@
2014-07-14 16:09:18 +02:00
Mark Kettenis
687a2966ba remove stray brackets in --with-enginesdir/openssldir support
ok beck@
2014-07-14 15:43:18 +02:00
Brent Cook
7a9aa4dd7e use generic test for clock_gettime flags
ok beck@
2014-07-12 10:08:39 -05:00