Commit Graph

27 Commits

Author SHA1 Message Date
Brent Cook
466e389d3f check linker flags before checking for functions 2016-04-24 03:29:14 -05:00
Brent Cook
d4d040c171 add things to minimize diffs with OpenNTPD-portable 2016-02-15 13:39:06 -06:00
Brent Cook
35e669fd1a whitelist NetBSD 7.0 native arc4random(3) implementation.
NetBSD 7 improves arc4random(3) over earlier versions by adding fork
detection, stronger assertions on seed failure.
2016-01-03 21:24:05 -06:00
Brent Cook
d0009039de enable nc on AIX 2016-01-03 21:20:03 -06:00
Brent Cook
53cd105d6e update check for b64_ntop
typo spotted by Jonas 'Sortie' Termansen
2015-12-27 22:12:35 -06:00
Brent Cook
4db1ad6797 installing nc(1) should imply building, even if not whitelisted 2015-12-07 08:24:41 -06:00
Brent Cook
7a82b7c0fd build nc on solaris and cygwin 2015-11-23 02:07:23 -06:00
Brent Cook
24b5a96a7c whitelist nc on other BSDs 2015-10-23 16:19:07 -07:00
Brent Cook
a45e38e962 disable some tests with 32-bit time_t systems
Also disable use of _mkgmtime, it does not produce correct results.
2015-10-17 22:57:59 -05:00
Brent Cook
4298ac9305 include timegm fallback 2015-10-15 09:16:38 -05:00
Brent Cook
ff52e6f4e3 check for pledge(2) 2015-10-12 15:34:03 -05:00
Brent Cook
442cc6f1b4 add tame(2) check 2015-10-07 08:55:05 -05:00
Brent Cook
a7f031ba55 add b64_ntop checking and fallback for nc(1) 2015-10-01 07:40:26 -05:00
Brent Cook
497a47c5fc remove incorrect comment
We actually want to only start extending CFLAGS after calling AC_PROG_CC
so we get the default autoconf value (usually just -O2).
2015-09-30 08:00:49 -05:00
Brent Cook
8c90be2a29 allow nc to build on linux and os x 2015-09-13 18:42:15 -05:00
Brent Cook
a787f964a1 restrict nc to openbsd builds for now 2015-09-12 10:51:11 -05:00
kinichiro
9aa4e1d960 disable strict aliasing on HP-UX C/aC++ compiler
to disable strict aliasing on HP-UX C/aC++, `+Otype_safety=off` is right.
`+Otype_safety=strong` forces ANSI aliasing.
2015-08-04 19:08:42 +09:00
Brent Cook
5d8a1cf715 add initial CMake and Visual Studio build support
This moves the compatibility include files from include to
include/compat so we can use the awful MS C compiler
<../include/> trick to emulate the GNU #include_next extension.

This also removes a few old compat files we do not need anymore.
2015-07-21 12:08:18 -05:00
Brent Cook
b9291face3 disable strict aliasing on AIX xlc and HP-UX aC++ compilers 2015-07-16 11:34:07 -05:00
Brent Cook
c1a162d83b disable strict aliasing by default, noticed by miod@ 2015-07-15 20:24:05 -05:00
Brent Cook
545454277a add check for inet_pton, nudge minimum win32 compat to 0x0501 2015-07-02 00:19:53 -05:00
Brent Cook
b091d23685 fix libtool 2.4.2 stack-protector flag handling
Teach libtool 2.4.2 how to pass -fstack-protector* to the linker so
libssp is properly linked in on some toolchains. See upstream patch:
https://github.com/instantinfrastructure/poky-daisy/blob/master/meta/recipes-devtools/libtool/libtool/respect-fstack-protector.patch

Thanks to kinichiro inoguchi
2015-06-13 22:26:58 -05:00
Brent Cook
04a8eca5d3 always check if ssp needs to be linked 2015-06-11 08:47:12 -05:00
Brent Cook
edfc569005 fix definition of DISABLE_AS_EXECUTABLE_STACK 2015-05-23 19:27:57 -05:00
Brent Cook
d3771a41cb refactor configure into separate m4 macros
this allows for some reusability with libtls
2015-05-23 19:27:57 -05:00
Brent Cook
303b972d55 simplify hardening check logic, disable for mingw
Rather than doing separate linker/compiler checks, just build a
non-empty program with each so that the compiler will actually try to
use the hardening features. Reduce redundancy in the macro calls by just
setting the flag that was just tested.

Also, disable hardening for mingw, since its trying to use a
libssp-0.dll file that I can't find right now. The detected hardening
flags break mingw builds currently.
2015-01-05 20:23:48 -06:00
Jim Barlow
a6c072343a configure.ac: use executable hardening where available
Where available, enable stack smashing protection, fortify source,
no-strict-overflow, and read only relocations.

Many Linux distributions automatically enable most of these options.
They are no brainers. The difference introduced here is in asking for a
few more aggressive options. An option to disable the more aggressive
options is provided (--disable-hardening). When set, configure will fall
back to the default CFLAGS on the system - in many cases that will still
be hardened. There is no point in going further than that.

Options enabled are:

-fstack-protector-strong is a relatively new GCC-4.9 feature that is
supposed to give a better balance between performance and protection.
-all is considered too aggressive, but was used in Chromium and other
security critical systems until -strong became available. Follow their
lead and use -strong when possible. clang 6.0 supports -all but not
-strong.

_FORTIFY_SOURCE replaces certain unsafe C str* and mem* functions with
more robust equivalents when the compiler can determine the length of
the buffers involved.

-fno-strict-overflow instructs GCC to not make optimizations based on
the assumption that signed arithmetic will wrap around on overflow (e.g.
(short)0x7FFF + 1 == 0). This prevents the optimizer from doing some
unexpected things. Further improvements should trap signed overflows and
reduce the use of signed to refer to naturally unsigned quantities.

I did not set -fPIE (position independent executables). The critical
function of Open/LibreSSL is as a library, not an executable.

Tested on Ubuntu Linux 14.04.1 LTS, OS X 10.10.1 with "make check".

Signed-off-by: Jim Barlow <jim@purplerock.ca>
2014-12-23 05:24:24 -08:00