Commit Graph

17136 Commits

Author SHA1 Message Date
Tobias Brunner a8f91cd466 ha: Improve distribution of pool addresses over segments
This is particularly important for higher number of segments, but even
with small numbers there is a significant difference.  For instance,
with 4 segments the fourth segment had no IPs assigned with the old
code, no matter how large the pool, because none of the eight bits used
for the segment check hashed/mapped to it.
2018-12-07 10:12:14 +01:00
Tobias Brunner 872b9b3e8d kernel-pfkey: Read reqid directly from acquire if possible
Upcoming versions of FreeBSD will include an SADB_X_EXT_SA2 extension in
acquires that contains the reqid set on the matching policy.  This allows
handling acquires even when no policies are installed (e.g. to work with
FreeBSD's implementation of VTI interfaces, which manage policies
themselves).
2018-12-03 12:01:43 +01:00
Tobias Brunner c99d3b6f63 ikev2: Only set STAT_INBOUND for valid and expected messages 2018-12-03 12:00:24 +01:00
Tobias Brunner 631abb6810 scepclient: Don't use a block-scope buffer for the default DN
The correct behavior will depend on the compiler.

Fixes #2843.
2018-12-03 11:54:05 +01:00
Tobias Brunner 686a1b971d Merge branch 'openssl-25519/448'
Adds support for X25519/448 and Ed25519/448 via OpenSSL 1.1.1.
2018-11-30 16:48:02 +01:00
Tobias Brunner a4e698b6f9 travis: Don't run sonarcloud in forked repositories 2018-11-30 16:03:10 +01:00
Tobias Brunner 2a58030b78 travis: Use the latest OpenSSL release for unit tests
But also run the unit tests against the 1.0 version installed with
Ubuntu 16.04.
2018-11-30 16:03:10 +01:00
Tobias Brunner 7195914daf travis: Only use GCC for crypto plugin tests
They are already build-tested with Clang via "all" and others.
2018-11-30 15:57:35 +01:00
Tobias Brunner 25e62f01ea unit-tests: Add test suite for Ed448
Same issue with signature malleability as with Ed25519 and apparently
OpenSSL doesn't even explicitly verify that the most significant 10 bits
are all zero.
2018-11-30 15:57:35 +01:00
Tobias Brunner 8d7bf5b039 unit-tests: Add fingerprint test vectors for Ed25519 2018-11-30 15:47:21 +01:00
Tobias Brunner 2571898d32 curve25519: Prevent Ed25519 signature malleability
As per RFC 8032, section 5.1.7 (and section 8.4) we have to make sure s, which
is the scalar in the second half of the signature value, is smaller than L.
Without that check, L can be added to most signatures at least once to create
another valid signature for the same public key and message.

This could be problematic if, for instance, a blacklist is based on hashes
of certificates.  A new certificate could be created with a different
signature (without knowing the signature key) by simply adding L to s.

Currently, both OpenSSL 1.1.1 and Botan 2.8.0 are vulnerable to this, which is
why the unit test currently only warns about it.
2018-11-30 15:35:01 +01:00
Tobias Brunner 69756c0bff openssl: Use separate DRBG for RNG_STRONG and RNG_TRUE with OpenSSL 1.1.1
OpenSSL 1.1.1 introduces DRGBs and provides two sources (same security
profile etc. but separate internal state), which allows us to use one for
RNG_WEAK (e.g. for nonces that are directly publicly visible) and the other
for stronger random data like keys.
2018-11-30 15:35:01 +01:00
Tobias Brunner 6fc90cea74 leak-detective: Whitelist functions added in OpenSSL 1.1.1 2018-11-30 15:35:01 +01:00
Tobias Brunner cbf07ab5b0 openssl: Add support for Ed25519/Ed448 2018-11-30 15:35:01 +01:00
Tobias Brunner d222699c78 dh-speed: Add curve448 keyword 2018-11-30 14:54:33 +01:00
Tobias Brunner 9dfbe9442b test-vectors: Add vector for X448 2018-11-30 14:54:33 +01:00
Tobias Brunner 57cb4c8d2c openssl: Add support for X25519 and X448
While X25519 was already added with 1.1.0a, its use would be a lot more
complicated, as the helpers like EVP_PKEY_new_raw_public_key() were only
added in 1.1.1, which also added X448.
2018-11-30 14:53:38 +01:00
Tobias Brunner 2421b7ddb8 bypass-lan: Compare interface for unchanged policies
In case a subnet is moved from one interface to another the policies can
remain as is but the route has to change.  This currently doesn't happen
automatically and there is no option to update the policy or route so
removing and reinstalling the policies is the only option.

