Commit Graph

16964 Commits

Author SHA1 Message Date
Tobias Brunner e4a3ef2e4d Use https:// for URLs in documents
Also adds contribution guidelines (for Github) with links to the wiki.
2018-12-20 16:13:02 +01:00
Andreas Steffen 023b9c0edc Version bump to 5.7.2rc1 2018-12-19 13:21:48 +01:00
Tobias Brunner d1e58e11f7 NEWS: More news for 5.7.2 2018-12-18 14:48:18 +01:00
Tobias Brunner db82c0f594 Fixed some typos, courtesy of codespell 2018-12-18 11:14:19 +01:00
Tobias Brunner 0329645182 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.
2018-12-18 10:34:17 +01:00
Tobias Brunner 61efac6512 eap-radius: Don't clear unclaimed IPs early if accounting is enabled 2018-12-18 10:28:51 +01:00
Tobias Brunner 2de6d9d8d3 eap-radius: Add unclaimed IPs to Accounting-Stop messages
Some RADIUS servers may use these to release them early.
2018-12-18 10:28:51 +01:00
Tobias Brunner 0407d72acf 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.
2018-12-18 10:28:51 +01:00
Tobias Brunner 533efa91e2 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.
2018-12-17 09:46:09 +01:00
Tobias Brunner 501bd53a6c 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.
2018-12-14 09:11:14 +01:00
Tobias Brunner 322daff844 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.
2018-12-12 12:00:29 +01:00
Andreas Steffen 7cf3f97e56 Version bump to 5.7.2dr4 2018-12-09 19:53:31 +01:00
Andreas Steffen 77e4a420c3 libimcv: Updated openssl version in IMV database 2018-12-09 19:53:05 +01:00
Andreas Steffen 030de21b7b testing: Migrated ikev2 scenarios to swanctl 2018-12-09 13:16:41 +01:00
Tobias Brunner be1c7e3815 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.
2018-12-07 10:40:08 +01:00
Tobias Brunner 5e97a5e64b ike: Implement adopt_child_tasks() outside task managers 2018-12-07 10:32:12 +01:00
Tobias Brunner f536f6477d adopt-children-job: Adopt child-creating tasks from the old IKE_SA 2018-12-07 10:32:12 +01:00
Tobias Brunner b71604011a ike-sa: Expose task_manager_t::remove_task() 2018-12-07 10:32:12 +01:00
Tobias Brunner 4505e3c0df task-manager: Add method to remove a task from a queue 2018-12-07 10:32:12 +01:00
Tobias Brunner 44558547af ike-sa-manager: Migrate child creating tasks during IKEv1 reauth 2018-12-07 10:32:12 +01:00
Tobias Brunner 00c889f4ec ike-sa: Expose task_manager_t::adopt_child_tasks() 2018-12-07 10:32:12 +01:00
Tobias Brunner 157150ca91 charon-cmd: Register atexit() handler for libcharon_deinit twice
Similar to cbe9e575ee, this avoids issues with libraries that are
pulled in via plugins and register their own atexit() handlers.
2018-12-07 10:30:08 +01:00
Tobias Brunner 10f8834bf9 ikev2: Don't recreate IKE_SA if deletion fails after make-before-break reauth
Fixes: 7457143072 ("During reauthentication reestablish IKE_SA even if deleting the old one fails.")
Fixes #2847.
2018-12-07 10:28:21 +01:00
Tobias Brunner 01f462f0d3 ikev2: Ignore COOKIE notifies we already received
This could be due to a delayed response to an IKE_SA_INIT retransmit.

Fixes #2837.
2018-12-07 10:25:30 +01:00
Thomas Egerer eed20c21d3 ha: Add auth method for HA IKEv1 key derivation
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2018-12-07 10:17:56 +01:00
Tobias Brunner 13f92f649e Merge branch 'ha-pool-offset'
Ensure an even distribution of a pool's addresses among all segments.

Fixes #2828.
2018-12-07 10:16:21 +01:00
Tobias Brunner 5dbb826da5 ha: Divide virtual IPs evenly among all segments 2018-12-07 10:15:40 +01:00
Tobias Brunner 16a898f5f7 ha: Add getter for the number of segments 2018-12-07 10:15:05 +01:00
Tobias Brunner a8f91cd466 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.
2018-12-07 10:12:14 +01:00
Tobias Brunner 872b9b3e8d 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
themselves).
2018-12-03 12:01:43 +01:00
Tobias Brunner c99d3b6f63 ikev2: Only set STAT_INBOUND for valid and expected messages 2018-12-03 12:00:24 +01:00
Tobias Brunner 631abb6810 scepclient: Don't use a block-scope buffer for the default DN
The correct behavior will depend on the compiler.

