18310 Commits

Author SHA1 Message Date
Leon Romanovsky
012e4cd902 kernel-netlink: Remove unimplemented XFRM_OFFLOAD_IPV6 flag
The XFRM_OFFLOAD_IPV6 flag was never implemented in the kernel and there
are no plans to do so.

Kernel patch: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7c76ecd9c99b6e9a771d813ab1aa7fa428b3ade1

Closes strongswan/strongswan#916
2022-03-14 15:48:21 +01:00
Andreas Steffen
b2cf5af192 README: Added link to docs.strongswan.org 2022-03-02 21:55:43 +01:00
Tobias Brunner
c8045f86a3 testing: Increase memory on winnetou even more 2022-03-01 10:10:37 +01:00
Tobias Brunner
2ade4311bc tls-server: Use correct error alerts if client doesn't send a certificate
TLS 1.3 defines a specific alert for this and for TLS 1.2, RFC 5246,
section 7.4.6 defines handshake_failure as correct response.
2022-03-01 10:05:26 +01:00
Tobias Brunner
3eecd40cec openssl: Don't unload providers
There is a conflict between atexit() handlers registered by OpenSSL and
some executables (e.g. swanctl or pki) to deinitialize libstrongswan.
Because plugins are usually loaded after atexit() has been called, the
handler registered by OpenSSL will run before our handler.  So when the
latter destroys the plugins it's a bad idea to try to access any OpenSSL
objects as they might already be invalid.

