]> git.ipfire.org Git - thirdparty/strongswan.git/log
thirdparty/strongswan.git
10 years agoandroid: Retrigger roam events on onLinkPropertiesChanged callbacks android-updates-linkprops
Tobias Brunner [Tue, 21 Jul 2015 10:06:27 +0000 (12:06 +0200)] 
android: Retrigger roam events on onLinkPropertiesChanged callbacks

In dual-stack environments the IPv6 connectivity (via autoconfiguration)
might be established before the IPv4 connectivity (via DHCP).  It seems
Android triggers the CONNECTIVITY_ACTION broadcast already when the first
family is fully configured.  At that time we might not be able to find an
IPv4 source address.  And since Android does not trigger the broadcast
again if IPv4 connectivity is established, the connection is broken
afterwards.

Since Android 5.0 ConnectivityManager provides a new callback framework.
There the onLinkPropertiesChanged callback is triggered on the active
interface if e.g. new IP addresses or routes get added.  We can use
this to trigger additional roaming events when the IPv4 connectivity is
established later.  It might get triggered a bit more often than we
like, and it might get triggered when not needed (e.g. if IPv4
connectivity is established before IPv6).

 #865.

10 years agoinclude: Remove linux/types.h header
Tobias Brunner [Tue, 21 Jul 2015 09:57:56 +0000 (11:57 +0200)] 
include: Remove linux/types.h header

This conflicts with the headers of the android-21 target.  Hopefully
headers on current Linux distros are recent enough.

10 years agoandroid: Build against the android-21 target
Tobias Brunner [Tue, 21 Jul 2015 09:37:33 +0000 (11:37 +0200)] 
android: Build against the android-21 target

10 years agoandroid: Fix kernel-net implementation on Android 4.3 and earlier
Tobias Brunner [Mon, 22 Jun 2015 15:15:33 +0000 (17:15 +0200)] 
android: Fix kernel-net implementation on Android 4.3 and earlier

Before fwmarks were used protected sockets were bound to the outbound
interface via SO_BINDTODEVICE.  This does not always seem to work well
together with our connect()/getsockname() trick if the server is covered
by the traffic selectors.  Calling protect() again after disconnecting
the socket seems to help, but if there is no connectivity at all we still
get the virtual IP back (maybe protect() does not bind the socket to any
interface then).

10 years agoandroid: Add a custom kernel-net implementation to replace kernel-netlink
Tobias Brunner [Wed, 17 Jun 2015 15:21:21 +0000 (17:21 +0200)] 
android: Add a custom kernel-net implementation to replace kernel-netlink

When roaming from a mobile network to WiFi on Android 5.x the event
received via ConnectivityManager is triggered before the mobile
connection is fully torn down (i.e. before the interface is disabled and
the routes disappear).  So for strongSwan the current path still seems
valid and since no roam event is triggered later the daemon never switches
to WiFi and the connection is broken afterwards.

A possible solution to this is enabling roam events in the kernel-netlink
plugin.  That would trigger an event when the device is finally disconnected
from the mobile network.  However, this could actually take a some time,
during which traffic continues to be sent via mobile network instead of WiFi.
That's because Android now uses multiple routing tables, routing rules and
fwmarks to direct traffic to the appropriate interface/table, but in our
plugin we don't have the information available that would allow us to make
the switch to a different network/routing table earlier (and we actually
prefer the current path if it is still valid).  Additionally, the plugin
produces quite a bit more events than ConnectivityManager (which was one
of the reasons to use the latter in the first place).

This custom kernel-net implementation is now specifically tailored for
Android.  Roam events are still triggered via ConnectivityManager but
the source address is determined via connect()/getsockname() on a VPN
excluded UDP socket, which does use the correct routing table as intended
by Android.  That way the daemon immediately sees a different source IP
when connectivity changes even if the device is connected to multiple
networks concurrently.

 #865.

10 years agoandroid: Manually load libraries with dlopen() and RTLD_GLOBAL on Android M
Tobias Brunner [Wed, 17 Jun 2015 13:31:24 +0000 (15:31 +0200)] 
android: Manually load libraries with dlopen() and RTLD_GLOBAL on Android M

