Tobias Brunner [Mon, 18 Feb 2013 16:23:04 +0000 (17:23 +0100)]
Fix auth_cfg_t.clone() for single-valued auth rules
By using the default list enumerator and adding the rules with the public
add() method, clones of auth_cfg_t objects would return the values for
single-valued auth rules in the wrong order (i.e. the oldest instead of the
newest value was returned). Using the internal enumerator (which the comment
already suggested) fixes this, but the clone will not be a full clone as
it does not contain any old values for single-valued auth rules. Since
these will never be used anyway, this should be fine.
Tobias Brunner [Tue, 26 Feb 2013 10:07:28 +0000 (11:07 +0100)]
Use SIGUSR2 for SIG_CANCEL on Android
SIGRTMIN is defined as 32 while sigset_t is defined as
unsigned long (i.e. holds 32 signals). Hence, the signal
could never be blocked. Sending the signal still canceled
threads, but sometimes in situations where they shouldn't
have been canceled (e.g. while holding a lock).
Martin Willi [Wed, 19 Dec 2012 16:55:47 +0000 (17:55 +0100)]
Keep the PDP connections lock while accessing its objects
When we introduce connection timeouts, the state may disappear at any time.
This change prevents that, but is not very clear. We probably have to refactor
connection handling.
Tobias Brunner [Wed, 13 Feb 2013 11:11:37 +0000 (12:11 +0100)]
Fix 'stroke loglevel any'
Before b46a5cd4 this worked if debug_t was unsigned. In that case -1,
as returned by enum_from_name(), would result in a large positive number.
So any unknown debug group (including 'any') had the same effect that
was only intended for 'any'.
Tobias Brunner [Wed, 6 Feb 2013 15:35:44 +0000 (16:35 +0100)]
Don't use a time_t variable with fscanf when parsing uptime
Because "%u" is used as format string in the fscanf call that parses the
uptime and because the length of time_t varies on different platforms
and architectures the value was not written properly if time_t was longer
than an unsigned int and depending on how the target variable was aligned
on the stack. Since there is no conversion specifier to properly parse a
time_t value we use the appropriate integer type instead.
Tobias Brunner [Fri, 8 Feb 2013 10:24:39 +0000 (11:24 +0100)]
Allow more than one CERTREQ payload for IKEv2
There is no reason not to do so (RFC 5996 explicitly mentions multiple
CERTREQ payloads) and some implementations seem to use the same behavior
as had to be used with IKEv1 (i.e. each CA in its own CERTREQ payload).
Tobias Brunner [Fri, 1 Feb 2013 09:55:33 +0000 (10:55 +0100)]
Updated configure.in to newer autoconf
AC_TRY_COMPILE and AC_TRY_RUN are deprecated. The new construct with
AC_*_IFELSE and AC_LANG_PROGRAM requires double quoting the source code
of these test programs.
Tobias Brunner [Thu, 31 Jan 2013 17:22:25 +0000 (18:22 +0100)]
Add a configure option to disable all default plugins
The --disable-defaults option disables all plugins that would be
enabled by default. This allows to selectively enable specific plugins
without issues when new default options get added in future releases.
Tobias Brunner [Sat, 19 Jan 2013 17:05:48 +0000 (18:05 +0100)]
Fix check-in of IKE_SA when IKE_SA_INIT fails and hash table is enabled
Setting the responder SPI to 0 can only be done while generating the
response, otherwise we'd fail to check in the IKE_SA again in case the
hash table is enabled. That's because we use the responder SPI as hash
value since 5.0.0.
Return SS_RC_INITIALIZATION_FAILED if pid file exists
Let charon return SS_RC_INITIALIZATION_FAILED if an existing pid file is found.
Starter only terminates itself if the result code of the daemon is a valid
SS_RC_* value.