19 months agoike: Reuse interface ID during CHILD_SA rekeyings
Tobias Brunner [Tue, 12 Feb 2019 10:59:38 +0000 (11:59 +0100)]
ike: Reuse interface ID during CHILD_SA rekeyings

19 months agochild-sa: Configure interface ID on SAs and policies
Tobias Brunner [Tue, 12 Feb 2019 10:39:11 +0000 (11:39 +0100)]
child-sa: Configure interface ID on SAs and policies

19 months agovici: Make interface ID configurable
Tobias Brunner [Tue, 12 Feb 2019 11:10:06 +0000 (12:10 +0100)]
vici: Make interface ID configurable

19 months agoipsec-types: Add helper to parse interface ID
Tobias Brunner [Tue, 12 Feb 2019 11:25:53 +0000 (12:25 +0100)]
ipsec-types: Add helper to parse interface ID

19 months agokernel-interface: Consider interface ID when allocating reqids
Tobias Brunner [Tue, 12 Feb 2019 10:10:04 +0000 (11:10 +0100)]
kernel-interface: Consider interface ID when allocating reqids

19 months agochild-cfg: Add property for interface ID
Tobias Brunner [Tue, 12 Feb 2019 09:19:36 +0000 (10:19 +0100)]
child-cfg: Add property for interface ID

19 months agokernel-netlink: Make interface ID configurable on SAs and policies
Tobias Brunner [Fri, 1 Feb 2019 16:29:20 +0000 (17:29 +0100)]
kernel-netlink: Make interface ID configurable on SAs and policies

19 months agoinclude: Add XFRM attribute identifier for interface ID
Tobias Brunner [Fri, 1 Feb 2019 12:53:29 +0000 (13:53 +0100)]
include: Add XFRM attribute identifier for interface ID

19 months agokernel-netlink: Add utility to create XFRM interfaces
Tobias Brunner [Fri, 1 Feb 2019 08:28:10 +0000 (09:28 +0100)]
kernel-netlink: Add utility to create XFRM interfaces

This is mainly to see what's necessary to create them (in case we
integrate this into the daemon) and to experiment in our testing
environment without having to add a patched version of iproute2 (the
4.20.0 version in stretch-backports doesn't support XFRM interfaces
yet).  The regular version of iproute2 can be used for other operations
with these interfaces (delete, up, addrs etc.).

19 months agokernel-netlink: Calculate length of Netlink messages correctly
Tobias Brunner [Fri, 1 Feb 2019 08:19:03 +0000 (09:19 +0100)]
kernel-netlink: Calculate length of Netlink messages correctly

This is relevant when adding e.g. strings whose length are not aligned.

19 months agoUse Botan 2.10.0 for tests
Tobias Brunner [Mon, 1 Apr 2019 09:01:46 +0000 (11:01 +0200)]
Use Botan 2.10.0 for tests

20 months agoVersion bump to 5.8.0dr2 5.8.0dr2
Andreas Steffen [Sat, 30 Mar 2019 16:11:34 +0000 (17:11 +0100)]
Version bump to 5.8.0dr2

20 months agotesting: Updated expired certificates
Andreas Steffen [Sat, 30 Mar 2019 16:10:51 +0000 (17:10 +0100)]
testing: Updated expired certificates

20 months agoTesting: Removed tnc/tnccs-20-server-retry scenario
Andreas Steffen [Fri, 29 Mar 2019 15:54:54 +0000 (16:54 +0100)]
Testing: Removed tnc/tnccs-20-server-retry scenario

20 months agoCorrected use of PB-TNC CRETRY and SRETRY batches
Andreas Steffen [Fri, 29 Mar 2019 14:33:24 +0000 (15:33 +0100)]
Corrected use of PB-TNC CRETRY and SRETRY batches

The PB-TNC finite state machine according to section 3.2 of RFC 5793
was not correctly implemented when sending either a CRETRY or SRETRY
batch. These batches can only be sent in the "Decided" state and a
CRETRY batch can immediately carry all messages usually transported
by a CDATA batch. strongSwan currently is not able to send a SRETRY
batch since full-duplex mode for PT-TLS isn't supported yet.

20 months agotesting: Disable gcrypt plugin for swanctl
Tobias Brunner [Thu, 28 Mar 2019 17:16:56 +0000 (18:16 +0100)]
testing: Disable gcrypt plugin for swanctl