This fixes an issue when using the Android M preview.  Bionic's dynamic
linker was changed so that symbols in libraries loaded with RTLD_LOCAL
were not found anymore in dlsym(RTLD_DEFAULT, ...).  This is the case
for libraries loaded with System.loadLibrary(), therefore, the plugin
loader in libstrongswan was not able to resolve any symbols defined in
other libraries loaded later.  While this seems to have been broken
unintentionally for existing apps (fix at [1]), it will again be a
problem whenever we decide to increase targetSdkVersion beyond 22 (or
until that fix makes it into the system/emulator images).

Unfortunately, the dynamic loader in releases prior to Android 4.3 can't
load libandroidbridge without also loading its dependencies.

[1] https://github.com/android/platform_bionic/commit/1913352c6b

10 years agoandroid: Apply configured server port
Tobias Brunner [Tue, 16 Jun 2015 14:44:29 +0000 (16:44 +0200)] 
android: Apply configured server port

10 years agoandroid: Extend GUI so the server port can be entered
Tobias Brunner [Tue, 16 Jun 2015 14:42:40 +0000 (16:42 +0200)] 
android: Extend GUI so the server port can be entered

10 years agoandroid: Add field for server port to data model
Tobias Brunner [Tue, 16 Jun 2015 14:39:08 +0000 (16:39 +0200)] 
android: Add field for server port to data model

10 years agoandroid: Apply configured MTU
Tobias Brunner [Tue, 16 Jun 2015 14:06:13 +0000 (16:06 +0200)] 
android: Apply configured MTU

While it is stored as property of individual profiles it is really a
global setting because we currently don't support more than one
connection.

10 years agoandroid: Extend GUI so the MTU can be entered
Tobias Brunner [Mon, 15 Jun 2015 14:59:12 +0000 (16:59 +0200)] 
android: Extend GUI so the MTU can be entered

This also adds a new area for advanced settings that is only displayed
if the user requests it (or if advanced settings already have been set).

The min. MTU for IPv6 is 1280, anything lower lets the TUN device
creation fail if an IPv6 address has been assigned.  If lower MTUs are
necessary we might be able to catch that later when setting the MTU and
just use at least 1280 if an IPv6 address was assigned, but let's keep
it simple for now.

10 years agoandroid: Add field for MTU to data model
Tobias Brunner [Mon, 15 Jun 2015 13:36:46 +0000 (15:36 +0200)] 
android: Add field for MTU to data model

10 years agoandroid: Set preferred language for remediation instructions
Tobias Brunner [Fri, 12 Jun 2015 12:14:46 +0000 (14:14 +0200)] 
android: Set preferred language for remediation instructions

10 years agoandroid: Encode connection settings as single Java string argument
Tobias Brunner [Wed, 10 Jun 2015 12:59:48 +0000 (14:59 +0200)] 
android: Encode connection settings as single Java string argument

This makes adding new configuration settings easier.

10 years agoandroid: Add simple utility class to generate settings_t compatible config snippets
Tobias Brunner [Fri, 5 Jun 2015 14:01:31 +0000 (16:01 +0200)] 
android: Add simple utility class to generate settings_t compatible config snippets

10 years agounit-tests: Add unit tests for settings_t.load_string[_section]
Tobias Brunner [Thu, 23 Oct 2014 15:03:52 +0000 (17:03 +0200)] 
unit-tests: Add unit tests for settings_t.load_string[_section]

10 years agosettings: Add methods and a constructor to parse settings from strings
Tobias Brunner [Thu, 23 Oct 2014 14:57:47 +0000 (16:57 +0200)] 
settings: Add methods and a constructor to parse settings from strings

10 years agosettings: Extend parser so we can parse settings from a string
Tobias Brunner [Thu, 23 Oct 2014 14:57:24 +0000 (16:57 +0200)] 
settings: Extend parser so we can parse settings from a string

10 years agostarter: Add support for multi-line strings in ipsec.conf
Tobias Brunner [Mon, 8 Jun 2015 15:49:02 +0000 (17:49 +0200)] 
starter: Add support for multi-line strings in ipsec.conf

10 years agosettings: Add support for multi-line strings
Tobias Brunner [Mon, 8 Jun 2015 15:47:51 +0000 (17:47 +0200)] 
settings: Add support for multi-line strings

Unterminated strings are now an error.

10 years agostarter: Don't replace rarely used special characters in strings in ipsec.conf
Tobias Brunner [Fri, 5 Jun 2015 13:49:39 +0000 (15:49 +0200)] 
starter: Don't replace rarely used special characters in strings in ipsec.conf

