Commit Graph

17424 Commits

Author SHA1 Message Date
Thomas Egerer d2c15b7bf9 vici: Allow maximum vici message size configuration via compile option
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2020-04-14 16:55:49 +02:00
Tobias Brunner e0b1b12028 Use Botan 2.14.0 for tests
Requires at least GCC 5.0 to build with `--amalgamation`, so it's
disabled for our Ubuntu 16.04 build.
2020-04-07 16:37:27 +02:00
Andreas Steffen 3273667b0b Version bump to 5.8.4 2020-03-29 12:49:52 +02:00
Tobias Brunner c5c1898d73 openssl: Allow squeezing multiple times from SHAKE128/256 XOFs
OpenSSL currently doesn't support squeezing bytes out of an XOF multiple
times.  Unfortunately, EVP_DigestFinalXOF() completely resets the context
and later calls not simply fail, they cause a null-pointer dereference in
libcrypto.  This fixes the crash at the cost of repeating initializing
the whole state and allocating too much data for subsequent calls.

There is an open issue and PR that might add a function that allows
squeezing more data from an XOF in a future version of OpenSSL.
2020-03-29 12:49:52 +02:00
Tobias Brunner 6c98164f60 charon-nm: Allow using fixed source ports
This could be useful in cases a client behind a NAT has to be made reachable
via port forwarding.

Closes strongswan/strongswan#166.
2020-03-27 14:25:38 +01:00
Thomas Egerer 99bef7b686 settings: Use strtoul(3) for settings to int conversion
strtol(3) accepts values in the range of [LONG_MIN;LONG_MAX].  Based
on the architecture (32 or 64 bits), these values expand to either
0x8000000000000000/0x7fffffffffffffff for 64-bit builds, or
0x80000000/0x7fffffff for 32-bit builds.

The behavior when retrieving non-default values for charon.spi_min or
charon.spi_max, for example, depends on the architecture of the target
platform.  While 0xC000001/0xCFFFFFFE work fine on a 64-bit build, on a
32-bit build, due to the use of strtol(3), an ERANGE causes get_int()
to return the default values.

By using strtoul(3) the default is only returned if the input value
exceeds 32 or 64 bits, based on the platform.  Negative values are still
parsed correctly.

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2020-03-26 15:26:59 +01:00
Tobias Brunner cb26c5547c quick-mode: Make sure we have a proposal before determining lifetimes
Fixes: e0dd36c9c7 ("ikev1: Get and set the lifetimes of the selected proposal/transform")
2020-03-26 08:41:00 +01:00
Tobias Brunner 6987f6b3eb unit-tests: Update expired certificates for TLS tests 2020-03-25 15:31:07 +01:00
Tobias Brunner b2d3726501 nm: Version bump to 1.5.0 2020-03-25 10:14:46 +01:00
Andreas Steffen 0728387ea9 Version bump to 5.8.3 2020-03-24 16:01:04 +01:00
Tobias Brunner 393e0167fd charon-nm: Correctly set remote auth class for PSK authentication
Fixes: bc3eda99ba ("charon-nm: Add support for EAP-TLS")
2020-03-20 16:06:12 +01:00
Andreas Steffen c88a4996fa Version bump to 5.8.3rc1 2020-03-19 08:43:10 +01:00
Tobias Brunner 298c389bfa NEWS: Add news for 5.8.3 2020-03-13 15:15:25 +01:00
Tobias Brunner 9f91f0b3c8 openssl: Add support for SHAKE128/256 2020-03-10 14:12:34 +01:00
Tobias Brunner 112de13f1f openssl: Add support for SHA-3 2020-03-10 14:12:34 +01:00
Tobias Brunner bbedad78c3 Merge branch 'throw-type-routes'
Implements simpler routes for passthrough policies on Linux, which
basically act as fallbacks on routes in other routing tables.  This way
they require less information (e.g. no interface or source IP) and can
be installed earlier and are not affected by updates.

