Tobias Brunner [Thu, 13 Feb 2020 09:48:49 +0000 (10:48 +0100)]
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.
Tobias Brunner [Wed, 19 Feb 2020 16:38:57 +0000 (17:38 +0100)]
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.
Tobias Brunner [Thu, 13 Feb 2020 16:53:17 +0000 (17:53 +0100)]
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.
Tobias Brunner [Fri, 14 Feb 2020 13:47:34 +0000 (14:47 +0100)]
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.
Tobias Brunner [Fri, 14 Feb 2020 12:58:50 +0000 (13:58 +0100)]
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.
Tobias Brunner [Fri, 14 Feb 2020 12:51:44 +0000 (13:51 +0100)]
Merge branch 'nm-eap-tls'
Adds support for EAP-TLS to the NM plugin. The certificates/key
source (file, smartcard, agent) can now be selected independently of
the authentication method (i.e. for both certificate and EAP-TLS auth).
Tobias Brunner [Wed, 5 Feb 2020 15:00:10 +0000 (16:00 +0100)]
charon-nm: Add support for EAP-TLS
The code is structured similar to that in the Android client, but two-round
authentication (cert+EAP) is not supported as that might require multiple
secrets ("password" is currently the only secret field used for every
method) and other details are currently missing too (like configurable
client identities).
Tobias Brunner [Fri, 14 Feb 2020 12:29:10 +0000 (13:29 +0100)]
Merge branch 'nm-remote-id'
This adds an optional field to the NM plugin to configure the server
identity, so it can differ from the address or certificate subject,
which are used by default.
Was fixed by making tox depend on newer versions of six so the package
gets installed/updated automatically now when installing tox. There is
also some ongoing work that tries to make virtualenv work with older
versions of six.
Tobias Brunner [Wed, 12 Feb 2020 16:49:14 +0000 (17:49 +0100)]
cirrus: Remove bashisms from test script to make it compatible with /bin/sh
Bash is not installed on the FreeBSD images here and the location would
be different anyway (`/usr/local/bin/bash`, so we'd have to change the
hashbang to e.g. `/usr/bin/env bash`).
Tobias Brunner [Thu, 12 Dec 2019 16:29:08 +0000 (17:29 +0100)]
soup: Use soup_session_new() to avoid deprecation warning
There are a ton of libsoup/GLib-related "leaks" that we can't whitelist
and with leak detective active there is a delay that interestingly doesn't
happen with soup_session_sync_new(), so tests failed with a timeout (actually
they hung due to the lock in the fetcher manager).
On Travis, the curl plugin is used for the tests, so that's not an issue
there (and without LD the tests complete quickly and successfully).
Tobias Brunner [Wed, 29 Jan 2020 10:12:12 +0000 (11:12 +0100)]
x509: Replace problematic calls of chunk_from_chars() for keyUsage extension
As noted in 8ea13bbc5ccd newer compilers might optimize out the
assignment leading to invalid values in the keyUsage extension (as the
length was still set, the extension was encoded, just not with the
intended values).
Tobias Brunner [Thu, 30 Jan 2020 10:09:04 +0000 (11:09 +0100)]
lgtm: Build external dependencies for a more complete analysis
The build system is a bit limited, only the repository directory and
LGTM_WORKSPACE is writable. sudo doesn't work at all, for others we
don't have enough permission.
Tobias Brunner [Tue, 28 Jan 2020 10:06:59 +0000 (11:06 +0100)]
array: Avoid overflow in size calculation
While it's unlikely that so many (large) items are allocated, this is
technically more correct. The result previously could overflow an
unsigned int (the conversion to size_t happened afterwards).
Tobias Brunner [Tue, 28 Jan 2020 09:33:55 +0000 (10:33 +0100)]
swanctl: Add missing `extern` for `swanctl_dir` variable in header
This clearly never was correct, but didn't cause problems so far.
However, GCC 10 will default to `-fno-common` instead of
`-fcommon` (https://gcc.gnu.org/PR85678), so compilation there fails
with something like:
```
libtool: link: gcc ... -o .libs/swanctl ...
ld: commands/load_authorities.o:strongswan/src/swanctl/./swanctl.h:33:
multiple definition of `swanctl_dir'; commands/load_all.o:strongswan/src/swanctl/./swanctl.h:33: first defined here
```
Fixes: 501bd53a6cce ("swanctl: Make credential directories relative to swanctl.conf")
Closes strongswan/strongswan#163.
Tobias Brunner [Mon, 27 Jan 2020 14:16:51 +0000 (15:16 +0100)]
lgtm: Add query to detect problematic uses of chunk_from_chars()
GCC 9+ and clang 4+ (partially) optimize out usages of
chunk_from_chars() if the value is read outside of the block where the
macro is used. For instance:
```
chunk_t chunk = chunk_empty;
if (...)
{
chunk = chunk_from_chars(0x01, 0x06);
}
/* do something with chunk */
```
The chunk_from_chars() macro expands to a chunk_t declaration, which is
technically only defined inside that block.
Still, with older GCC versions the fourth line was compiled to something
like this:
```
mov WORD PTR [rsp+14], 1537 # 0x0106 in little-endian
lea rdx, [rsp+14]
mov ecx, 2
```
However, with GCC 9.1 and -O2 the first instruction might be omitted
(strangely the others usually were not, so the chunk pointed to whatever
was stored on the stack). It's not easily reproducible, so there are
situations where the seemingly identical code is not optimized in this
way.
This query should detect such problematic uses of the macro (definition
and usage in different blocks).
Tobias Brunner [Wed, 15 Jan 2020 13:57:56 +0000 (14:57 +0100)]
travis: Build on ARM64, IBM Power and IBM Z architectures
IBM Z is big-endian, IBM Power runs in little-endian mode.
Botan requires a fix for issues with GCC and amalgamation enabled (target
pragma ‘*’ is invalid) on ARM64 and IBM Power, while wolfSSL can't be
compiled successfully on IBM Z without an additional patch.
libunwind is not available for x390x, but since we explicitly disable
such backtraces it's not necessary anyway.
Tobias Brunner [Tue, 14 Jan 2020 13:58:01 +0000 (14:58 +0100)]
vici: Move Python test dir and include it in sdist
This is the recommended location and import config as it allows running the
tests against installed versions of the package. And while the test file
itself is automatically included in the source distribution this way, the
__init__.py file is not, so we still have to update MANIFEST.in.
Tobias Brunner [Thu, 19 Dec 2019 10:41:59 +0000 (11:41 +0100)]
Revert "travis: Add a workaround for a bug regarding libtool installed via Homebrew"
This reverts commit 1806ba0890bc503df3dacf01992ec1bca2b0fbb0 as the
workaround is not required anymore and now actually fails because
pre-installed tools have a dependency on libtool.