Fixes #2820.
2018-11-22 11:38:55 +01:00
Tobias Brunner ecba84a06b child-delete: Don't send delete for expired CHILD_SAs that were already rekeyed
The peer might not have seen the CREATE_CHILD_SA response yet, receiving a
DELETE for the SA could then trigger it to abort the rekeying, causing
the deletion of the newly established SA (it can't know whether the
DELETE was sent due to an expire or because the user manually deleted
it).  We just treat this SA as if we received a DELETE for it.  This is
not an ideal situation anyway, as it causes some traffic to get dropped,
so it should usually be avoided by setting appropriate soft and hard limits.

References #2815.
2018-11-22 11:31:53 +01:00
Tobias Brunner a9b9450c54 kernel-netlink: Update SA selector if it contains changed IP address(es) 2018-11-22 11:22:58 +01:00
Tobias Brunner 97c4551ec8 Avoid inclusion of unistd.h in generated lexers
Because the file is not available on all platforms the inclusion comes
after the user options in order to disable including it.  But that means
the inclusion also follows after the defined scanner states, which are
generated as simple #defines to numbers.  If the included unistd.h e.g.
uses variables in function definitions with the same names this could
result in compilation errors.

Interactive mode has to be disabled too as it relies on isatty() from
unistd.h.  Since we don't use the scanners interactively, this is not a
problem and might even make the scanners a bit faster.

Fixes #2806.
2018-11-22 11:17:35 +01:00
Tobias Brunner 85431bf2e7 Merge branch 'travis-xenial'
Run builds on Travis on Ubuntu Xenial (16.04) images.
2018-11-21 14:40:00 +01:00
Tobias Brunner 8a4f110243 travis: Use ccache for MinGW builds 2018-11-21 14:37:56 +01:00
Tobias Brunner b76a1cf284 travis: Use manual matrix expansion to improve overall run time
The sonarcloud build runs a long time now (the win32/64 builds are also
a lot slower on xenial), which increases the overall time a build takes
because we can't run these before regular matrix jobs run.  So we do a
manual matrix expansion to control the order of jobs (slower first).
This also removes the TEST=default build with GCC as that's basically
what TEST=dist does (except for forcing the printf implementation)
2018-11-21 14:37:56 +01:00
Tobias Brunner fb4103051e travis: Simplify explicitly included jobs
The first value for the compiler array (gcc) is inherited.
2018-11-21 14:37:56 +01:00
Tobias Brunner ff97733163 travis: Start with sonarcloud job first
Also change the condition, the environment variable is apparently still
around when the decision to run it is made.
2018-11-21 14:37:56 +01:00
Tobias Brunner 187ab29849 travis: Use two threads to analyze C code with SonarQube
On Nov 12, the scanner was updated and now takes a lot more time (about
3 times as much).  Using two threads reduces it a bit (by about 25%).
Using even more threads doesn't help or even increases the time again.
2018-11-21 14:37:56 +01:00
Tobias Brunner d8d756e306 Fix make distcheck if systemd is installed
The automatically determined path for systemd units is an absolute system
path that doesn't respect $(prefix).  That's a problem for make distcheck,
which is usually ran as regular user and it's not expected to have any
impact on the system (it does a local install in a subdir).  To avoid
these issues we override the configure flags used by make distcheck and
set the path to one relative to the specified prefix.
2018-11-21 14:36:38 +01:00
Tobias Brunner cab4b3a341 Doxyfile: Remove obsolete XML options 2018-11-21 14:36:38 +01:00
Tobias Brunner fa4599d160 gcrypt: Don't use thread callbacks for newer versions of libgcrypt
According to gcrypt.h these callbacks are not used anymore since
version 1.6 and with clang these actually cause deprecation warnings
that let the build on travis (-Werror) fail.
2018-11-21 14:36:38 +01:00
Tobias Brunner 248f34918f travis: Don't build TSS2 as root
This might prevent ccache from overwriting files in later builds.
2018-11-21 14:36:38 +01:00
Tobias Brunner 75853dbe4b travis: Add sleep in after_failure
This makes sure we get the complete output, which isn't always the case
otherwise (there is an unresolved bug for this in the Travis issue tracker).
2018-11-21 14:36:38 +01:00
Tobias Brunner cfdab423fb travis: Build on Ubuntu Xenial (16.04) 2018-11-21 14:36:38 +01:00
Tobias Brunner 9820e3dd59 Merge branch 'testing-stretch'
Use Debian stretch as base image for the testing environment.
2018-11-21 14:34:57 +01:00
Tobias Brunner 48afa6b783 testing: Switch to Debian stretch base images 2018-11-21 14:34:16 +01:00
Tobias Brunner 7511a6fd9c testing: Install a package via apt-get to get a second SWIMA software event
This installs tmux and its two dependencies libevent-2.0-5 and libutempter0.
For the tnc/tnccs-20-ev-pt-tls test scenario older, apparently replaced
versions of these packages are entered to the collector.db database, so that
dummy SWID tags for these packages can be requested via SWIMA.
2018-11-21 14:33:29 +01:00
Tobias Brunner b217bdf75f testing: Add additional memory to alice
strongTNC seems to require a lot more memory than we assign by default,
not sure this increase is enough.
2018-11-21 14:32:25 +01:00
Tobias Brunner b3d9ada385 testing: Generate some UTF-8 locales 2018-11-21 14:32:25 +01:00
Tobias Brunner 1741d1ac07 testing: Disable systemd's NTP service
This produces a lot of useless traffic as no NTP servers are reachable (or
even resolvable via winnetou).
2018-11-21 14:32:25 +01:00
Tobias Brunner c7a74fd3e5 testing: Allow enabling only timestamps without verbose command output
-t enables only the timestamps, -v additionally logs command output
(includes -t).
2018-11-21 14:32:25 +01:00
Tobias Brunner 2132031d0e testing: Show config files of FreeRADIUS 3.0 in test results 2018-11-21 14:32:25 +01:00
Tobias Brunner 231828f810 testing: Config changes for FreeRADIUS 3.0
Also includes some changes for jessie's version of FreeRADIUS 2 (was
previously a custom version).