Closes strongswan/strongswan#165.
Fixes #3118.
2020-03-10 12:49:53 +01:00
Tobias Brunner dfd261d2de kernel-netlink: Extract shared route handling code in net/ipsec 2020-03-10 10:30:39 +01:00
Tobias Brunner e23708bdf3 kernel-netlink: Don't require an interface name for passthrough policies 2020-03-10 10:26:42 +01:00
Tobias Brunner b0b6bd2470 kernel-netlink: Allow blank source address in routes for passthrough policies 2020-03-10 10:25:19 +01:00
Noel Kuntze 09f4bccfea kernel-netlink: Implement passthrough type routes and use them on Linux
Enables us to ignore any future kernel features for routes unless
we actually need to consider them for the source IP routes.

Also enables us to actually really skip IPsec processing for those networks
(because even the routes don't touch those packets). It's more what
users expect.

Co-authored-by: Tobias Brunner <tobias@strongswan.org>
2020-03-10 10:20:58 +01:00
Tobias Brunner 4958acc0c2 kernel-interface: Reallocate previously used reqids
This is mainly an issue on FreeBSD where the current kernel still only
allows the daemon to use reqids < IPSEC_MANUAL_REQID_MAX (0x3fff = 16383).

Fixes #2315.
2020-03-09 15:27:03 +01:00
Thomas Egerer 05e373aeb0 ike: Optionally allow private algorithms for IKE/CHILD_SAs
Charon refuses to make use of algorithms IDs from the private space
for unknown peer implementations [1]. If you chose to ignore and violate
that section of the RFC since you *know* your peers *must* support those
private IDs, there's no way to disable that behavior.

With this commit a strongswan.conf option is introduced which allows to
deliberately ignore parts of section 3.12 from the standard.

[1] http://tools.ietf.org/html/rfc7296#section-3.12

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2020-03-06 11:15:15 +01:00
Tobias Brunner 61769fd1e3 openssl: Don't check signature if issuer doesn't match always
Doing this for the self-signed check also (i.e. if this and issuer are
the same) is particularly useful if the issuer uses a different key type.
Otherwise, we'd try to verify the signature with an incompatible key
that would result in a log message.

Fixes #3357.
2020-03-06 11:12:07 +01:00
Tobias Brunner 5761077091 nm: Update NEWS for next release 2020-03-06 11:06:11 +01:00
Tobias Brunner 14a779956e Merge branch 'ikev1-transform-nr'
With these changes we return the lifetimes of the actually selected
transform back to the client, which is an issue if the peer uses
different lifetimes for different proposals.  We now also return the
correct transform and proposal IDs.

Fixes #3329.
2020-03-06 10:47:34 +01:00
Tobias Brunner e0dd36c9c7 ikev1: Get and set the lifetimes of the selected proposal/transform
Previously, we simply used the lifetimes of the first
proposal/transform, which is not correct if the initiator uses different
lifetimes in its proposals/transforms.
2020-03-06 10:31:30 +01:00
Tobias Brunner 1c6b43b8ea proposal-substructure: Start numbering IKEv1 proposals with 1 2020-03-06 10:31:30 +01:00
Tobias Brunner 859f9c8c83 proposal-substructure: Encode transform number of selected IKEv1 proposal 2020-03-06 10:31:30 +01:00
Tobias Brunner 7da3143aac proposal-substructure: Store transform number for IKEv1 proposals 2020-03-06 10:31:30 +01:00
Tobias Brunner e630f2d373 proposal: Add IKEv1 transform number on which a proposal is based 2020-03-06 10:31:30 +01:00
Tobias Brunner 479c85d569 libtls: Remove unused variable in TLS socket implementation
Not used anymore since c43e8fdec4 ("Block TLS read when sending data,
but have to wait for the handshake data first").
2020-03-06 10:30:16 +01:00
Andreas Steffen 68e8fedccb Version bump to 5.8.3dr1 2020-03-04 22:27:13 +01:00
Tobias Brunner 0399314903 script: Fix upper bounds
^ is the XOR operator.
2020-03-04 17:07:32 +01:00
Tobias Brunner e1cc667920 pubkey-speed: Add sanity check for the number of rounds
The allocated buffer for the signatures is based on this, which LGTM
doesn't like.
2020-03-03 11:34:22 +01:00
Tobias Brunner 7a13246668 crypt-burn: Add sanity check for buffer length
This value is passed to chunk_alloc(), which LGTM complains about.
2020-03-03 11:32:31 +01:00
Tobias Brunner 1966f4332b configure: Make sure Python is available for static builds
We need Python to create files that reference the plugin constructors.
Without it, empty files are created and plugins can't be loaded.

Fixes #3349.
2020-02-28 13:55:18 +01:00
Tobias Brunner 1f2c83db61 travis: Enable caching for sonarcloud scan 2020-02-21 16:11:44 +01:00
Tobias Brunner 96b61792df ike: Don't reestablish IKE_SAs for which a deletion is queued
If an IKE_SA is terminated while a task is active, the delete task is
simply queued (unless the deletion is forced).  If the active task times
out before any optional timeout associated with the termination hits, the
IKE_SA previously was reestablished without considering the termination
request.

Fixes #3335.
2020-02-21 10:38:13 +01:00
Tobias Brunner 17fc6234c4 Remove obsolete packages directory
These Debian package sources have not been updated for years and are
severely out-of-date.  Since the Debian packages are properly
maintained nowadays, we don't have to provide our own package sources
to serve as examples.

References #3344.
2020-02-21 09:52:49 +01:00
Tobias Brunner 89e5eb7213 travis: Bump tpm2-tss to 2.3.3 2020-02-21 09:52:49 +01:00
Tobias Brunner e365bef4a4 travis: Remove deprecated `sudo` option, set default OS
Also replaces `matrix` with the current official name `jobs`.
2020-02-21 09:49:27 +01:00
Tobias Brunner cfed3a87ee charon-nm: Use better default directory for D-Bus policy file
Also makes it configurable via configure script.  Depending on `$datadir` is
not ideal as package maintainers might set that to a custom value.  Depending
on `$datarootdir` might have been better, the default if pkg-config fails is
now based on that.

References #3339.
2020-02-21 09:46:13 +01:00
Tobias Brunner 658b6df4d8 travis: Add build tests for NM plugin 2020-02-14 14:53:26 +01:00
Tobias Brunner 7eab520bbf nm: Ignore generated POT file 2020-02-14 14:53:26 +01:00
Tobias Brunner ca3ff27101 nm: Only check PSK length if one is actually stored 2020-02-14 14:51:43 +01:00
Tobias Brunner c41419fa2e Merge commit 'nm-client-id'
Makes the client's IKE identity configurable in the NM GUI.  For PSK
authentication the identity is now configured via that new field
and not the username anymore (old configs still work and are migrated
when edited).  The client identity now also defaults to the IP address
if not configured when using EAP/PSK.

Fixes #2581.
2020-02-14 14:47:34 +01:00
Tobias Brunner d57d5f510d nm: Make local identity configurable
For PSK authentication we now use the local identity and not the username
field.
2020-02-14 14:45:32 +01:00
Tobias Brunner ff8f6b15aa charon-nm: Add support for custom local IKE identities 2020-02-14 14:35:44 +01:00
Tobias Brunner 571769fe50 Merge branch 'nm-reauth'
With these changes, the NM service should be able to handle
reauthentication (and redirection) by switching to the new IKE_SA and
not considering the old SA going down an error.

Fixes #852.
2020-02-14 13:58:50 +01:00
Tobias Brunner 5575aaf5c8 charon-nm: Keep listener registered even on failures
NM doesn't seem to terminate the daemon on failures, so we might not get
further events for later retries.
2020-02-14 13:55:42 +01:00