18914 Commits

Author SHA1 Message Date
Tobias Brunner
2b206eaf6a github: Explicitly install pkg-config in macOS build
Apparently not installed anymore in the latest build image.  If it's
missing, we see errors like these:

  configure.ac:38: error: possibly undefined macro: AC_DEFINE
2023-02-20 14:50:02 +01:00
Tobias Brunner
cbd69ec732 android: Update the README for the build via NDK 2023-02-20 14:11:59 +01:00
Tobias Brunner
af93db93e6 android: New release after OpenSSL plugin fix android-2.4.1-1 2023-02-17 16:59:13 +01:00
Tobias Brunner
48ef9bfbb6 openssl: Fix size of plugin feature array
Fixes: 312847e1a322 ("openssl: Add curve25519 and curve448 after ECDH groups")
2023-02-17 16:58:19 +01:00
Tobias Brunner
27d41a2442 android: New release after fixing interoperability issue with Zyxel firewalls android-2.4.1 2023-02-17 16:42:42 +01:00
Tobias Brunner
312847e1a3 openssl: Add curve25519 and curve448 after ECDH groups
This was the order before 46a6b062822c ("openssl: Only announce ECDH
groups actually supported by OpenSSL") but that's not really the reason
for this change.  It's related to the Android app, where we previously
didn't support these DH groups in BoringSSL and added the curve25519
plugin after the openssl plugin instead.  This resulted in the same
order, i.e. ECDH groups before curve25519.  With the switch to OpenSSL
and the mentioned commit, this changed and curve25519 was now the first
group that was proposed and used for the KE payload.  Not really an
issue you'd think, however, there are apparently Zyxel Firewalls with
older firmware versions (some forum posts mentioned a fix in V5.31) that
can't handle KE payloads with DH groups > 21 (ecp521). So with
curve25519 (31) proposed in the KE payload, they silently dropped the
IKE_SA_INIT request and no connection could be established.
2023-02-17 16:40:59 +01:00
Tobias Brunner
4d3fc90caf libtls: Fix double-free for untrusted peer certificates
`public` is returned, but previously only if a trusted key was found.
We obviously don't want to return untrusted keys and since the reference
was correctly destroyed after determining the key type, this later caused
a double-free.

Fixes: 63fd718915b5 ("libtls: call create_public_enumerator() with key_type")
2023-02-17 15:11:43 +01:00
Tobias Brunner
0de42047a9 enum: Add functions to add and remove mappings from enum names
Co-authored-by: Thomas Egerer <thomas.egerer@secunet.com>
2023-02-17 13:37:38 +01:00
Tobias Brunner
3cf5653640 Merge branch 'hw-packet-offload'
This adds support for the new "packet" hardware offload feature that's
added to the Linux kernel with 6.2.  In this mode, the device handles
the complete framing of the ESP packet as well as the policy checks,
in addition to the crypto.

For the IKE sockets, port-based bypass policies are automatically
offloaded to devices that support it.

Closes strongswan/strongswan#1462
2023-02-17 13:29:56 +01:00
Tobias Brunner
15c6360145 kernel-netlink: Offload bypass policies for IKE ports on interfaces
While this uses the same mechanism, it's not necessary to explicitly
enable port_bypass, the regular socket policies work fine to bypass any
software policies.
2023-02-16 14:45:57 +01:00
Tobias Brunner
77a5c9514c kernel-netlink: Use event socket wrapper for XFRM and networking events 2023-02-16 13:25:35 +01:00
Tobias Brunner
cb0bdb847d kernel-netlink: Add simple wrapper for Netlink event sockets 2023-02-16 13:25:35 +01:00
Tobias Brunner
e323539428 kernel-pfkey: Always register for events
The starter-specific code path isn't necessary anymore since
d8fdd1018e16 ("starter: Don't flush SAs in the kernel").
2023-02-16 13:25:35 +01:00
Tobias Brunner
30cb3bd4d5 kernel-pfroute: Always listen for events
The starter-specific code path isn't necessary anymore since
d8fdd1018e16 ("starter: Don't flush SAs in the kernel").
2023-02-16 13:25:35 +01:00
Tobias Brunner
d7ccb44354 kernel-netlink: Always register for events
The starter-specific code path isn't necessary anymore since
d8fdd1018e16 ("starter: Don't flush SAs in the kernel").
2023-02-16 13:25:35 +01:00
Tobias Brunner
4e91ff7d8c starter: Remove starter-specific plugin lists
It hasn't loaded any plugins since d8fdd1018e16 ("starter: Don't flush
SAs in the kernel"), which was released with 5.3.3.
2023-02-16 13:25:34 +01:00
Tobias Brunner
68ccb1930c kernel-netlink: Fallback to configured interface when HW offloading policies
This allows offloading bypass and drop policies to a specific interface
by configuring `interface` and `hw_offload=packet` (`auto` works too).
2023-02-16 13:25:34 +01:00
Tobias Brunner
763014c028 shunt-manager: Pass HW offload mode when installing policies 2023-02-16 13:25:34 +01:00
Tobias Brunner
2b8f26308f vici: Update offloading configuration for full packet HW offloading 2023-02-16 13:25:34 +01:00
Tobias Brunner
55719d7de5 kernel-netlink: Add support for full packet and policy HW offloading 2023-02-16 13:25:34 +01:00
Tobias Brunner
46cfebe4ab child-sa: Pass HW offload mode for policies 2023-02-16 13:25:34 +01:00
Tobias Brunner
af1eeda08b kernel-ipsec: Add HW offload mode to policies 2023-02-16 13:25:34 +01:00
Tobias Brunner
056f3e7742 Merge branch 'android-updates'
Switched from BoringSSL to OpenSSL. A script is provided to build the
library as needed.
android-2.4.0
2023-02-15 14:50:12 +01:00
Tobias Brunner
5390da1412 android: New release after switching to OpenSSL 2023-02-13 15:46:53 +01:00
Tobias Brunner
65aff933f1 android: Use correct language code for Ukrainian
While UA is the country code, the language code is apparently uk.
2023-02-13 15:46:53 +01:00
Tobias Brunner
937f726154 android: Clean up plugin list after switching to OpenSSL
Keep the kdf plugin because of AES-XCBC (and CAMELLIA-XCBC, which is now
supported due to OpenSSL).  Other plugins like fips-prf, pubkey or pkcs8
were never actually used by the app.  The random plugin might have been
necessary with early versions.
2023-02-13 15:30:58 +01:00
Tobias Brunner
eac27ce677 android: Use custom-built OpenSSL for GH action 2023-02-13 15:30:58 +01:00
Tobias Brunner
f959157d31 android: Increase minSdkVersion to 21 (Android 5.0)
Newer NDKs haven't supported the version(s) we used for a while. Also,
versions < 21 will be removed with the next version of the NDK.
2023-02-13 15:30:58 +01:00
Tobias Brunner
7e5c4bbb32 android: Add a script to build OpenSSL's libcrypto as needed by the app
The build script requires the paths to the NDK and OpenSSL sources.

It runs the build in a Docker container, by default. But if the required
tools are installed on the system (currently jq, make and perl) it can
also be run directly on the system by defining NO_DOCKER.

A relatively recent version of the NDK is required (the pre-built
toolchains are required).
2023-02-13 15:30:58 +01:00
Tobias Brunner
2fc8b14918 android: Add the application ID to the log 2023-02-10 11:27:44 +01:00
Tobias Brunner
12c925a7e7 android: Update screenshots and add more with advanced settings 2023-02-09 18:04:07 +01:00
Tobias Brunner
7361078d3d android: Update Gradle plugin 2023-02-09 18:04:07 +01:00
Tobias Brunner
77bd5ab1a8 github: Use OpenSSL 3.0.8 for tests 2023-02-07 18:06:16 +01:00
Tobias Brunner
1a8106ee0d github: Use tpm2-tss 3.2.2 for tests 2023-01-31 17:22:44 +01:00
Andreas Steffen
bf3e4c85d0 Revert "libipsec: Added Windows tun device support"
This reverts commit 77b91e6d0eaffb3c69b47221c3de3bb8ff80e01a.
2023-01-31 15:19:58 +01:00
Andreas Steffen
77b91e6d0e libipsec: Added Windows tun device support 2023-01-31 14:59:57 +01:00
xujielong
ba5b5f03b6 child-sa: Fix typo in comment
Closes strongswan/strongswan#1527
2023-01-30 11:29:02 +01:00
Tobias Brunner
805cc3a69f curl: Add an option to select the SSL/TLS backend (if available)
If libcurl is built with MultiSSL support (not the case for e.g.
Debian/Ubuntu, which ship separate, conflicting libraries), this allows
selecting the SSL/TLS backend libcurl uses.
2023-01-23 11:17:33 +01:00
Tobias Brunner
d11868fb38 curl: Don't ignore unknown SSL/TLS backends
Only older versions of OpenSSL and GnuTLS need special treatment, so we
now accept all other backends (e.g. "(SecureTransport) OpenSSL/1.1.1s"
on macOS).

Whenever we remove support for the affected versions of the mentioned
libraries, we can remove the corresponding *-threading plugin feature
and the code here.
2023-01-23 11:17:33 +01:00
Tobias Brunner
e99de2aee9 Merge branch 'man-sysconfdir'
Closes strongswan/strongswan#1511
2023-01-16 11:41:17 +01:00
Tobias Brunner
29e3247097 swanctl: Don't use hard-coded path to sysconfdir 2023-01-16 11:39:29 +01:00
Tobias Brunner
1c0b14baa3 conf: Add swanctl.conf and swanctl man pages to SEE ALSO 2023-01-16 11:37:27 +01:00
Tobias Brunner
7e43a5f3d2 conf: Replace hard-coded /etc where appropriate
Also document the actual value of ${sysconfdir}.
2023-01-16 11:36:58 +01:00
Petr Menšík
ee046552bb man: Use configured path for config files in man pages 2023-01-16 11:21:15 +01:00
Petr Menšík
ab4ed21b5c ipsec: Include IPSEC_CONFDIR variable replacement in man page
Fedora has chosena different default directory to avoid conflicts with
libreswan. Use ${sysconfdir} variable to provide the correct location.
2023-01-16 11:20:44 +01:00
Andreas Steffen
8effb06d6c pki: Use X.509v3 EKU extension in CSR 2023-01-11 19:19:09 +01:00
Tobias Brunner
41b0dff92b kernel-netlink: Define SOL_NETLINK for old versions of socket.h
While the kernel defines it since 2005 (2.6.14), some older versions of
socket.h shipped with C libraries might not.  In particular, glibc only
added it with 2.24 in 2016.

Closes strongswan/strongswan#1503
2023-01-10 16:34:07 +01:00
Tobias Brunner
7dbe702269 github: Workaround for Python conflict in macOS image
The Python versions installed in the system image in
`/Library/Frameworks/Python.framework/` have symlinks in `/usr/local/bin/`
that conflict with symlinks that `brew` tries to create, which causes
errors like these:

    ==> Pouring python@3.11--3.11.1.monterey.bottle.tar.gz
    Error: The `brew link` step did not complete successfully
    The formula built, but is not symlinked into /usr/local
    Could not symlink bin/2to3-3.11
    Target /usr/local/bin/2to3-3.11
    already exists. You may want to remove it:
      rm '/usr/local/bin/2to3-3.11'

    To force the link and overwrite all conflicting files:
      brew link --overwrite python@3.11

    To list all files that would be deleted:
      brew link --overwrite --dry-run python@3.11

    Possible conflicting files are:
    /usr/local/bin/2to3-3.11 -> /Library/Frameworks/Python.framework/Versions/3.11/bin/2to3-3.11
    /usr/local/bin/idle3.11 -> /Library/Frameworks/Python.framework/Versions/3.11/bin/idle3.11
    /usr/local/bin/pydoc3.11 -> /Library/Frameworks/Python.framework/Versions/3.11/bin/pydoc3.11
    /usr/local/bin/python3.11 -> /Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11
    /usr/local/bin/python3.11-config -> /Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11-config
2023-01-06 15:31:03 +01:00
Tobias Brunner
632834af91 dh-speed: Add wolfssl and BP ECDH to test script 2023-01-06 15:31:03 +01:00
Tobias Brunner
e396dbeca5 dh-speed: Dynamically look up KE method 2023-01-06 15:31:00 +01:00