Commit Graph

17136 Commits

Author SHA1 Message Date
Tobias Brunner e0f7da8644 vici: Extract command wrappers in Python bindings
This simplifies the interface and allows calling not yet wrapped
commands more easily.
2019-04-26 09:18:54 +02:00
Tobias Brunner 89c8ba525b eap-aka-3gpp2: Increase SQN after each authentication 2019-04-25 15:58:17 +02:00
Tobias Brunner f9e8f5a623 Merge branch 'childless'
Adds support for childless initiation of IKE_SAs (RFC 6023) e.g. to
force a separate DH exchange for all CHILD_SAs including the first one.

Also allows the initiation of only the IKE_SA via swanctl --initiate if
the peer supports this extension.

Closes strongswan/strongswan#99.
2019-04-25 15:32:02 +02:00
Tobias Brunner 012221a867 testing: Add swanctl/net2net-childless scenario 2019-04-25 15:23:19 +02:00
Tobias Brunner fbb0feeea9 unit-tests: Add unit tests for childless IKE_SA initiation 2019-04-25 15:23:19 +02:00
Tobias Brunner 1b19469c67 unit-tests: Make childless initiation configurable 2019-04-25 15:23:19 +02:00
Tobias Brunner e0678a8cc6 unit-tests: Add helper to create but not yet establish two IKE_SAs 2019-04-25 15:23:19 +02:00
Tobias Brunner 202fb101b8 unit-tests: Add macros to assert certain payloads are (not) in a message 2019-04-25 15:23:19 +02:00
Tobias Brunner c863960eb1 vici: Support initiation of IKE_SAs
The configuration must allow the initiation of a childless IKE_SA (which
is already the case with the default of 'accept').
2019-04-25 15:23:19 +02:00
Tobias Brunner 2889b77da2 vici: Make childless initiation of IKE_SAs configurable 2019-04-25 15:23:19 +02:00
Tobias Brunner 6b00d34b42 controller: Make child config optional for initiate() 2019-04-25 15:23:19 +02:00
Tobias Brunner ed521a7470 child-create: Initiate and handle childless IKE_SAs according to RFC 6023 2019-04-25 15:23:19 +02:00
Tobias Brunner 93104d0fe9 ike-init: Notify initiator if childless IKE_SAs are accepted 2019-04-25 14:31:39 +02:00
Tobias Brunner ddb083c164 ike-cfg: Add setting for childless IKE_SAs 2019-04-25 14:31:39 +02:00
Tobias Brunner 9486a2e5b0 ike-cfg: Pass arguments as struct 2019-04-25 14:31:33 +02:00
SophieK de77957eda proposal-substructure: Fix incorrect type for IKEv2 proposals
Luckily, the type is only used once when generating payloads and there it
doesn't matter because the encoding rules are the same.

Closes strongswan/strongswan#135.
2019-04-25 09:40:51 +02:00
Tobias Brunner 35392aa869 testing: Use renamed systemd unit
While the alias is available after enabling the unit, we don't
actually do that in our testing environment (adding a symlink manually
would work too, then again, why not just use the proper name?).
2019-04-24 13:57:48 +02:00
Tobias Brunner 1815c1de52 init: Rename systemd units
Use strongswan-starter for the legacy unit and simply strongswan for the
modern one (strongswan-swanctl is configured as alias, which should
cause the installation of symlinks when the service is enabled via
systemctl).
2019-04-24 13:57:48 +02:00
Tobias Brunner 20550480e1 Merge branch 'wolfssl'
Adds a plugin that uses wolfSSL for cryptographic operations.

Closes strongswan/strongswan#133.
2019-04-24 13:56:54 +02:00
Tobias Brunner d50bb81c7d travis: Run tests against wolfSSL
Check for wolfssl/options.h because if it isn't included, checking other
headers will trigger a warning about hardening the wolfSSL build, which
will cause the check to fail with -Werror.

If the file doesn't exist because user_settings.h is used, the check may
be skipped by configuring with `ac_cv_header_wolfssl_options_h=yes`.
2019-04-24 12:26:08 +02:00
Tobias Brunner d3329ee540 wolfssl: Fixes, code style changes and some refactorings
The main fixes are

 * the generation of fingerprints for RSA, ECDSA, and EdDSA
 * the encoding of ECDSA private keys
 * calculating p and q for RSA private keys
 * deriving the public key for raw Ed25519 private keys

Also, instead of numeric literals for buffer lengths ASN.1 related
constants are used.
2019-04-24 12:26:08 +02:00
Tobias Brunner 59be02519a unit-tests: Add tests for ECDSA fingerprints and encoding 2019-04-24 11:40:14 +02:00
Tobias Brunner 179aa72fdf unit-tests: Add tests for RSA fingerprints and encoding 2019-04-24 11:40:14 +02:00
Tobias Brunner a5a8f2bce2 chunk: Add helper to copy a chunk left-padded to a certain length 2019-04-24 11:40:14 +02:00
Sean Parkinson c92eade82c wolfssl: Add wolfSSL plugin for cryptographic implementations 2019-04-24 11:40:14 +02:00
Tobias Brunner 6a995a63f5 Merge branch 'android-fixes'
Fixes an upgrade issue and includes UTF8 support for EAP-MSCHAPv2.
2019-04-24 11:37:33 +02:00
Tobias Brunner 8da7dbe766 socket-default: Fix setting DSCP value on FreeBSD
Fixes #3030.
2019-04-23 11:49:04 +02:00
Tobias Brunner 8eafdc7f54 android: New release after fixing DB update and adding UTF-8 for EAP-MSCHAPv2 2019-04-16 15:58:31 +02:00
Tobias Brunner 199412a8ef android: Fix database upgrade from older versions 2019-04-16 15:08:23 +02:00
Tobias Brunner 4c0d74bc12 eap-mschapv2: Convert UTF-8-encoded passwords
Instead of assuming passwords are simply ASCII-encoded we now assume they are
provided UTF-8-encoded, which is quite likely nowadays.  The UTF-8 byte
sequences are not validated, however, only valid code points are encoded
as UTF-16LE.

