18525 Commits

Author SHA1 Message Date
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
Tobias Brunner
a59a6d4783 dh-speed: Don't reuse DH object
Since the changes to the DH implementations that were merged with
30faf04e92dc ("Merge branch 'multi-ke-backport'"), most implementations
don't support deriving different shared secrets for the same private key
by calling set_public_key() with another public key anymore (some prevent
it explicitly, but reusing DH private keys is not something we want to
support anyway).  So we can't reuse the DH object on one side for every
round.
2023-01-06 12:13:12 +01:00
Andreas Steffen
0c7bfec7af Version bump to 5.9.9 5.9.9 2023-01-01 11:55:50 +01:00
Andreas Steffen
7928deece1 Version bump to 5.9.9rc2 5.9.9rc2 2022-12-23 11:19:06 +01:00
Tobias Brunner
a6312f2ae9 testing: Abort kernel build if patch can't be applied 2022-12-23 10:31:14 +01:00
Tobias Brunner
613cd016ee NEWS: Add news for 5.9.9 2022-12-22 19:59:51 +01:00
Tobias Brunner
ac190ce6c9 kernel-netlink: Explicitly ignore the result of setsockopt() 2022-12-22 19:03:37 +01:00
Tobias Brunner
cf6f56f619 Fixed some typos, courtesy of codespell 2022-12-22 19:03:37 +01:00
Andreas Steffen
4aa5868d8e Version bump to 5.9.9rc1 5.9.9rc1 2022-12-22 13:24:34 +01:00
Thomas Egerer
5e9f5fb32e Make format string a string literal in some debug statements
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2022-12-21 17:33:37 +01:00
Tobias Brunner
cb6516cc0a Use wolfSSL 5.5.4 for tests 2022-12-21 16:41:36 +01:00
Tobias Brunner
7988aea7d8 kernel-netlink: Log extended ACK error/warning messages
With newer kernels (basic support for extended ACKs is there since 4.12
but some messages for XFRM were only added with 6.1) this gives more
detailed error messages to the user than e.g. a generic EINVAL or ENOSYS
error would.

Also enabled omitting the request payload in NLMSG_ERROR messages.
2022-12-21 16:21:49 +01:00
Tobias Brunner
17fd304e60 resolve: Don't install individual servers via resolvconf
The resolvconf implementation provided by systemd via resolvectl strips
everything after the interface name, so each additional server that's
installed replaces the previous one.  And even for other resolvconf
implementations installing them individually doesn't seem necessary as
we track and refcount them anyway.

Closes strongswan/strongswan#1353
2022-12-19 16:14:25 +01:00
Tobias Brunner
bd6014a97b resolve: Avoid dots in protocol part of interface names when using resolvconf
Newer releases of systemd contain a change that removes not the part
after the first dot but the part after the last when determining the
interface name (apparently some interface names actually contain a dot).

This changes the default prefix to only contain one dot and avoids the
dots added by IPv4 addresses to create a unique interface/protocol for
each DNS server (it also replaces the `:` in IPv6 addresses with
something that might cause less conflicts).

References strongswan/strongswan#1353
2022-12-19 16:14:01 +01:00
Tobias Brunner
dee1916e4c resolve: Make path to resolvconf(8) configurable
Prefer the configured command over finding it at the default location
over installing in the configured file.

References strongswan/strongswan#744
2022-12-19 16:12:46 +01:00
Tobias Brunner
2c7f6cd93f github: Adapt TKM build to changed plugin list 2022-12-14 16:35:03 +01:00
Tobias Brunner
b1ce877236 charon-tkm: Use built-in plugins instead of OpenSSL
Since the encryption has been moved into the TKM we don't rely on many
cryptographic operations.  Mainly SHA-1 that's used in IKEv2 (NAT-D) and
for some internal hashes (cookies, message duplicate detection), and
certificate and public key parsing (not the actual signature/chain
verification, which is done by the TKM).
2022-12-14 16:25:19 +01:00
Tobias Brunner
98be74914d sha1: Clarify license of the implementation 2022-12-14 13:38:38 +01:00
Tobias Brunner
2192bfb9ec github: Use tpm2-tss 3.2.1 for tests 2022-12-13 16:32:02 +01:00
Tobias Brunner
da0d0ecc45 vici: Add Python 3.10 and 3.11 2022-12-12 16:57:01 +01:00
Tobias Brunner
03541c73a0 github: Fix Python build with custom OpenSSL version 2022-12-12 16:57:01 +01:00
Tobias Brunner
3dd5dc5011 Merge branch 'vici-python-timeout'
Closes strongswan/strongswan#1416
2022-12-12 14:38:46 +01:00
Martin Willi
484c0f8dd0 vici: Gracefully consume/ignore incoming events in Python event deregistration
When issuing a deregistration message, some last events may still be sent
by the daemon before deregistration completes. Ignore such event messages
silently during deregistration, avoiding exceptions like:

  vici.exception.SessionException:
    Unexpected response type 7, expected '5' (EVENT_CONFIRM)
