Commit Graph

17175 Commits

Author SHA1 Message Date
Tobias Brunner 17c9972252 Fixed some typos, courtesy of codespell 2019-08-28 14:03:41 +02:00
Tobias Brunner 82cd511cc9 NEWS: Added some news for 5.8.1 2019-08-28 12:17:44 +02:00
Tobias Brunner 902f38dd3e ikev2: Check the length of received COOKIE notifies
As specified by RFC 7296, section 2.6, the data associated with COOKIE
notifications MUST be between 1 and 64 octets in length (inclusive).

Fixes #3160.
2019-08-28 12:15:27 +02:00
Tobias Brunner 8cd5f33dd8 libipsec: Fix compiler warning with GCC 9
The compiler complains that "taking address of packed member ... of
class or structure 'ip6_hdr' may result in an unaligned pointer value".
We don't care if the address is aligned as we explicitly use untoh16()
to convert the read value.
2019-08-28 11:10:49 +02:00
Tobias Brunner d6949b15ab cirrus: Run automated tests on FreeBSD via Cirrus CI 2019-08-28 11:10:49 +02:00
Tobias Brunner 535277afc5 Fix issue with $< automatic variable on FreeBSD
BSD make only evaluates $< for implicit rules, so building from the
repository won't work unless GNU make is installed and used, or we
replace affected uses like this.
2019-08-27 18:12:28 +02:00
Tobias Brunner 0a29ace908 Merge branch 'android-updates'
Some fixes for Android 9 (28) and other issues.  Also migrated to
AndroidX.

Closes strongswan/strongswan#148.
2019-08-26 11:29:09 +02:00
Tobias Brunner 3716af079e android: Avoid crash related to TileService on Huawei devices
No idea when exactly this happens but on many Huawei devices (and
only on them) it seems that onStartListening is sometimes called after
onDestroy i.e. when the database was already closed.  This caused an
InvalidStateException in getProfile via updateTile when retrieving the
current profile.  It's possible that it happens during shutdown (there
have been similar reports related to TileService implementations) so
users might not even notice, but it pollutes the Play Console, so this
workaround now makes sure the database is open when updateTile is called.
2019-08-26 11:28:16 +02:00
Tobias Brunner 8af50736e1 android: Fix null pointer dereference in TextInputLayoutHelper
The AndroidX/Material version of TextInputLayout actually supports a
helper text, but it is always shown, so we continue to use our version.
2019-08-26 11:20:48 +02:00
Tobias Brunner 9a305b7cbe android: Replace deprecated Html.fromHtml with version from AndroidX 2019-08-26 11:20:48 +02:00
Tobias Brunner 3b9696fc9b android: Migrate from support libraries to AndroidX
The support libraries will not be developed further.
2019-08-26 11:20:48 +02:00
Tobias Brunner 07a7d842f1 android: Request FOREGROUND_SERVICE permission
This is required since API 28 to call Service.startForeground.
2019-08-26 11:20:48 +02:00
Tobias Brunner d59158df7b android: Switch to Loaders from the support library
They are officially deprecated as of API 28 (recommended replacement is
a combination of ViewModels and LiveData, maybe something to look into
later).
2019-08-26 11:20:48 +02:00
Tobias Brunner ef57913d37 android: Set compile-/targetSdkVersion to 28
This is mandatory for new apps since August 1, 2019 and will be for existing
apps in November 1, 2019.
2019-08-26 11:20:48 +02:00
Tobias Brunner 1ce5dd92fe android: Update Gradle plugin 2019-08-26 11:20:48 +02:00
Tobias Brunner 770f4ccee1 identification: Optionally match RDNs in any order and accept missing RDNs 2019-08-26 11:15:53 +02:00
Martin Willi c0d5c6553a Run gperf with --output-file instead of output redirection
When missing gperf, the redirection generates an empty file, which must
be manually removed after gperf has been installed. This is difficult
to diagnose, as the produced build error is cryptic.