Sometimes swanctl hangs when initializing the plugin and it apparently
gathers entropy.

20 months agoconf: Use actually configured path for strongswan.conf
Tobias Brunner [Fri, 22 Mar 2019 15:19:48 +0000 (16:19 +0100)]
conf: Use actually configured path for strongswan.conf

References #2984.

20 months agogenerator: Don't print any tainted values in DBG3 messages for U_INT_4
Tobias Brunner [Mon, 18 Mar 2019 12:58:52 +0000 (13:58 +0100)]
generator: Don't print any tainted values in DBG3 messages for U_INT_4

The bits not written to are marked tainted by valgrind, don't print
them in the debug messages.  Also use more specific printf-specifiers
for other values.

20 months agotrap-manager: Wait for install to finish before uninstalling
Sheena Mira-ato [Wed, 20 Mar 2019 23:30:56 +0000 (12:30 +1300)]
trap-manager: Wait for install to finish before uninstalling

There was a race condition between install() and uninstall()
where one thread was in the process of installing a trap
entry, and had destroyed the child_sa, while the other
thread was uninstalling the same trap entry and ended up
trying to destroy the already destroyed child_sa, resulting
in a segmentation fault in the destroy_entry() function.

The uninstall() function needs to wait until all the threads
are done with the installing before proceeding to uninstall
a trap entry.

Closes strongswan/strongswan#131.

20 months agosql: Handle %any better when looking up shared secrets
Tobias Brunner [Mon, 25 Feb 2019 09:30:59 +0000 (10:30 +0100)]
sql: Handle %any better when looking up shared secrets