Besides the move to a subdir the config files were adapted for 3.0.

The rlm_sim_files module was removed with FreeRADIUS 3 and Debian's
package of FreeRADIUS 2 does not ship it, so we now replicate it using
the files module (via users file, which is actually a symlink to
mods-config/files/authorize in the default installation of FreeRADIUS 3).
Another approach was tried using rlm_passwd, however, that module does
not read binary/hex data, only printable strings, which would require
changing the triplets.
For 2.x a hack in the site config is necessary to make the attributes
available to the EAP-SIM module.
2018-11-21 14:32:25 +01:00
Tobias Brunner a8112cc174 testing: Use freeradius instead of the removed radiusd to start FreeRADIUS 2018-11-21 14:32:25 +01:00
Tobias Brunner 2e39b1db0a testing: Remove unused/inexistent DSA key from sshd config 2018-11-21 14:32:25 +01:00
Tobias Brunner 30e68c80d2 testing: Only run DHCPv4 by setting an listening interface explicitly
Debian stretch's init script for isc-dhcp-server uses the INTERFACESv4|6
variables to decide whether to start the v4 and/or v6 DHCP server.

If they are not empty, the daemon is started for the respective version,
however, if both are empty (the default), to listen on all interfaces, the
daemon is started for both versions.  The latter would require a subnet
config for IPv6 as the daemon otherwise exits, letting the init script fail,
while keeping the successfully started v4 version running, which, in turn,
can't be stopped anymore with the init script because it thinks the daemon
is not running.

So it's not possible with this init script to start DHCPv4 on all interfaces
without having to configure and run DHCPv6 also.
2018-11-21 14:32:25 +01:00
Tobias Brunner c2742f9bf5 testing: Remove unused dhcpd config on moon 2018-11-21 14:32:25 +01:00
Tobias Brunner 9083ccd05c testing: Accept ping6 output with IP address after hostname
Newer versions of ping6 add the IP address after the FQDN in the output.
2018-11-21 14:32:25 +01:00
Tobias Brunner f9a42f828a testing: Install traceroute utility in base image
It seems this was previously installed automatically.
2018-11-21 14:32:24 +01:00
Tobias Brunner 99f6457e53 testing: Only attempt to copy patches if there are any 2018-11-21 14:32:24 +01:00
Tobias Brunner 2fbe44bef3 testing: Remove TNC@FHH dependencies and scenarios that rely on them
While we could continue to use FreeRADIUS 2.x that branch is officially EOL.
So instead of investing time and effort in updating/migrating the patches to
FreeRADIUS 3.x (the module changed quite significantly as it relies solely on
the naeap library in that release), for a protocol that is superseded anyway,
we just remove these scenarios and the dependencies.  Actually, the
complete rlm_eap_tnc module will be removed with FreeRADIUS 4.0.
2018-11-21 14:32:24 +01:00