Use --output-file of gperf instead to avoid creating an empty file if
gperf is missing. This still requires the user to re-run ./configure
after installing gperf, though.
2019-08-26 10:56:36 +02:00
Tobias Brunner 9543a771dd updown: Pass the local interface the traffic to the peer actually takes
If the local IP is not on the interface the peer is reached through,
firewall rules will be installed with the wrong interface.

Fixes #3095.
2019-08-26 10:55:01 +02:00
Tobias Brunner 0ee64f88e5 attributes: Add definition of some additional configuration attributes 2019-08-26 10:16:48 +02:00
Tobias Brunner a4279fcc38 asn1: Fix a compiler warning with GCC 9.1
Compiling with GCC 9.1, as e.g. happens on AppVeyor, results in the
following warning:

asn1/asn1.c: In function 'asn1_integer':
asn1/asn1.c:871:24: error: '<Ucb40>' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  871 |  len = content.len + ((*content.ptr & 0x80) ? 1 : 0);
      |                        ^~~~~~~~~~~~

Some experiments showed that the problem was the chunk_from_chars()
assignment.  This might be because the temporary chunk_t that was assigned
to the variable was defined in a sub-block, so it might actually be
undefined later when *content.ptr is read.
2019-08-23 09:06:34 +02:00
Tobias Brunner a1295ff9cb load-tester: Add digitalSignature keyUsage flag to test certificate
This allows using the certificate, which is technically a CA cert, as
end-entity certificate again after the RFC4945-related changes added
with 5.6.3.

Fixes #3139.
2019-08-22 15:33:14 +02:00
Tobias Brunner b9949e98c2 Some whitespace fixes
Didn't change some of the larger testing scripts that use an inconsistent
indentation style.
2019-08-22 15:18:06 +02:00
Tobias Brunner 68346b6962 Add an .editorconfig file
It's currently not possible to configure our indentation scheme for
continuation lines (i.e. use 1-3 spaces to align with the upper line).
There is an issue open regarding this, see [1].  So we can't run e.g.
eclint over our codebase to detect issues without getting a lot of
false positives.

The main trigger was that this sets the preferred tab width in GitHub's
code browser.

[1] https://github.com/editorconfig/editorconfig/issues/323

References #3111.
2019-08-22 15:18:06 +02:00
Tobias Brunner 149d1bbb05 memory: Use explicit_bzero() as memwipe() if available 2019-08-22 15:04:45 +02:00
Tobias Brunner f00c9f91a3 travis: Bump wolfSSL to 4.1.0 2019-08-12 14:25:56 +02:00
Tobias Brunner 05e3751ebb fuzz: Support build with -fsanitize=fuzzer instead of libFuzzer.a
Recent clang versions (6.0+) include libFuzzer and OSS-Fuzz switched to
that mode a while ago.
2019-07-17 11:44:27 +02:00
Tobias Brunner de07b77442 Use Botan 2.11.0 for tests 2019-07-02 11:35:21 +02:00
Tobias Brunner 6051d9b5e4 botan: Replace deprecated FFI function calls
Several "wrapper" functions have been marked deprecated with 2.11.0.
2019-07-02 11:35:21 +02:00
Andreas Steffen ab1aa03bf5 Version bump to 5.8.1dr1 2019-06-26 17:32:33 +02:00
krinfels 4b25885025 libtpmtss: Protect TPM 2.0 context by mutex
Each private key object created to access a key residing in a TPM 2.0
creates a context structure used for communication with the TSS.
When multiple IKE SAs are established at the same time and using the
same private key, it is possible to make concurrent calls to the
TSS with the same context which results in multiple threads writing
to the same place in memory causing undefined behaviour.