Fixes #3014.
2019-04-16 11:26:49 +02:00
Tobias Brunner e601b89c00 testing: Use latest tkm-rpc and x509-ada versions
Includes fixes for larger signatures, critical extensions and
utf8Strings in DNs.
2019-04-15 18:31:12 +02:00
Tobias Brunner a3885b86e6 child-create: Make sure the mode selected by the responder is acceptable
Previously, the initiator would install the SA in transport mode if the
peer sent back the USE_TRANSPORT_MODE notify, even if that was not
requested originally.
2019-04-15 14:31:57 +02:00
Tobias Brunner 7b2236526c message: Enforce encryption except for INFORMATIONALs
The only messages that are generally sent encrypted but could be sent
unencrypted are INFORMATIONALs (currently only used for IKEv1 and ME
connectivity checks).  This should prevent issues if the keymat_t behaves
incorrectly and does not return an aead_t when it actually should.
2019-04-15 14:01:02 +02:00
Tobias Brunner cfac7305ab testing: Create new files in mounted strongSwan sources as regular user 2019-04-15 14:01:02 +02:00
Tobias Brunner 62d43ea694 ike-sa-manager: Extract IKE SPI labeling feature from charon-tkm
Might be useful for users of other daemons too. Note that compared to the
previous implementation in charon-tkm, the mask/label are applied in
network order.

Closes strongswan/strongswan#134.
2019-04-11 09:51:02 +02:00
Tobias Brunner f5ad3cf491 eap-aka-3gpp: Ignore test runner in repository 2019-04-04 18:40:22 +02:00
Tobias Brunner f36e375578 travis: Check for unignored build artifacts after the build 2019-04-04 18:40:22 +02:00
Tobias Brunner 5af924a650 ike-config: If we don't send a CFG_REQUEST, we don't expect a CFG_REPLY
Previously, attributes in an incorrectly sent CFG_REPLY would still be passed
to attribute handlers.  This does not prevent handlers from receiving
unrequested attributes if they requested at least one other.
2019-04-04 11:06:20 +02:00
Tobias Brunner b5ac0bd35f ike-config: Ignore unrequested virtual IP addresses
But forward them to handlers in case they requested them.
2019-04-04 11:06:20 +02:00
Tobias Brunner c334cd9f62 Merge branch 'xfrmi'
This adds support for XFRM interfaces, which replace VTI devices and are
available with 4.19+ Linux kernels.

IPsec SAs and policies are associated with such interfaces via interface
IDs that can be configured on the CHILD_SA-level (dynamic IDs may
optionally be allocated for each instance and even direction) or on the
IKE_SA-level (again, dynamic IDs may be optionally allocated per IKE_SA).
IDs on an IKE_SA are inherited by all CHILD_SAs created under it, unless
the child configuration overrides them.

The effect the interface ID has on policies is similar to that of marks,
i.e. they won't match packets unless they are routed via interface with
matching interface ID.  So it's possible to negotiate e.g. 0.0.0.0/0 as
traffic selector on both sides and then control the affected traffic via
routes/firewall.

It's possible to use separate interfaces for in- and outbound traffic (or
only use an interface in one direction and regular policies in the other).

Since iproute2 does not yet support XFRM interfaces, a small utility is
provided that allows creating and listing XFRM interfaces.

Interfaces may be created dynamically via updown/vici scripts or
statically (before or after establishing the SAs).  Routes must be added
manually as needed (the daemon will not install any routes for outbound
policies with an interface ID).

When moving XFRM interfaces to other network namespaces they retain access
to the SAs and policies created in the original namespace, which allows
providing IPsec tunnels for processes in other network namespaces without
giving them access to the IPsec keys or IKE credentials.

Fixes #2845.
2019-04-04 10:41:01 +02:00
Tobias Brunner 072de7c150 testing: Add scenario that uses IKE-specific interface IDs 2019-04-04 09:36:38 +02:00
Tobias Brunner 14e999c8d5 testing: Install python-daemon with strongSwan for use in updown scripts 2019-04-04 09:36:38 +02:00
Tobias Brunner 181801317b testing: Add /etc/resolv.conf when building strongSwan 2019-04-04 09:36:38 +02:00
Tobias Brunner ceca26c88e testing: Enable Python eggs in testing environment (i.e. vici's Python bindings) 2019-04-04 09:36:38 +02:00
Tobias Brunner ebe2bedebd configure: Fix package version for python packages for developer releases
According to PEP 440 the suffix for development releases is .devN and
not just devN.
2019-04-04 09:36:38 +02:00
Tobias Brunner 0396969a36 vici: Add support for interface ID configurable on IKE_SA 2019-04-04 09:36:38 +02:00
Tobias Brunner fafa76984d child-sa: Pass default interface ID inherited from IKE_SA
Also pass optional arguments as struct.
2019-04-04 09:36:38 +02:00
Tobias Brunner dec3c184a6 ike-sa: Add property for interface ID 2019-04-04 09:36:38 +02:00
Tobias Brunner 9347f72494 ipsec-types: Move allocation of unique interface IDs to helper function 2019-04-04 09:31:38 +02:00
Tobias Brunner c56b8c1a26 peer-cfg: Add property for interface ID 2019-04-04 09:31:38 +02:00