2022-12-12 14:38:09 +01:00
Martin Willi
254d4075fe vici: Add some initial session level unit-tests 2022-12-12 14:38:09 +01:00
Martin Willi
aa0da01fde vici: Add simple Python transport layer tests, including timeout 2022-12-12 14:38:09 +01:00
Martin Willi
248a188d21 vici: Allow the Python event listen() operation to optionally time out
The architecture of the Python client is completely blocking, which is fine
for many simple scripts. For more complex applications that do other I/O
and listen for vici events, the most feasible way to integrate the client is
to use a dedicated thread.

Unfortunately, Python has no simple support for thread cancellation. And
having that thread in a blocking recv() does not allow to terminate the
thread gracefully with an Event or the like.

As a way out, add a timeout to the listen() call, so the thread can
periodically do other things, like checking for termination Event and
react on it. Returning from listen() on timeout can be suboptimal, though,
as it involves registration/deregistration for events, including the risk
for missing events while not registered. So return a (None, None) tuple
instead on timeout, allowing the caller to periodically do other things
while staying registered for the events and continue in listen().

The timeout applies to the socket recv() for the start of the header, only,
so a message is either read in full or times out, avoiding the risk
of breaking message framing on the stream with partial reads.
2022-12-12 14:38:09 +01:00
Martin Willi
11b18f65b1 vici: Remove support for Python 2
Python 2 is dead and unmaintained for a while now. Time to stop carrying
on its support.
2022-12-12 14:38:09 +01:00
Tobias Brunner
a2b1e06f07 vici: Base default soft lifetime on hard lifetime if configured
Depending on the configured hard lifetime the default soft lifetime
might not make sense and could even cause rekeying to get disabled.
To avoid that, derive the soft lifetime from the hard lifetime so it's
10% higher than the soft lifetime.

References strongswan/strongswan#1414
2022-12-12 14:24:50 +01:00
Dmitriy Alexandrov
b450865615 child-cfg: Fix apply_jitter() in case jitter is bigger than rekey value
Also avoid returning 0 and disabling rekeying in the rare case of
`jitter = rekey` and the `1/jitter` chance of that happening (returning
1 at least doesn't disable rekeying).

Co-authored-by: Tobias Brunner <tobias@strongswan.org>

Closes strongswan/strongswan#1414
2022-12-12 14:24:32 +01:00
Tobias Brunner
44378d2521 github: CodeQL currently doesn't support ccache
Just disable it but keep everything in place for now.
2022-12-06 09:41:42 +01:00
Andreas Steffen
8329455628 testing: Check canonical OCSP/CRL serial numbers 2022-12-05 20:18:24 +01:00
Andreas Steffen
0d88c76abc unit-tests: Check encoding/retrieval of serial numbers 2022-12-05 20:18:24 +01:00
Andreas Steffen
18082ce2b0 certificates: Retrieve serial numbers in canonical form
The x509 plugin retrieves serial numbers with two's complement
encoding whereas the openssl plugin partially returns them without
leading zeroes.

Serial numbers in X.509 certificates, X.509 CRL, X.509 attribute
certificates, OCSP Requests and OCSP responses are now returned in
canonical form without prepended zero octets.
2022-12-05 20:18:24 +01:00
Tobias Brunner
cb5ae75ac1 github: Remove obsolete LGTM workflow
lgtm.com will be shutdown soon.
2022-12-05 16:49:07 +01:00
Tobias Brunner
0d3fcd100d github: Add CodeQL workflow 2022-12-05 16:49:07 +01:00
Tobias Brunner
b1482f5204 github: Fix path to Android lint report
Has a -debug suffix now.
2022-12-02 16:09:41 +01:00
Tobias Brunner
ef525ff980 github: Update GitHub-provided actions so they don't use deprecated Node.js 12 2022-12-02 16:09:41 +01:00
Tobias Brunner
0fea6a7f8e github: Adapt to switch to Ubuntu 22.04 for ubuntu-latest
Ubuntu 22.04 ships OpenSSL 3, which requires debug symbols so we can
whitelist leaks because we don't deinitialize the library.  And because
the shipped library is not built with `-fno-omit-frame-pointer`, the
build with AddressSanitizer can't use its fast stack unwind method.
However, the previous workaround for DTLS handling with glibc apparently
isn't necessary anymore.

In the custom OpenSSL build we drop no-stdio as that lets the configure
check for libldns fail because ERR_print_errors_fp@OPENSSL_3.0.0 is not
found.

For ccache, the default path to the cache directory has changed.

Also simplified the NM tests as there is only one build since
085daf474330 ("nm: Remove old libnm-glib compat stuff").
2022-12-02 16:09:04 +01:00
Tobias Brunner
7991871bd6 github: Set timeout for tests on macOS
They sometimes hang (without our internal timeout catching them).
So instead of waiting for hours, let them get aborted earlier.
2022-12-02 14:58:23 +01:00
Tobias Brunner
74e319c3f5 fuzz: Force make check to fail if fuzz target fails 2022-12-02 14:58:23 +01:00