Fix this by protecting calls to the TSS with a mutex unique for
each TPM 2.0 context object.
2019-06-26 16:30:01 +02:00
Tobias Brunner 07a6e59b1c android: Fix remote identity fallback after changing IKE config creation
Fixes: 9486a2e5b0 ("ike-cfg: Pass arguments as struct")
2019-06-18 10:22:57 +02:00
Tobias Brunner 44e74d9f3e android: Fix typo when building IKE config
Fixes: 9486a2e5b0 ("ike-cfg: Pass arguments as struct")
2019-06-18 10:21:07 +02:00
Tobias Brunner 6cc0688e1e travis: Bump OpenSSL to 1.1.1c 2019-05-28 15:28:06 +02:00
Sheena Mira-ato fe3ae5be5d Add compile option to disable internal handling of fatal signals
By default, charon and its derivatives internally handle the SIGSEGV,
SIGILL, and SIGBUS signals raised by threads (segv_handler).  Add a compile
option so that the signal handling can optionally be done externally.

Closes strongswan/strongswan#132.
2019-05-28 10:44:48 +02:00
Tobias Brunner 71141cc8c9 ikev1: Do a rekey check before installing CHILD_SAs as responder
If CHILD_SAs are created while waiting for the third QM message we'd not
notice the redundancy and updown events would be triggered unevenly.
This is consistent with the behavior on the initiator, which already does
this check right before installation. Moving the existing check is not
possible due to the narrow hook and moving the installation changes which
peer installs the SAs first and could have other side-effects (e.g. in
error or conflict cases).  Still, this might result in CHILD_SA state
discrepancies between the two peers.

Fixes #3060.
2019-05-22 18:28:31 +02:00
SophieK 3aa7b2dc3a Avoid enumerating certificates with non-matching key type
If the key type was specified but the ID was NULL or matched a subject, it
was possible that a certificate was returned that didn't actually match
the requested key type.

Closes strongswan/strongswan#141.
2019-05-21 10:22:30 +02:00
Andreas Steffen 55dd0361b8 Version bump to 5.8.0 2019-05-20 12:31:08 +02:00
Tobias Brunner fbfe5a2724 proposal: Add missing curve448/x448 keywords
Fixes #3064.
2019-05-20 09:43:59 +02:00
Tobias Brunner 802da663c2 nm: Version bump to 1.4.5 2019-05-14 10:38:32 +02:00
Andreas Steffen 74ac0c9efd Version bump to 5.8.0rc1 2019-05-10 12:55:48 +02:00
Andreas Steffen 47879ca638 testing: Use strongswan systemd service 2019-05-10 12:55:09 +02:00
Andreas Steffen 6d8e6ec61b testing: Load PEM keys in ikev2/net2-net-rsa scenario 2019-05-10 12:54:28 +02:00
Andreas Steffen c9d898c9f4 testing: Copy keys and certs to swanctl/rw-newhope-bliss scenario 2019-05-10 12:53:33 +02:00
SophieK 7e0e3ef4e0 keymat_v1: Avoid memory leak during IKE key derivation in some error cases
Closes strongswan/strongswan#138.
2019-05-09 10:07:52 +02:00
Tobias Brunner 78cad110ea Merge branch 'build-certs'
Adds a script to generate the keys and certificates used for regression
tests dynamically.  They are built with the pki version installed in the
root image so it's not necessary to have an up-to-date version with all
required plugins installed on the host system.
2019-05-08 14:57:03 +02:00
Tobias Brunner 27f6d37544 testing: Return an error if any command in the certificate build script fails 2019-05-08 14:56:48 +02:00
Tobias Brunner d3f678c08f testing: Build certificates before guests after building strongSwan
If the script is run on a clean working copy, building the guests will
fail if the certificates don't exist.
2019-05-08 14:56:48 +02:00
Tobias Brunner 287149cbf9 testing: Automatically build guest images after generating certificates
This (re-)generates the CRLs on winnetou.
2019-05-08 14:56:48 +02:00
Tobias Brunner ac66ca25f9 testing: Use custom plugin configuration to build SHA-3 CA 2019-05-08 14:56:48 +02:00
Tobias Brunner 532060c0fa pki: Plugins to load may be defined via PKI_PLUGINS env variable 2019-05-08 14:56:48 +02:00