This can be the case for IKEv1 since 419ae9a20a0b ("ikev1: Default remote
identity to %any for PSK lookup if not configured").

Closes strongswan/strongswan#128.

20 months agoMerge branch 'nm-ipv6'
Tobias Brunner [Thu, 14 Mar 2019 12:46:33 +0000 (13:46 +0100)]
Merge branch 'nm-ipv6'

Adds support for IPv6 to the NetworkManager backend and plugin.

Fixes #1143, #2586.

20 months agonm: Remove deprecated variables from
Tobias Brunner [Fri, 25 Jan 2019 10:19:40 +0000 (11:19 +0100)]
nm: Remove deprecated variables from

20 months agocharon-nm: Add IPv6 support
Tobias Brunner [Fri, 25 Jan 2019 09:56:19 +0000 (10:56 +0100)]
charon-nm: Add IPv6 support

20 months agocharon-nm: Handle IPv6 DNS server attributes
Tobias Brunner [Tue, 27 Sep 2016 09:48:07 +0000 (11:48 +0200)]
charon-nm: Handle IPv6 DNS server attributes

20 months agocharon-nm: Set local address to %any so IPv6 may be used as outer address
Tobias Brunner [Tue, 27 Sep 2016 08:12:53 +0000 (10:12 +0200)]
charon-nm: Set local address to %any so IPv6 may be used as outer address

20 months agocharon-nm: Request virtual IPv6 address and appropriate TS
Tobias Brunner [Wed, 6 Nov 2013 10:36:31 +0000 (11:36 +0100)]
charon-nm: Request virtual IPv6 address and appropriate TS

20 months agonm: Enable IPv6 tab in NM connection dialog
Tobias Brunner [Wed, 6 Nov 2013 10:32:25 +0000 (11:32 +0100)]
nm: Enable IPv6 tab in NM connection dialog

20 months agoforecast: Only reinject packets that are marked or from the configured interface
Tobias Brunner [Tue, 5 Feb 2019 16:21:21 +0000 (17:21 +0100)]
forecast: Only reinject packets that are marked or from the configured interface

This seems to avoid broadcast loops (i.e. processing and reinjecting the
same broadcast packet over and over again) as the packets we send via
AF_PACKET socket are neither marked nor from that interface.

20 months agokernel-netlink: Use address labels instead of deprecation for IPv6 virtual IPs
Tobias Brunner [Tue, 3 Apr 2018 13:01:20 +0000 (15:01 +0200)]
kernel-netlink: Use address labels instead of deprecation for IPv6 virtual IPs

In order to avoid that the kernel uses virtual tunnel IPs for traffic
over physical interfaces we previously deprecated the virtual IP.  While
this is working it is not ideal.  This patch adds address labels for
virtual IPs, which should force the kernel to avoid such addresses to
reach any destination unless there is an explicit route that uses it as
source address.

20 months agoMerge branch 'android-updates'
Tobias Brunner [Thu, 14 Mar 2019 09:56:07 +0000 (10:56 +0100)]
Merge branch 'android-updates'

Adds a copy function for VPN profiles and an option to set custom DNS

20 months agotesting: Prolonged Duck end entity certificate
Andreas Steffen [Wed, 13 Mar 2019 17:37:20 +0000 (18:37 +0100)]
testing: Prolonged Duck end entity certificate

20 months agoVersion bump to 5.8.0dr1
Andreas Steffen [Wed, 13 Mar 2019 17:36:45 +0000 (18:36 +0100)]
Version bump to 5.8.0dr1

20 months agochild-create: Add missing space in DH retry log message
Tobias Brunner [Wed, 13 Mar 2019 09:30:49 +0000 (10:30 +0100)]
child-create: Add missing space in DH retry log message

20 months agoandroid: New release after adding copy function and DNS server config
Tobias Brunner [Fri, 8 Mar 2019 16:08:11 +0000 (17:08 +0100)]
android: New release after adding copy function and DNS server config

20 months agoMerge branch 'openssl-chapoly'
Tobias Brunner [Fri, 8 Mar 2019 14:56:01 +0000 (15:56 +0100)]
Merge branch 'openssl-chapoly'

Adds support for ChaCha20-Poly1305 via OpenSSL.

Fixes #2946.

20 months agoopenssl: Add support for ChaCha20-Poly1305
Tobias Brunner [Mon, 4 Mar 2019 16:55:41 +0000 (17:55 +0100)]
openssl: Add support for ChaCha20-Poly1305

It's available since OpenSSL 1.1.0.

20 months agoopenssl: Generalize the GCM implementation a bit
Tobias Brunner [Mon, 4 Mar 2019 16:31:28 +0000 (17:31 +0100)]
openssl: Generalize the GCM implementation a bit

This will allow us to use the implementation also for other algorithms.

20 months agoMerge branch 'ikev1-redundant-updown'
Tobias Brunner [Fri, 8 Mar 2019 14:50:14 +0000 (15:50 +0100)]
Merge branch 'ikev1-redundant-updown'

Avoids calling updown script for redundant CHILD_SAs after IKEv1 rekey

Fixes #2902.

20 months agoikev1: Don't trigger updown event and close action for redundant CHILD_SAs
Tobias Brunner [Fri, 1 Feb 2019 11:05:55 +0000 (12:05 +0100)]
ikev1: Don't trigger updown event and close action for redundant CHILD_SAs

20 months agotask-manager-v1: Add utility function to check if CHILD_SA is redundant
Tobias Brunner [Fri, 1 Feb 2019 10:53:48 +0000 (11:53 +0100)]
task-manager-v1: Add utility function to check if CHILD_SA is redundant

20 months agovici: Correctly parse inactivity timeout as uint32_t
Tobias Brunner [Wed, 6 Mar 2019 17:39:28 +0000 (18:39 +0100)]
vici: Correctly parse inactivity timeout as uint32_t

Using parse_time() directly actually overwrites the next member in the
child_cfg_create_t struct, which is start_action, which can cause
incorrect configs if inactivity is parsed after start_action.

Fixes #2954.

20 months agoswanctl: Fix documentation of default value of hostaccess
Tobias Brunner [Thu, 7 Mar 2019 17:49:29 +0000 (18:49 +0100)]
swanctl: Fix documentation of default value of hostaccess

20 months agoandroid: Use helper to parse IP addresses where appropriate
Tobias Brunner [Tue, 5 Mar 2019 18:02:05 +0000 (19:02 +0100)]
android: Use helper to parse IP addresses where appropriate

20 months agoandroid: Add helper to parse IP addresses from strings
Tobias Brunner [Tue, 5 Mar 2019 17:47:33 +0000 (18:47 +0100)]
android: Add helper to parse IP addresses from strings

Using InetAddress.fromName() is not ideal as it might result in a DNS
resolution, which causes an exception if we do it from the main thread.

20 months agoandroid: Make DNS servers configurable in the GUI
Tobias Brunner [Tue, 5 Mar 2019 16:53:57 +0000 (17:53 +0100)]
android: Make DNS servers configurable in the GUI

20 months agoandroid: Import DNS servers
Tobias Brunner [Tue, 5 Mar 2019 16:44:48 +0000 (17:44 +0100)]
android: Import DNS servers

20 months agoandroid: Use configured custom DNS servers
Tobias Brunner [Tue, 5 Mar 2019 16:26:26 +0000 (17:26 +0100)]
android: Use configured custom DNS servers

20 months agoandroid: Add properties for DNS servers
Tobias Brunner [Tue, 5 Mar 2019 15:51:21 +0000 (16:51 +0100)]
android: Add properties for DNS servers

20 months agoandroid: Add menu option to copy a profile
Tobias Brunner [Tue, 5 Mar 2019 15:40:20 +0000 (16:40 +0100)]
android: Add menu option to copy a profile

Some users requests something like that to use different server IPs.
Interestingly, it's actually also possible to configure multiple
hostnames/IPs, separated by commas, as server address in the profile, which
are then tried one after another.

It's also useful when testing stuff to quickly compare the behavior with
some setting changed between two otherwise identical profiles.

20 months agoandroid: Remove buildToolsVersion
Tobias Brunner [Mon, 4 Mar 2019 16:34:30 +0000 (17:34 +0100)]
android: Remove buildToolsVersion

Finally a default is configured and we don't have to update this

20 months agoandroid: Update Gradle plugin
Tobias Brunner [Mon, 4 Mar 2019 16:34:12 +0000 (17:34 +0100)]
android: Update Gradle plugin

20 months agochild-sa: Remove temporary DROP policy using same parameters as when added
Carl Smith [Mon, 4 Mar 2019 01:43:00 +0000 (14:43 +1300)]
child-sa: Remove temporary DROP policy using same parameters as when added

A temporary DROP policy is added to avoid traffic leak
while the SA is being updated. It is added with
manual_prio set but when the temporary policy is removed
it is removed with manual_prio parameter set to 0.
The call to del_policies_outbound does not match the original
policy and we end up with an ever increasing refcount.

If we try to manually remove the policy, it is not removed
due to the positive refcount. Then new SA requests fail with
"unable to install policy out for reqid 1618,
the same policy for reqid 1528 exists"

Fixes: 35ef1b032d24 ("child-sa: Install drop policies while updating IPsec SAs and policies")
Closes strongswan/strongswan#129.

21 months agoload-tester: Update expired CA certificate
Tobias Brunner [Fri, 8 Feb 2019 08:58:03 +0000 (09:58 +0100)]
load-tester: Update expired CA certificate

Closes strongswan/strongswan#126.

21 months agotravis: OpenSSL version bump
Tobias Brunner [Tue, 26 Feb 2019 15:03:28 +0000 (16:03 +0100)]
travis: OpenSSL version bump

21 months agoagent: Don't keep socket to ssh/gpg-agent open
Tobias Brunner [Fri, 1 Feb 2019 08:48:43 +0000 (09:48 +0100)]
agent: Don't keep socket to ssh/gpg-agent open

Instead, create a socket when necessary.  Apparently, it can prevent
the agent from getting terminated (e.g. during system shutdown) if e.g.
charon-nm is still running with an open connection to the agent.

21 months agovici: Fix wrong argument order for terminate_ike() in clear_start_action()
Shmulik Ladkani [Tue, 19 Feb 2019 11:31:11 +0000 (13:31 +0200)]
vici: Fix wrong argument order for terminate_ike() in clear_start_action()

In 7b7290977 ("controller: Add option to force destruction of an IKE_SA")
the 'force' option was added as 3rd parameter to controller_t::terminate_ike.

However in vici's 'clear_start_action', the argument was incorrectly
placed as the 2nd parameter - constantly sending 0 (FALSE) as the
'unique_id' to terminate, rendering calls to 'handle_start_actions'
having undo=TRUE being unable to terminate the relevant conn.

For example, this is log of such a bogus 'unload-conn':

  strongswan[498]: 13[CFG] vici client 96 requests: unload-conn
  strongswan[498]: 13[CFG] closing IKE_SA #9
  strongswan[498]: 13[IKE] unable to terminate IKE_SA: ID 0 not found
  strongswan[498]: 09[CFG] vici client 96 disconnected

here, the unloaded conn's IKE id was 9, alas 'terminate_ike_execute'
reports failure to terminate "ID 0".

Fix by passing 'id, FALSE' arguments in the correct order.

Fixes: 7b7290977 ("controller: Add option to force destruction of an IKE_SA")
Signed-off-by: Shmulik Ladkani <>
Closes strongswan/strongswan#127.

21 months agolibimcv: Add Debian 9.7 to IMV database
Tobias Brunner [Wed, 30 Jan 2019 11:26:19 +0000 (12:26 +0100)]
libimcv: Add Debian 9.7 to IMV database

22 months agokernel-netlink: Fix compilation on old kernels (< 2.6.39)
Tobias Brunner [Fri, 18 Jan 2019 10:00:14 +0000 (11:00 +0100)]
kernel-netlink: Fix compilation on old kernels (< 2.6.39)

22 months agolibtpmtss: Read RSA public key exponent instead of assuming its value
krinfels [Sun, 20 Jan 2019 13:39:08 +0000 (14:39 +0100)]
libtpmtss: Read RSA public key exponent instead of assuming its value

Up to now it was assumed that the RSA public key exponent is equal to 2^16+1.
Although this is probably true in most if not all cases, it is not correct
according to the TPM 2.0 specification.

This patch fixes that by reading the exponent from the structure returned
by TPM2_ReadPublic.

Closes strongswan/strongswan#121.

22 months agounit-tests: Verify that E and emailAddress result in the same ID
Tobias Brunner [Fri, 18 Jan 2019 10:15:16 +0000 (11:15 +0100)]
unit-tests: Verify that E and emailAddress result in the same ID

22 months agoUse Botan 2.9.0 for tests
Tobias Brunner [Wed, 16 Jan 2019 16:11:46 +0000 (17:11 +0100)]
Use Botan 2.9.0 for tests

23 months agoVersion bump to 5.7.2 5.7.2
Andreas Steffen [Thu, 27 Dec 2018 11:11:49 +0000 (12:11 +0100)]
Version bump to 5.7.2

23 months agoUse https:// for URLs in documents
Tobias Brunner [Thu, 20 Dec 2018 15:06:00 +0000 (16:06 +0100)]
Use https:// for URLs in documents

Also adds contribution guidelines (for Github) with links to the wiki.

23 months agoVersion bump to 5.7.2rc1 5.7.2rc1
Andreas Steffen [Wed, 19 Dec 2018 12:21:48 +0000 (13:21 +0100)]
Version bump to 5.7.2rc1

23 months agoNEWS: More news for 5.7.2
Tobias Brunner [Tue, 18 Dec 2018 13:48:18 +0000 (14:48 +0100)]
NEWS: More news for 5.7.2

23 months agoFixed some typos, courtesy of codespell
Tobias Brunner [Tue, 18 Dec 2018 10:14:19 +0000 (11:14 +0100)]
Fixed some typos, courtesy of codespell

23 months agoMerge branch 'radius-accounting-unclaimed'
Tobias Brunner [Tue, 18 Dec 2018 09:34:17 +0000 (10:34 +0100)]
Merge branch 'radius-accounting-unclaimed'

Adds all IPs to RADIUS Accounting-Stop messages even those not claimed by
a client.  For instance, if the connection fails with FAILED_CP_REQUIRED,
adding the unclaimed addresses allows the RADIUS server to release the
leases early.

Fixes #2856.

23 months agoeap-radius: Don't clear unclaimed IPs early if accounting is enabled
Tobias Brunner [Tue, 11 Dec 2018 10:46:18 +0000 (11:46 +0100)]
eap-radius: Don't clear unclaimed IPs early if accounting is enabled

23 months agoeap-radius: Add unclaimed IPs to Accounting-Stop messages
Tobias Brunner [Tue, 11 Dec 2018 10:07:05 +0000 (11:07 +0100)]
eap-radius: Add unclaimed IPs to Accounting-Stop messages

Some RADIUS servers may use these to release them early.

23 months agoeap-radius: Add method to explicitly clear unclaimed IPs
Tobias Brunner [Tue, 11 Dec 2018 10:00:59 +0000 (11:00 +0100)]
eap-radius: Add method to explicitly clear unclaimed IPs

Instead of just enumerating them, removing and then destroying the entry
avoids having to keep the mutex locked.

23 months agoeap-radius: Add RADIUS Accounting session ID to Access-Request messages
Tobias Brunner [Fri, 14 Dec 2018 08:26:51 +0000 (09:26 +0100)]
eap-radius: Add RADIUS Accounting session ID to Access-Request messages

This allows e.g. associating database entries for IP leases and
accounting directly from the start.

Fixes #2853.

23 months agoswanctl: Make credential directories relative to swanctl.conf
Tobias Brunner [Wed, 12 Dec 2018 10:30:09 +0000 (11:30 +0100)]
swanctl: Make credential directories relative to swanctl.conf

All directories are now considered relative to the loaded swanctl.conf
file, in particular, when loading it from a custom location via --file
argument.  The base directory, which is used if no custom location for
swanctl.conf is specified, is now also configurable at runtime via
SWANCTL_DIR environment variable.

Closes strongswan/strongswan#120.

23 months agoopenssl: Make sure to release the functional ENGINE reference
Tobias Brunner [Tue, 11 Dec 2018 13:53:23 +0000 (14:53 +0100)]
openssl: Make sure to release the functional ENGINE reference

The functional reference created by ENGINE_init() was never released,
only the structural one created by ENGINE_by_id().  The functional
reference includes an implicit structural reference, which is also
released by ENGINE_finish().

Closes strongswan/strongswan#119.

23 months agoVersion bump to 5.7.2dr4 5.7.2dr4
Andreas Steffen [Sun, 9 Dec 2018 18:53:31 +0000 (19:53 +0100)]
Version bump to 5.7.2dr4

23 months agolibimcv: Updated openssl version in IMV database
Andreas Steffen [Sun, 9 Dec 2018 18:53:05 +0000 (19:53 +0100)]
libimcv: Updated openssl version in IMV database

23 months agotesting: Migrated ikev2 scenarios to swanctl
Andreas Steffen [Thu, 15 Nov 2018 15:05:56 +0000 (16:05 +0100)]
testing: Migrated ikev2 scenarios to swanctl

23 months agoMerge branch 'ikev1-adopt-child-tasks'
Tobias Brunner [Fri, 7 Dec 2018 09:38:32 +0000 (10:38 +0100)]
Merge branch 'ikev1-adopt-child-tasks'

Makes sure to adopt active and queued Quick Mode tasks if the peer
reauthenticates the IKE_SA while creating lots of CHILD_SAs.

Closes strongswan/strongswan#117.

23 months agoike: Implement adopt_child_tasks() outside task managers
Tobias Brunner [Wed, 28 Nov 2018 14:21:44 +0000 (15:21 +0100)]
ike: Implement adopt_child_tasks() outside task managers

23 months agoadopt-children-job: Adopt child-creating tasks from the old IKE_SA
Tobias Brunner [Wed, 28 Nov 2018 14:09:55 +0000 (15:09 +0100)]
adopt-children-job: Adopt child-creating tasks from the old IKE_SA

23 months agoike-sa: Expose task_manager_t::remove_task()
Tobias Brunner [Wed, 28 Nov 2018 13:54:31 +0000 (14:54 +0100)]
ike-sa: Expose task_manager_t::remove_task()

23 months agotask-manager: Add method to remove a task from a queue
Tobias Brunner [Wed, 28 Nov 2018 13:50:09 +0000 (14:50 +0100)]
task-manager: Add method to remove a task from a queue

23 months agoike-sa-manager: Migrate child creating tasks during IKEv1 reauth
Tobias Brunner [Tue, 20 Nov 2018 09:49:07 +0000 (10:49 +0100)]
ike-sa-manager: Migrate child creating tasks during IKEv1 reauth

23 months agoike-sa: Expose task_manager_t::adopt_child_tasks()
Tobias Brunner [Tue, 20 Nov 2018 09:48:01 +0000 (10:48 +0100)]
ike-sa: Expose task_manager_t::adopt_child_tasks()

23 months agocharon-cmd: Register atexit() handler for libcharon_deinit twice
Tobias Brunner [Thu, 6 Dec 2018 14:01:52 +0000 (15:01 +0100)]
charon-cmd: Register atexit() handler for libcharon_deinit twice

Similar to cbe9e575eef5, this avoids issues with libraries that are
pulled in via plugins and register their own atexit() handlers.

23 months agoikev2: Don't recreate IKE_SA if deletion fails after make-before-break reauth
Tobias Brunner [Wed, 5 Dec 2018 11:24:55 +0000 (12:24 +0100)]
ikev2: Don't recreate IKE_SA if deletion fails after make-before-break reauth

Fixes: 745714307256 ("During reauthentication reestablish IKE_SA even if deleting the old one fails.")
Fixes #2847.

23 months agoikev2: Ignore COOKIE notifies we already received
Tobias Brunner [Wed, 28 Nov 2018 14:52:27 +0000 (15:52 +0100)]
ikev2: Ignore COOKIE notifies we already received

This could be due to a delayed response to an IKE_SA_INIT retransmit.

Fixes #2837.

23 months agoha: Add auth method for HA IKEv1 key derivation
Thomas Egerer [Thu, 22 Nov 2018 17:08:51 +0000 (18:08 +0100)]
ha: Add auth method for HA IKEv1 key derivation

Signed-off-by: Thomas Egerer <>
23 months agoMerge branch 'ha-pool-offset'
Tobias Brunner [Fri, 7 Dec 2018 09:16:21 +0000 (10:16 +0100)]
Merge branch 'ha-pool-offset'

Ensure an even distribution of a pool's addresses among all segments.

Fixes #2828.

23 months agoha: Divide virtual IPs evenly among all segments
Tobias Brunner [Tue, 20 Nov 2018 15:40:21 +0000 (16:40 +0100)]
ha: Divide virtual IPs evenly among all segments

23 months agoha: Add getter for the number of segments
Tobias Brunner [Tue, 20 Nov 2018 15:39:04 +0000 (16:39 +0100)]
ha: Add getter for the number of segments

23 months agoha: Improve distribution of pool addresses over segments
Tobias Brunner [Tue, 20 Nov 2018 11:50:05 +0000 (12:50 +0100)]
ha: Improve distribution of pool addresses over segments

This is particularly important for higher number of segments, but even
with small numbers there is a significant difference.  For instance,
with 4 segments the fourth segment had no IPs assigned with the old
code, no matter how large the pool, because none of the eight bits used
for the segment check hashed/mapped to it.

23 months agokernel-pfkey: Read reqid directly from acquire if possible
Tobias Brunner [Mon, 22 Oct 2018 08:12:25 +0000 (10:12 +0200)]
kernel-pfkey: Read reqid directly from acquire if possible

Upcoming versions of FreeBSD will include an SADB_X_EXT_SA2 extension in
acquires that contains the reqid set on the matching policy.  This allows
handling acquires even when no policies are installed (e.g. to work with
FreeBSD's implementation of VTI interfaces, which manage policies

23 months agoikev2: Only set STAT_INBOUND for valid and expected messages
Tobias Brunner [Mon, 19 Nov 2018 09:18:27 +0000 (10:18 +0100)]
ikev2: Only set STAT_INBOUND for valid and expected messages

23 months agoscepclient: Don't use a block-scope buffer for the default DN
Tobias Brunner [Fri, 30 Nov 2018 09:28:50 +0000 (10:28 +0100)]
scepclient: Don't use a block-scope buffer for the default DN

The correct behavior will depend on the compiler.

Fixes #2843.

23 months agoMerge branch 'openssl-25519/448'
Tobias Brunner [Fri, 30 Nov 2018 15:45:47 +0000 (16:45 +0100)]
Merge branch 'openssl-25519/448'

Adds support for X25519/448 and Ed25519/448 via OpenSSL 1.1.1.

23 months agotravis: Don't run sonarcloud in forked repositories
Tobias Brunner [Fri, 23 Nov 2018 08:37:07 +0000 (09:37 +0100)]
travis: Don't run sonarcloud in forked repositories

23 months agotravis: Use the latest OpenSSL release for unit tests
Tobias Brunner [Thu, 22 Nov 2018 14:38:49 +0000 (15:38 +0100)]
travis: Use the latest OpenSSL release for unit tests

But also run the unit tests against the 1.0 version installed with
Ubuntu 16.04.

23 months agotravis: Only use GCC for crypto plugin tests
Tobias Brunner [Thu, 22 Nov 2018 17:30:46 +0000 (18:30 +0100)]
travis: Only use GCC for crypto plugin tests

They are already build-tested with Clang via "all" and others.

23 months agounit-tests: Add test suite for Ed448
Tobias Brunner [Fri, 16 Nov 2018 10:44:17 +0000 (11:44 +0100)]
unit-tests: Add test suite for Ed448

Same issue with signature malleability as with Ed25519 and apparently
OpenSSL doesn't even explicitly verify that the most significant 10 bits
are all zero.

23 months agounit-tests: Add fingerprint test vectors for Ed25519
Tobias Brunner [Fri, 30 Nov 2018 14:34:32 +0000 (15:34 +0100)]
unit-tests: Add fingerprint test vectors for Ed25519