Fixes #2843.
2018-12-03 11:54:05 +01:00
Tobias Brunner 686a1b971d Merge branch 'openssl-25519/448'
Adds support for X25519/448 and Ed25519/448 via OpenSSL 1.1.1.
2018-11-30 16:48:02 +01:00
Tobias Brunner a4e698b6f9 travis: Don't run sonarcloud in forked repositories 2018-11-30 16:03:10 +01:00
Tobias Brunner 2a58030b78 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.
2018-11-30 16:03:10 +01:00
Tobias Brunner 7195914daf travis: Only use GCC for crypto plugin tests
They are already build-tested with Clang via "all" and others.
2018-11-30 15:57:35 +01:00
Tobias Brunner 25e62f01ea 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.
2018-11-30 15:57:35 +01:00
Tobias Brunner 8d7bf5b039 unit-tests: Add fingerprint test vectors for Ed25519 2018-11-30 15:47:21 +01:00
Tobias Brunner 2571898d32 curve25519: Prevent Ed25519 signature malleability
As per RFC 8032, section 5.1.7 (and section 8.4) we have to make sure s, which
is the scalar in the second half of the signature value, is smaller than L.
Without that check, L can be added to most signatures at least once to create
another valid signature for the same public key and message.

This could be problematic if, for instance, a blacklist is based on hashes
of certificates.  A new certificate could be created with a different
signature (without knowing the signature key) by simply adding L to s.

Currently, both OpenSSL 1.1.1 and Botan 2.8.0 are vulnerable to this, which is
why the unit test currently only warns about it.
2018-11-30 15:35:01 +01:00
Tobias Brunner 69756c0bff openssl: Use separate DRBG for RNG_STRONG and RNG_TRUE with OpenSSL 1.1.1
OpenSSL 1.1.1 introduces DRGBs and provides two sources (same security
profile etc. but separate internal state), which allows us to use one for
RNG_WEAK (e.g. for nonces that are directly publicly visible) and the other
for stronger random data like keys.
2018-11-30 15:35:01 +01:00
Tobias Brunner 6fc90cea74 leak-detective: Whitelist functions added in OpenSSL 1.1.1 2018-11-30 15:35:01 +01:00
Tobias Brunner cbf07ab5b0 openssl: Add support for Ed25519/Ed448 2018-11-30 15:35:01 +01:00
Tobias Brunner d222699c78 dh-speed: Add curve448 keyword 2018-11-30 14:54:33 +01:00
Tobias Brunner 9dfbe9442b test-vectors: Add vector for X448 2018-11-30 14:54:33 +01:00
Tobias Brunner 57cb4c8d2c openssl: Add support for X25519 and X448
While X25519 was already added with 1.1.0a, its use would be a lot more
complicated, as the helpers like EVP_PKEY_new_raw_public_key() were only
added in 1.1.1, which also added X448.
2018-11-30 14:53:38 +01:00
Tobias Brunner 2421b7ddb8 bypass-lan: Compare interface for unchanged policies
In case a subnet is moved from one interface to another the policies can
remain as is but the route has to change.  This currently doesn't happen
automatically and there is no option to update the policy or route so
removing and reinstalling the policies is the only option.

Fixes #2820.
2018-11-22 11:38:55 +01:00
Tobias Brunner ecba84a06b child-delete: Don't send delete for expired CHILD_SAs that were already rekeyed
The peer might not have seen the CREATE_CHILD_SA response yet, receiving a
DELETE for the SA could then trigger it to abort the rekeying, causing
the deletion of the newly established SA (it can't know whether the
DELETE was sent due to an expire or because the user manually deleted
it).  We just treat this SA as if we received a DELETE for it.  This is
not an ideal situation anyway, as it causes some traffic to get dropped,
so it should usually be avoided by setting appropriate soft and hard limits.

References #2815.
2018-11-22 11:31:53 +01:00
Tobias Brunner a9b9450c54 kernel-netlink: Update SA selector if it contains changed IP address(es) 2018-11-22 11:22:58 +01:00
Tobias Brunner 97c4551ec8 Avoid inclusion of unistd.h in generated lexers
Because the file is not available on all platforms the inclusion comes
after the user options in order to disable including it.  But that means
the inclusion also follows after the defined scanner states, which are
generated as simple #defines to numbers.  If the included unistd.h e.g.
uses variables in function definitions with the same names this could
result in compilation errors.

Interactive mode has to be disabled too as it relies on isatty() from
unistd.h.  Since we don't use the scanners interactively, this is not a
problem and might even make the scanners a bit faster.

Fixes #2806.
2018-11-22 11:17:35 +01:00
Tobias Brunner 85431bf2e7 Merge branch 'travis-xenial'
Run builds on Travis on Ubuntu Xenial (16.04) images.
2018-11-21 14:40:00 +01:00