10 years agosettings: Don't replace rarely used special characters
Tobias Brunner [Fri, 5 Jun 2015 13:42:58 +0000 (15:42 +0200)] 
settings: Don't replace rarely used special characters

10 years agoandroid: Don't pass null as root view to inflate()
Tobias Brunner [Mon, 22 Jun 2015 15:26:10 +0000 (17:26 +0200)] 
android: Don't pass null as root view to inflate()

10 years agoandroid: Fix a potential NullPointerException in the IMC state fragment
Tobias Brunner [Mon, 22 Jun 2015 15:22:05 +0000 (17:22 +0200)] 
android: Fix a potential NullPointerException in the IMC state fragment

10 years agoandroid: EAP-TNC does not require a client certificate
Tobias Brunner [Fri, 12 Jun 2015 13:13:46 +0000 (15:13 +0200)] 
android: EAP-TNC does not require a client certificate

Was incorrectly changed with the refactoring in a64089738d3e ("android:
Change how features of VPN types are stored and checked").

10 years agoandroid: Enable charon.initiator_only option
Tobias Brunner [Thu, 4 Jun 2015 08:35:03 +0000 (10:35 +0200)] 
android: Enable charon.initiator_only option

10 years agoandroid: Increase the minSdkVersion to 15 and targetSdkVersion to 22
Tobias Brunner [Wed, 10 Jun 2015 13:13:49 +0000 (15:13 +0200)] 
android: Increase the minSdkVersion to 15 and targetSdkVersion to 22

There are no devices anymore that use API level 14 (4.0-4.0.2) and 22 is
the most recent level.

10 years agoRemove accidentally added stamp-h1
Tobias Brunner [Mon, 15 Jun 2015 12:12:14 +0000 (14:12 +0200)] 
Remove accidentally added stamp-h1

Was added in bc4748832395 ("Add a return value to prf_t.get_bytes()").

10 years agosettings: Fix out-of-tree build
Tobias Brunner [Thu, 11 Jun 2015 10:32:33 +0000 (12:32 +0200)] 
settings: Fix out-of-tree build

The header file was created in the source directory before, where it
wasn't found by the generated C files in the build directory.

10 years agostroke: Add missing include for UINT16_MAX
Tobias Brunner [Tue, 9 Jun 2015 08:24:25 +0000 (10:24 +0200)] 
stroke: Add missing include for UINT16_MAX

Fixes the build on FreeBSD.

Fixes #988.

10 years agoVersion bump to 5.3.2 5.3.2
Andreas Steffen [Mon, 8 Jun 2015 07:56:34 +0000 (09:56 +0200)] 
Version bump to 5.3.2

10 years agoNEWS: Add info about CVE-2015-4171
Tobias Brunner [Wed, 3 Jun 2015 10:33:58 +0000 (12:33 +0200)] 
NEWS: Add info about CVE-2015-4171

10 years agoikev2: Enforce remote authentication config before proceeding with own authentication
Martin Willi [Wed, 3 Jun 2015 08:52:34 +0000 (10:52 +0200)] 
ikev2: Enforce remote authentication config before proceeding with own authentication

Previously the constraints in the authentication configuration of an
initiator were enforced only after all authentication rounds were
complete.  This posed a problem if an initiator used EAP or PSK
authentication while the responder was authenticated with a certificate
and if a rogue server was able to authenticate itself with a valid
certificate issued by any CA the initiator trusted.

Because any constraints for the responder's identity (rightid) or other
aspects of the authentication (e.g. rightca) the initiator had were not
enforced until the initiator itself finished its authentication such a rogue
responder was able to acquire usernames and password hashes from the client.
And if a client supported EAP-GTC it was even possible to trick it into
sending plaintext passwords.

This patch enforces the configured constraints right after the responder's
authentication successfully finished for each round and before the initiator
starts with its own authentication.

Fixes CVE-2015-4171.

10 years agochild-sa: Use any fixed reqid configured on the CHILD_SA config
Martin Willi [Mon, 1 Jun 2015 08:10:19 +0000 (10:10 +0200)] 
child-sa: Use any fixed reqid configured on the CHILD_SA config

Global reqid allocation (94eb09ac) broke fixed reqid allocation. Resupport them
by bypassing allocation in the kernel if a fixed reqid has been configured.

Fixes #976.

10 years agounit-tests: Add tests for iv_gen_seq_t
Tobias Brunner [Wed, 3 Jun 2015 10:29:02 +0000 (12:29 +0200)] 
unit-tests: Add tests for iv_gen_seq_t

10 years agoivgen: Allow reusing the same message ID twice in sequential IV gen
Martin Willi [Tue, 2 Jun 2015 12:08:42 +0000 (14:08 +0200)] 
ivgen: Allow reusing the same message ID twice in sequential IV gen

We use the message ID and fragment number as IV generator. As IKEv2 uses
distinct message ID counters for actively and passively initiated exchanges,
each IV would be used twice. As we explicitly reject such message IDs since
d0ed1079, original-responder initiated exchanges fail with counter mode ciphers.

This commit separates IV space in two halves for sequential IVs, and
automatically assigns once reused sequence numbers to the second half.

Fixes #980.

10 years agoFix timeattack script compilation under ARM
Andreas Steffen [Fri, 5 Jun 2015 10:09:38 +0000 (12:09 +0200)] 
Fix timeattack script compilation under ARM

10 years agoUpdated SWID attribute list
Andreas Steffen [Tue, 2 Jun 2015 04:51:41 +0000 (06:51 +0200)] 
Updated SWID attribute list

10 years agoVersion bump to 5.3.1 5.3.1
Andreas Steffen [Mon, 1 Jun 2015 07:50:48 +0000 (09:50 +0200)] 
Version bump to 5.3.1

10 years agoNEWS: Add info about CVE-2015-3991
Tobias Brunner [Thu, 21 May 2015 15:17:51 +0000 (17:17 +0200)] 
NEWS: Add info about CVE-2015-3991

10 years agomessage: Log message if unknown/disallowed payload received
Tobias Brunner [Fri, 15 May 2015 10:19:27 +0000 (12:19 +0200)] 
message: Log message if unknown/disallowed payload received

10 years agomessage: Log original message type of unknown payloads
Tobias Brunner [Fri, 15 May 2015 09:35:40 +0000 (11:35 +0200)] 
message: Log original message type of unknown payloads

10 years agounknown-payload: Use a new private payload type and make original type available
Tobias Brunner [Fri, 15 May 2015 09:15:57 +0000 (11:15 +0200)] 
unknown-payload: Use a new private payload type and make original type available

This fixes a DoS and potential remote code execution vulnerability that was
caused because the original payload type that was returned previously was
used to cast such payload objects to payloads of the indicated type (e.g.
when logging notify payloads with a payload type for the wrong IKE version).

Fixes CVE-2015-3991.

10 years agoikev2: Include fragment number into message ID passed to IV gen
Martin Willi [Fri, 17 Apr 2015 12:19:37 +0000 (14:19 +0200)] 
ikev2: Include fragment number into message ID passed to IV gen

When using a cipher with sequential IVs, we never must pass an identical IV
to the IV generator. To avoid it when using IKEv2 fragmentation, use the lower
bits of the 64-bit message ID as the fragment number.

10 years agoiv-gen: Fail getting shorter IV values than the used counter size
Martin Willi [Fri, 17 Apr 2015 14:16:45 +0000 (16:16 +0200)] 
iv-gen: Fail getting shorter IV values than the used counter size

While no algorithm actually uses such short IVs, we add a check here to ensure
we won't return just the lower bits of the counter.

10 years agoiv-gen: Ensure external sequential IVs are actually sequential
Martin Willi [Fri, 17 Apr 2015 12:08:14 +0000 (14:08 +0200)] 
iv-gen: Ensure external sequential IVs are actually sequential

We allow gaps in IVs, but ensure that an IV is never used more than once.

10 years agomessage: Show the fragmentation numbers in message stringification
Martin Willi [Fri, 17 Apr 2015 12:19:05 +0000 (14:19 +0200)] 
message: Show the fragmentation numbers in message stringification

10 years agotesting: use a decent PSK
Andreas Steffen [Sat, 30 May 2015 14:56:41 +0000 (16:56 +0200)] 
testing: use a decent PSK

10 years agotesting: Added ha/active-passive scenario
Andreas Steffen [Sat, 30 May 2015 14:48:17 +0000 (16:48 +0200)] 
testing: Added ha/active-passive scenario

10 years agoAdded 5.3.1 caption to NEWS 5.3.1rc1
Andreas Steffen [Thu, 28 May 2015 04:26:43 +0000 (06:26 +0200)] 
Added 5.3.1 caption to NEWS

10 years agoha: Document tunnel parameter
Tobias Brunner [Wed, 27 May 2015 10:59:39 +0000 (12:59 +0200)] 
ha: Document tunnel parameter

10 years agoha: Skip SA for sync messages when resyncing HA segments
Tobias Brunner [Tue, 26 May 2015 13:43:46 +0000 (15:43 +0200)] 
ha: Skip SA for sync messages when resyncing HA segments

10 years agoha: Move plugin initialization from constructor to plugin callback
Tobias Brunner [Tue, 26 May 2015 10:47:17 +0000 (12:47 +0200)] 
ha: Move plugin initialization from constructor to plugin callback

This fixes support for the secret option, as otherwise the kernel interface
is not registered yet when the trap policy is installed.

10 years agolibtls: As client, reject DH exchanges using primes smaller than 1024 bit
Martin Willi [Wed, 20 May 2015 08:56:23 +0000 (10:56 +0200)] 
libtls: As client, reject DH exchanges using primes smaller than 1024 bit

While the server signs the ephemeral DH parameters, it can be tricked to its
lowest supported DH group by a man-in-the-middle:

  https://weakdh.org/imperfect-forward-secrecy.pdf

While we at least use 2048-bit DH groups as server, the client accepts any
DH prime the server sends. If it supports export ciphers, only a 512-bit prime
may be used.

As TLS does not define nor negotiate a DH group for cipher suites, the client
actually must accept what the server offers. To avoid downgrades to weak
DH groups, we must reject what we consider insecure. We set this limit to
1024-bit primes. While this breaks compatibility with TLS servers using weaker
primes, this is what we expect servers at least use. Most browser vendors use
the same limit in a similar fix.

10 years agoCheck for NULL installed packages enumerator
Andreas Steffen [Sun, 24 May 2015 09:15:36 +0000 (11:15 +0200)] 
Check for NULL installed packages enumerator

10 years agoFixed os_info path in strongswan.conf
Andreas Steffen [Sun, 24 May 2015 09:13:51 +0000 (11:13 +0200)] 
Fixed os_info path in strongswan.conf

10 years agoList attribute request entries also during build
Andreas Steffen [Sun, 24 May 2015 07:17:29 +0000 (09:17 +0200)] 
List attribute request entries also during build

10 years agotesting: Include iperf and htop in base image
Tobias Brunner [Fri, 22 May 2015 11:30:10 +0000 (13:30 +0200)] 
testing: Include iperf and htop in base image

10 years agostroke: Dynamically resize stroke messages
Tobias Brunner [Wed, 20 May 2015 16:21:15 +0000 (18:21 +0200)] 
stroke: Dynamically resize stroke messages

The maximum size of a stroke message is currently 64k due to the 2 byte
length field.

Fixes #943.

10 years agovici: Explicitly disable --user-install when installing Ruby Gem
Tobias Brunner [Tue, 31 Mar 2015 08:51:22 +0000 (10:51 +0200)] 
vici: Explicitly disable --user-install when installing Ruby Gem

Only one of `--user-install` and `--install-dir` may be set and if
`--user-install` is the default on a system installation will fail
unless we disable it explicitly.

Fixes #914.

10 years agovici: Make installation of Ruby Gem and Python Egg optional
Tobias Brunner [Thu, 21 May 2015 09:05:05 +0000 (11:05 +0200)] 
vici: Make installation of Ruby Gem and Python Egg optional

Installing them might not work well when building distro packages (e.g.
with DESTDIR installs).  It might be easier to install them later with a
script in the distro package.

When building from source on the local system it could still be useful to
install the packages directly, which can be enabled with separate configure
options.

The main problem with DESTDIR installations of the Python Egg is that
easy_install creates or modifies a file called easy-install.pth in the
installation directory.  So it's not actually possible to simply copy
the results in DESTDIR over to the actual system as that file would have
to be merged with any existing one.

Fixes #914.

10 years agovici: Support out-of-tree build of Python Egg
Tobias Brunner [Tue, 31 Mar 2015 13:40:30 +0000 (15:40 +0200)] 
vici: Support out-of-tree build of Python Egg

We also don't require setup.py to exist during cleanup, as e.g. with
make distcheck the source directory is not writable when the build directory
is cleaned, so setup.py can't be created (to just get removed again anyway
if VICI and the Python Eggs haven't been enabled previously).

10 years agoikev1: When a reauth is detected explicitly delete the old IKE_SA
Tobias Brunner [Tue, 12 May 2015 14:59:20 +0000 (16:59 +0200)] 
ikev1: When a reauth is detected explicitly delete the old IKE_SA

Instead of just implicitly destroying the old SA we properly delete it to
notify the other peer (if the other peer keeps the SA up after the
reauthentication and sends DPDs it might consider us dead even though the
new SA is up, that seems to be the case with racoon).  We delay the DELETE
a bit to give the other peer time to get the new SA fully established.

Since DELETE messages are not retransmitted it is still possible that
the other peer misses that we deleted the SA.

10 years agoMerge branch 'accounting-fixes'
Tobias Brunner [Thu, 21 May 2015 13:40:05 +0000 (15:40 +0200)] 
Merge branch 'accounting-fixes'

This fixes the usage stats reported via RADIUS Accounting in several
corner cases (e.g. with interim updates while rekeying a CHILD_SA).

Fixes #891.

10 years agolibipsec: Insert SAs first, so latest SA with the same reqid gets used
Tobias Brunner [Fri, 27 Mar 2015 13:49:38 +0000 (14:49 +0100)] 
libipsec: Insert SAs first, so latest SA with the same reqid gets used

This was useful for testing purposes of RADIUS accounting, but OS kernels
generally will use the latest SA, so we do the same.

10 years agoeap-radius: Keep track of stats for SAs migrated during IKEv1 reauthentication
Tobias Brunner [Wed, 25 Mar 2015 17:20:01 +0000 (18:20 +0100)] 
eap-radius: Keep track of stats for SAs migrated during IKEv1 reauthentication

10 years agoikev1: Trigger children_migrate event if CHILD_SAs are adopted
Tobias Brunner [Wed, 25 Mar 2015 17:11:22 +0000 (18:11 +0100)] 
ikev1: Trigger children_migrate event if CHILD_SAs are adopted

10 years agobus: Add new hook called when IKEv1 CHILD_SAs are migrated to a new IKE_SA
Tobias Brunner [Wed, 25 Mar 2015 17:05:57 +0000 (18:05 +0100)] 
bus: Add new hook called when IKEv1 CHILD_SAs are migrated to a new IKE_SA

The interface is currently not very nice, but if we ever were able to
safely checkout multiple SAs concurrently we could add something similar
to ike_rekey() and call that when we detect a reauthentication.

10 years agoeap-radius: Remove cache entries for expired SAs during ike/child_rekey
Tobias Brunner [Wed, 25 Mar 2015 15:47:24 +0000 (16:47 +0100)] 
eap-radius: Remove cache entries for expired SAs during ike/child_rekey

10 years agoeap-radius: Add cache for usage stats of expired/rekeyed SAs
Tobias Brunner [Tue, 24 Mar 2015 16:38:49 +0000 (17:38 +0100)] 
eap-radius: Add cache for usage stats of expired/rekeyed SAs

There are several situations that the previous code didn't handle that
well, for example, interim updates during rekeying (until the rekeyed SA
was deleted the numbers were too high, then suddenly dropped afterwards),
or rekeying for IKEv1 in general because rekeyed IPsec SAs stay installed
until they expire (so if they were still around when the IKE_SA was
terminated, the reported numbers in the Stop message were too high).

If intermediate updates are not used the cache entries for rekeyed
CHILD_SA will accumulate, we can't clean them up as we don't get
child_updown() events for them.

10 years agolibradius: Verify message ID of RADIUS responses
Tobias Brunner [Wed, 15 Apr 2015 16:03:42 +0000 (18:03 +0200)] 
libradius: Verify message ID of RADIUS responses

If we sent retransmits for a message and didn't receive a response it might
still arrive later.  Such a message will be queued on the socket.  The next
read will then return not the expected response but the one for the earlier
request.  For this message the verification will fail and the message gets
discarded.  But with the earlier code the actual response was never received.
Instead, a subsequent request resulted in the same failure and so on.

Fixes #838.

10 years agokernel-netlink: Ignore unusable routes
Tobias Brunner [Thu, 9 Apr 2015 12:43:07 +0000 (14:43 +0200)] 
kernel-netlink: Ignore unusable routes

10 years agokernel-netlink: Make buffer size for received Netlink messages configurable
Tobias Brunner [Tue, 14 Apr 2015 07:56:10 +0000 (09:56 +0200)] 
kernel-netlink: Make buffer size for received Netlink messages configurable

10 years agotesting: Don't check parent dir (and subdirs) when downloading OpenSSL packages
Tobias Brunner [Thu, 21 May 2015 07:32:37 +0000 (09:32 +0200)] 
testing: Don't check parent dir (and subdirs) when downloading OpenSSL packages

10 years agoExempt ignored PA-TNC attributes from error handling
Andreas Steffen [Tue, 19 May 2015 20:54:00 +0000 (22:54 +0200)] 
Exempt ignored PA-TNC attributes from error handling

10 years agotesting: Fix kernel download URL for kernel versions != 4.x
Tobias Brunner [Tue, 19 May 2015 14:59:35 +0000 (16:59 +0200)] 
testing: Fix kernel download URL for kernel versions != 4.x

10 years agoman: Clarification of ah keyword description
Adrian-Ken Rueegsegger [Tue, 19 May 2015 11:26:28 +0000 (13:26 +0200)] 
man: Clarification of ah keyword description

10 years agostarter: Ensure the daemon executable exists when starting up
Tobias Brunner [Tue, 5 May 2015 16:11:50 +0000 (18:11 +0200)] 
starter: Ensure the daemon executable exists when starting up

The only purpose of starter is to control the IKE daemon, so we
terminate it if the daemon executable is not found (e.g. because
DAEMON_NAME is incorrect).

This removes the charonstart setting (it was not actually configurable
anymore).

10 years agostarter: Remove START_CHARON compile flag
Tobias Brunner [Tue, 5 May 2015 15:50:27 +0000 (17:50 +0200)] 
starter: Remove START_CHARON compile flag

Since the removal of pluto this is quite superfluous. The flag itself
might be useful to avoid starting charon if the executable does not
exist for some reason (e.g. if DAEMON_NAME is incorrect).

10 years agocharon-nm: Disable leak-detective in charon-nm
Tobias Brunner [Tue, 5 May 2015 15:52:34 +0000 (17:52 +0200)] 
charon-nm: Disable leak-detective in charon-nm

It segfaults immediately if it is enabled, at least on Ubuntu 14.04.

10 years agotesting: Fix URL to TNC@FHH project in scenario descriptions
Tobias Brunner [Tue, 5 May 2015 09:48:13 +0000 (11:48 +0200)] 
testing: Fix URL to TNC@FHH project in scenario descriptions

10 years agotesting: Update TKM assert strings
Reto Buerki [Tue, 5 May 2015 08:08:35 +0000 (10:08 +0200)] 
testing: Update TKM assert strings

10 years agotesting: Update alog to version 0.3.1
Reto Buerki [Tue, 5 May 2015 07:29:21 +0000 (09:29 +0200)] 
testing: Update alog to version 0.3.1

10 years agotesting: Update tkm to version 0.1.2
Reto Buerki [Tue, 5 May 2015 07:27:37 +0000 (09:27 +0200)] 
testing: Update tkm to version 0.1.2

10 years agotesting: Update tkm-rpc to version 0.2
Reto Buerki [Tue, 5 May 2015 07:26:57 +0000 (09:26 +0200)] 
testing: Update tkm-rpc to version 0.2

10 years agochild-create: Destroy nonceg in migrate()
Tobias Brunner [Tue, 5 May 2015 07:51:19 +0000 (09:51 +0200)] 
child-create: Destroy nonceg in migrate()

Since another nonce gets allocated later (if any was allocated already)
this would have resulted in a leaked nonce context ID when used in charon-tkm.

10 years agochild-create: Fix error handling if nonceg can't be created
Tobias Brunner [Tue, 5 May 2015 07:49:45 +0000 (09:49 +0200)] 
child-create: Fix error handling if nonceg can't be created

As with ike-init we can't return NULL in the task constructor.

10 years agoike-init: Fix error handling if nonceg can't be created
Tobias Brunner [Tue, 5 May 2015 07:39:11 +0000 (09:39 +0200)] 
ike-init: Fix error handling if nonceg can't be created

Returning FAILED in the constructor is wrong, but returning NULL doesn't work
either as it's currently assumed tasks always can be created.
Therefore, delay this check until we actually try to allocate a nonce.

10 years agoike-init: Fix compiler warning
Tobias Brunner [Tue, 5 May 2015 07:37:42 +0000 (09:37 +0200)] 
ike-init: Fix compiler warning

10 years agoswanctl: Fix --uri option
Martin Willi [Tue, 5 May 2015 08:37:34 +0000 (10:37 +0200)] 
swanctl: Fix --uri option

As we now pass the vici connection to the command dispatcher callback, we can't
parse the --uri option to create the connection from the same callback. Instead
pre-process the common command options in a separate loop, and ignore the same
options while processing the actual command.

10 years agoMerge branch 'tkm-fixes'
Tobias Brunner [Mon, 4 May 2015 16:19:13 +0000 (18:19 +0200)] 
Merge branch 'tkm-fixes'

This fixes several issues with charon-tkm (e.g. nonce context ID leaks during
rekey collisions).

10 years agocharon-tkm: Also store local SPI in SAD
Adrian-Ken Rueegsegger [Tue, 21 Apr 2015 14:34:06 +0000 (16:34 +0200)] 
charon-tkm: Also store local SPI in SAD

10 years agoike-init: Make nonceg a member of ike_init struct
Reto Buerki [Thu, 23 Apr 2015 09:19:24 +0000 (11:19 +0200)] 
ike-init: Make nonceg a member of ike_init struct

This allows to control the life-cycle of a nonce in the context of the
ike init task. In the TKM use-case the nonce generator cannot be
destroyed before the ike init task is finalized, otherwise the created
nonce is detected as stale.

10 years agochild-create: Make nonceg a member of child_create struct
Reto Buerki [Thu, 23 Apr 2015 06:46:18 +0000 (08:46 +0200)] 
child-create: Make nonceg a member of child_create struct

This allows to control the life-cycle of a nonce in the context of the
child create task. In the TKM use-case, it is required to reset the
nonce context if the created nonce is not consumed. This happens if the
child SA negotiation fails and it is detected before the SA is
established via the TKM kernel plugin (i.e. rekey collision).

10 years agocharon-tkm: Reset stale nonce contexts
Reto Buerki [Thu, 23 Apr 2015 07:41:12 +0000 (09:41 +0200)] 
charon-tkm: Reset stale nonce contexts

If the nonce generator detects a stale nonce upon destroy(), it resets
the context in the TKM and releases associated resources in the ID
manager and chunk map.

Also, do not acquire the nonce context ID in tkm_nonceg_create function
but rather when the nonce is actually created by get_nonce().

The nonces created with get_nonce must also be registered in the chunk map.

10 years agocharon-tkm: Drop unneeded nonceg get_id function
Reto Buerki [Thu, 23 Apr 2015 08:06:49 +0000 (10:06 +0200)] 
charon-tkm: Drop unneeded nonceg get_id function

10 years agocharon-tkm: Remove ESA nonce mappings from chunk map
Adrian-Ken Rueegsegger [Wed, 22 Apr 2015 14:37:23 +0000 (16:37 +0200)] 
charon-tkm: Remove ESA nonce mappings from chunk map

10 years agocharon-tkm: Drop obsolete TKM_LIMIT define
Reto Buerki [Wed, 22 Apr 2015 13:52:43 +0000 (15:52 +0200)] 
charon-tkm: Drop obsolete TKM_LIMIT define

10 years agocharon-tkm: Select other ESA if any is present upon deletion
Adrian-Ken Rueegsegger [Wed, 8 Apr 2015 16:56:23 +0000 (18:56 +0200)] 
charon-tkm: Select other ESA if any is present upon deletion

In the case that multiple ESAs exist (e.g. rekey collision) for a
security policy, make sure to select one of the remaining ESAs.

10 years agocharon-tkm: Add get_other_esa_id function to TKM kernel SAD
Adrian-Ken Rueegsegger [Wed, 8 Apr 2015 16:54:54 +0000 (18:54 +0200)] 
charon-tkm: Add get_other_esa_id function to TKM kernel SAD

The function gets the ESA id for another entry associated with the same
security policy as the specified ESA.