Martin Willi [Tue, 19 Nov 2013 17:40:51 +0000 (18:40 +0100)]
backtrace: Support backtraces on Windows without DbgHelp
While DbgHelp provides a convenient API to create backtraces, any executable
linking against DbgHelp gets a more than a significant slow down. Further, it
can only lookup global symbols, as it expects PDB files we can't produce with a
MinGW build.
With some core Kernel32.dll functionality, we can capture stack traces much
faster. Together with the optional libbfd, we can print very fine backtraces.
When --enable-bfd-backtraces is used on Windows, a libbfd.dll is required for
the build. Such a DLL can be created from the binutils sources using:
# build binutils with mingw...
# extract archive members from binutils libraries
x86_64-w64-mingw32-ar x $BINUTILS/bfd/.libs/libbfd.a
x86_64-w64-mingw32-ar x $BINUTILS/intl/libintl.a
x86_64-w64-mingw32-ar x $BINUTILS/libiberty/libiberty.a
# create self-contained libbfd.a, with index
x86_64-w64-mingw32-ar qs libbfd.a *.o
Tobias Brunner [Mon, 19 May 2014 12:53:24 +0000 (14:53 +0200)]
pfkey: Always include stdint.h
On some systems (e.g. on Debian/kFreeBSD) that header is required when
including ipsec.h, on Linux we require it too when including pfkeyv2.h,
so to simplify things we just always include it.
Tobias Brunner [Fri, 9 May 2014 16:44:17 +0000 (18:44 +0200)]
unit-tests: Allow some HTTP write operations to fail
Because CURLOPT_FAILONERROR is enabled in the curl plugin an error code
will often (not always) cause the client to close the TCP connection
before the server has written the complete response.
Tobias Brunner [Fri, 9 May 2014 15:42:37 +0000 (17:42 +0200)]
unit-tests: Defer failures by worker threads
In some cases the main thread is not ready to immediately call siglongjmp(),
e.g. if it currently holds a mutex that is later required during
shutdown.
Therefore, we delay handling errors in worker threads until the main
thread performs the next check itself (or the test function ends).
Tobias Brunner [Fri, 9 May 2014 11:28:06 +0000 (13:28 +0200)]
unit-tests: Make sure plugins in the builddir are loaded
When running the tests in GDB the working directory apparently is
different. With the relative path used previously the plugins would not
be found and those installed on the system would get used.
Martin Willi [Fri, 16 May 2014 14:54:04 +0000 (16:54 +0200)]
Merge branch 'aead-proposal'
Encode default AEAD encryption algorithms to a proposal separate from non-AEAD
algorithms. RFC 4306 and 5282 where less explicit, but RFC 5996 requires
separate proposals for AEAD and non-AEAD algorithms. As responder we still
accept both encoding variants.
Martin Willi [Thu, 24 Apr 2014 12:28:57 +0000 (14:28 +0200)]
ike: Add an additional but separate AEAD proposal to CHILD config
This currently has no effect: We don't include AEAD algorithms in the default
ESP proposal, as we don't know if it is supported by the backend. But as we
hopefully get an algorithm query mechanism on kernel interfaces some day, we
add the appropriate functionality nonetheless.
Martin Willi [Thu, 24 Apr 2014 12:06:05 +0000 (14:06 +0200)]
proposal: Don't include AEAD algorithms in the default proposal
According to RFC 5996 3.3 we should use a separate proposal for AEAD algorithms.
This was not clear in RFC 5282, hence we previously included both AEAD and
non-AEAD algorithms in a single proposal.
Martin Willi [Fri, 16 May 2014 09:57:54 +0000 (11:57 +0200)]
enum: Return boolean result for enum_from_name() lookup
Handling the result for enum_from_name() is difficult, as checking for
negative return values requires a cast if the enum type is unsigned. The new
signature clearly differentiates lookup result from lookup value.
Further, this actually allows to convert real -1 enum values, which could not
be distinguished from "not-found" and the -1 return value.
This also fixes several clang warnings where enums are unsigned.
Martin Willi [Thu, 8 May 2014 11:24:03 +0000 (13:24 +0200)]
unbound: Explicitly cast from ldns RR type/class to our types
These definitions are directly derived from the RFC, so it should be safe
to cast them. clang complains about the different types, so cast them
explicitly.
Martin Willi [Thu, 8 May 2014 12:29:16 +0000 (14:29 +0200)]
aes: Remove unused build variants
The AES code historically has different build options for various size/speed
trade-offs. We never made use of them, so just drop the obsolete code. The code
now has four hard-coded fixed tables, both inverse and original.
Tobias Brunner [Thu, 15 May 2014 10:03:25 +0000 (12:03 +0200)]
Merge branch 'settings-parser'
Adds a flex/bison based parser for settings_t. It provides several
improvements over the previous parser e.g. quoted strings (with escape
sequences), unlimited includes, more relaxed newline handling, better
syntax error reporting, and a distinction between empty and unset
values (key = vs. key = "").
Tobias Brunner [Thu, 15 May 2014 09:55:23 +0000 (11:55 +0200)]
settings: Properly match } and # in include statements
Found due to %option nodefault. A match for } was actually missing
and # was not properly matched if it was part of an include statement
on the last line of a file that did not end with a newline.
Tobias Brunner [Tue, 13 May 2014 08:50:36 +0000 (10:50 +0200)]
settings: Replace deprecated YYLEX_PARAM with %lex-param
With Bison 3.x support for YYLEX_PARAM has been removed and %lex-param
should be used. Unfortunately, that option does not take expressions.
Instead we use a wrapper function that calls the lexer with the proper
scanner object, which should also be backward compatible to older Bison
versions.