Fixes: f556fce16b60 ("openssl: Load "legacy" provider in OpenSSL 3 for algorithms like MD4, DES etc.")
Closes strongswan/strongswan#921
2022-02-24 15:03:09 +01:00
Tobias Brunner
e69438450f Use wolfSSL 5.2.0 for tests 2022-02-22 09:35:01 +01:00
Tobias Brunner
9e3978259e mgf1: Fix Doxygen group for XOF implementation 2022-02-17 16:34:56 +01:00
Tobias Brunner
963adc7637 xof: Fix typo in documentation for set_seed() 2022-02-17 16:34:56 +01:00
Tobias Brunner
eccfd27f03 tls-peer: Simplify identity check for server certificate
has_subject() already matches the identity against the subject DN and
all the SANs (it actually already did when this check was added with
c81147998619 ("Strictly check if the server certificate matches the TLS
server identity")).
2022-02-15 16:54:39 +01:00
Tobias Brunner
42704f6a61 tls-test: Add option to specify a specific remote identity 2022-02-15 16:54:39 +01:00
Tobias Brunner
e4b4aabc49 libtls: Enforce client/server identity when looking for public key
The client already enforces that the server identity is contained in the
received certificate.  But on the server, the referenced commit changed
the lookup from the configured (or adopted if %any was configured) client
identity to the subject DN of the received client certificate.  So any
client with a trusted certificate was accepted.

Fixes: d2fc9b0961c6 ("tls-server: Mutual authentication support for TLS 1.3")
Closes strongswan/strongswan#873
2022-02-15 16:53:25 +01:00
Tobias Brunner
3f7d40d3b5 Merge branch 'natd-fixes'
This adds some modifications to NAT-D in case the source IP can't be
determined before generating NAT-D notifies.  If this happens when using
IPv4, a local NAT is faked (UDP-encap can be disabled later via MOBIKE
if no NAT is actually detected).  If it happens when using IPv6, NAT-T
is disabled completely.

It also removes the old fallbacks for source NAT-D notifies, which were
generally unused but could lead to incorrect results in the above
scenario.

Closes strongswan/strongswan#861
2022-02-15 16:38:31 +01:00
Tobias Brunner
011de0fe0d ike-natd: Queue DPD after faking local NAT to check if UDP-encap can be disabled 2022-02-15 16:09:26 +01:00
Tobias Brunner
90b1d09e42 ike-mobike: Make task a no-op if MOBIKE is not supported
This allows queuing such a task before IKE_AUTH has been processed.
2022-02-15 16:09:26 +01:00
Tobias Brunner
aaa505dbf0 ike-natd: Fake NAT situation or disable NAT-D if source IP is undetermined
This can happen if an IKE_SA is initiated to a static IP before DHCP is
done.  Instead of failing the initiation, we either fake a NAT situation
(for IPv4) or disable NAT-D (for IPv6 where NATs and UDP-encap are not
widely used or supported).

This also removes the old fallbacks to determine the source address(es).
A source address lookup is done in ike_sa_t::resolve_hosts() (wasn't the
case initially) and enumerating local IPs (which was added even earlier)
could still lead to issues if e.g. LAN addresses are available but the
WAN address that's later used is not yet (in which case only the responder
would detect a NAT and UDP-encap would be configured asymmetrically).

To force UDP-encap locally in case there is no actual NAT, we store this
as COND_NAT_HERE instead of COND_NAT_FAKE.  This ensures DPDs will contain
NAT-D notifies and we can later remove the state via MOBIKE.  We trigger
a MOBIKE update after such a DPD by registering a changed NAT mapping after
checking for a disappearing local NAT, which is very unlikely to happen
outside of a MOBIKE update (where that flag is not checked).
2022-02-15 16:09:26 +01:00
Thomas Egerer
d6879ef984 ha: Streamline handling of conditions and extensions
Automatically takes care of sending/receiving newly added extensions and
conditions.

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2022-02-15 15:27:13 +01:00
Tobias Brunner
801bb8536a error-notify: Handle missing alerts
References strongswan/strongswan#876.
2022-02-15 15:23:37 +01:00
Tobias Brunner
b47e9919f5 testing: Print the actual start time of a command for do-tests -t
Because the command line, together with the results, is printed after
executing it, there could have been weird delays between commands.
2022-02-09 18:58:08 +01:00
Tobias Brunner
7314e09171 appveyor: Install autotools package on 2019 image
On the recently updated 2019 image, autoreconf is not found anymore, as
recent versions of msys2 don't ship autools with base-devel aymore, so
install the autotools package explicitly.
2022-02-07 13:33:44 +01:00
Tobias Brunner
34a6cb858d openssl: Return correct number of plugin features if ECDH groups are omitted
Fixes: 46a6b062822c ("openssl: Only announce ECDH groups actually supported by OpenSSL")
2022-02-04 16:30:51 +01:00
Martin Willi
956b25a4cc proposal: Add ESN transform to default ESP AEAD proposal
The commit mentioned below adds an AES-GCM default proposal for ESP. That
proposal does not include any ESN or non-ESN transform to indicate if
extended sequence numbers are supported.

A standards-compliant peer will include one or more ESN support transforms,
and will be unable to select this proposal due to a proposal mismatch.

Fix the default AES-GCM proposal by adding a NO_ESN algorithm. While ESN has
been supported in the Linux kernel for a while, having it in the default
proposal can be problematic with kernel-libipsec or on other platforms.

Fixes: c7bef954eec6 ("proposal: Add AES-GCM to the ESP default AEAD proposal")
Closes strongswan/strongswan#868
2022-02-01 13:06:42 +01:00
Tobias Brunner
912d0520b9 SECURITY: Fix link to PGP key 2022-01-25 10:54:10 +01:00
Martin Willi
9877ce6c56 sys-logger: Optionally support mapping strongSwan loglevels to syslog levels
strongSwan logs all syslog messages using LOG_INFO for historical reasons,
regardless of the strongSwan loglevel used producing the log message.

In some setups with advanced logging infrastructure, it may be feasible
to be more verbose when logging in strongSwan, but then filter messages
on the syslog server. While this may be possible by custom syslog filtering
rules matching the log level included with the log_level setting, this is
not super convenient.

So add a new map_level setting, which can map strongSwan loglevels to
syslog loglevels. By default this is disabled, keeping the existing
behavior. If enabled, it maps strongSwan loglevels to syslog loglevels
at a given syslog loglevel offset.

Closes strongswan/strongswan#859
2022-01-24 17:33:02 +01:00
Martin Willi
e3d1766aff addrblock: Allow limiting validation depth of issuer addrblock extensions
RFC3779 requires to validate the addrblocks of issuer certificates strictly,
that is, they must contain the extension and the claimed addrblock, up to
the root CA.

When working with third party root CAs that do not have the extension,
this makes using the plugin impossible. So add a depth setting that limits
the number of issuer certificates to check bottom-up towards the root CA.
A depth value of 0 disables any issuer check, the default value of -1
checks all issuers in the chain, keeping the existing behavior.

Closes strongswan/strongswan#860
2022-01-24 17:32:06 +01:00
Tobias Brunner
1bb05006d3 Use Botan 2.19.1 for tests 2022-01-24 17:30:33 +01:00
Andreas Steffen
57d6e96943 Version bump to 5.9.5 5.9.5 2022-01-24 12:01:10 +01:00
Tobias Brunner
4f560557b0 NEWS: Add info about CVE-2021-45079 2022-01-20 17:25:07 +01:00
Tobias Brunner
64cc9acbf0 eap-authenticator: Enforce failure if MSK generation fails
Without this, the authentication succeeded if the server sent an early
EAP-Success message for mutual, key-generating EAP methods like EAP-TLS,
which may be used in EAP-only scenarios but would complete without server
or client authentication.  For clients configured for such EAP-only
scenarios, a rogue server could capture traffic after the tunnel is
established or even access hosts behind the client.  For non-mutual EAP
methods, public key server authentication has been enforced for a while.

A server previously could also crash a client by sending an EAP-Success
immediately without initiating an actual EAP method.

Fixes: 0706c39cda52 ("added support for EAP methods not establishing an MSK")
Fixes: CVE-2021-45079
2022-01-20 17:23:24 +01:00
Tobias Brunner
de15386d94 NEWS: Add news for 5.9.5 2022-01-20 17:22:37 +01:00
Tobias Brunner
627eaa22ff Fixed some typos, courtesy of codespell 2022-01-20 10:44:42 +01:00
Tobias Brunner
21b2b124a1 agent: Log socket path if connecting to it failed 2022-01-20 10:02:54 +01:00
Andreas Steffen
1321fdb8aa Version bump to 5.9.5rc1 5.9.5rc1 2022-01-16 07:48:12 +01:00
Tobias Brunner
6867050d47 message: Add getter/setter for metadata handling 2022-01-14 10:13:21 +01:00
Tobias Brunner
e3d84bc6f6 packet: Add helper function to create a clone without data 2022-01-14 10:13:21 +01:00
Tobias Brunner
93583d23d6 packet: Add getter/setter for metadata handling 2022-01-14 10:13:21 +01:00
Tobias Brunner
269ca19f13 metadata-set: Add implementation for a collection of metadata objects 2022-01-14 10:13:21 +01:00
Tobias Brunner
531335ad20 metadata: Add metadata factory and implementation for integer types
Co-authored-by: Thomas Egerer <thomas.egerer@secunet.com>
2022-01-14 10:13:21 +01:00
Andreas Steffen
85d626e9ae testing: Modified ikev2/net2net-rfc3779 scenario 2022-01-10 21:14:11 +01:00
Tobias Brunner
cd0c9919d9 Use wolfSSL 5.1.1 for tests
Add --tags when fetching commits so we get tags that are not in any
branches, which is currently the case with this tag.
2022-01-04 15:47:16 +01:00
Noel Kuntze
a20daaa336 conf: Fix typo for ha plugin's buffer size option
Fixes: ce048c30ff87 ("ha: Double receive buffer size for HA messages and make it configurable")
Closes strongswan/strongswan#832
2022-01-03 10:20:08 +01:00
Andreas Steffen
36c64589d8 Version bump to 5.9.5dr4 5.9.5dr4 2021-12-31 14:46:31 +01:00
Andreas Steffen
903c68e069 sw-collector: Iterate through history logs
The logrotate function causes the apt history to be split into
several parts at arbitrary points in time. If history.log only
is parsed then some package installation changes stored in
zipped backup history files might get lost.

Thus sw-collector now searches all backup history files until
a date older than the current event stored in the collector.db
database is found, so that no entries get overlooked.
2021-12-31 14:33:22 +01:00
Andreas Steffen
0b76ca13ab libtpmtss: Some minor improvements 2021-12-19 13:50:07 +01:00
Andreas Steffen
dadcd9060e Version bump to 5.9.5dr3 5.9.5dr3 2021-12-11 16:39:34 +01:00
Andreas Steffen
8249e6afad libtpmtss: Establish session with TPM 2.0
Using the trusted RSA or ECC Endorsement Key of the TPM 2.0 a
secure session is established via RSA public key encryption or
an ephemeral ECDH key exchange, respectively.

The session allows HMAC-based authenticated communication with
the TPM 2.0 and the exchanged parameters can be encrypted where
necessary to guarantee confidentiality.
2021-12-11 16:21:59 +01:00
Tobias Brunner
b158c08c4b Merge branch 'openssl-providers'
Optionally load the legacy provider in OpenSSL 3 (enabled, by default) to
make algorithms like MD4 and DES available, which we require for
EAP-MSCHAPv2.  Allow explicitly loading the fips provider via existing
fips_mode option.  The loaded providers, whether influenced by the above
options or not, are logged.

Closes strongswan/strongswan#759
2021-12-08 11:34:46 +01:00
Tobias Brunner
910b7d1915 openssl: Log loaded providers 2021-12-08 11:34:22 +01:00
Tobias Brunner
3cd2e2ccc6 openssl: Make fips_mode option work with OpenSSL 3 2021-12-08 11:34:18 +01:00
Tobias Brunner
f556fce16b openssl: Load "legacy" provider in OpenSSL 3 for algorithms like MD4, DES etc.
We still require these algorithms for e.g. EAP-MSCHAPv2, so the option is
enabled, by default.  To use other providers (e.g. fips or even custom
ones), the option can be disabled and the providers to load/activate can
be configured in openssl.cnf.  For instance, the following has the same
effect as enabling the option:

    openssl_conf = openssl_init

    [openssl_init]
    providers = providers

    [providers]
    default = activate
    legacy = activate

    [activate]
    activate = yes
2021-12-08 11:34:13 +01:00
Tobias Brunner
8baa431501 Merge branch 'libtls-tests'
Improves handling failures during unit tests of libtls and includes a
change for the openssl plugin so it only announces ECDH groups for which
the library provides the required ECC curve.

Closes strongswan/strongswan#752
2021-12-08 11:33:32 +01:00