Martin Willi [Fri, 1 Mar 2013 10:33:47 +0000 (11:33 +0100)]
Merge branch 'systime'
Add a systime-fix plugin allowing an embedded system to validate certificates
if the system time has not been synchronized after boot. Certificates of
established tunnels can be re-validated after the system time gets valid.
Martin Willi [Fri, 1 Mar 2013 10:30:13 +0000 (11:30 +0100)]
Merge branch 'vip-shunts'
Installs bypass policies for the physical address if a virtual address is
assigned, and installs a proper source route to actually use the physical
address for bypassed destinations.
Martin Willi [Fri, 1 Mar 2013 10:24:42 +0000 (11:24 +0100)]
Merge branch 'ikev1-mm-retransmits'
Fixes retransmit of the last Main Mode or IKE_AUTH message, and correctly
queues Main Mode messages when processing of the last message is still in
progress.
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, 20 Feb 2013 15:17:31 +0000 (16:17 +0100)]
Install a route for shunt policies
If we install a virtual IP, its source route would render the shunt policy
useless, as locally generated traffic wouldn't match. Having a route for each
shunt policy with higher priority chooses the correct source address for
bypassed destinations.
Martin Willi [Wed, 20 Feb 2013 08:16:00 +0000 (09:16 +0100)]
After IKEv1 reauthentication, reinstall VIP routes after migrating CHILD_SAs
During IKEv1 reauthentication, the virtual IP gets removed, then reinstalled.
The CHILD_SAs get migrated, but any associated route gets removed from the
kernel. Reinstall routes after adding the virtual IP again.
Martin Willi [Tue, 19 Feb 2013 14:38:28 +0000 (15:38 +0100)]
systime-fix disables certificate lifetime validation if system time not synced
The system time can be periodically checked. If it gets valid, certificates get
rechecked with the current lifetime. If certificates are invalid, associated
IKE_SAs can be closed or reauthenticated.
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).