Commit Graph

17314 Commits

Author SHA1 Message Date
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
Tobias Brunner 21280da9f5 testing: Fix ikev2/net2net-rsa scenario 2019-05-08 14:56:48 +02:00
Tobias Brunner da8e33f3ca testing: Add wrapper script to build certificates in root image
This does not modify the root image but uses the strongSwan version
installed there (avoids build dependencies on version installed on the
host to use pki to generate all the keys and certificates).
2019-05-08 14:56:48 +02:00
Andreas Steffen a89ad28b89 testing: Upgrade to Linux 5.1 kernel 2019-05-08 14:56:48 +02:00
Andreas Steffen df6441a13f pki: Allow inclusion of [unsupported] critical X.509 extension 2019-05-08 14:56:48 +02:00
Andreas Steffen b213204b3b testing: Updated build-certs script 2019-05-08 14:56:48 +02:00
Andreas Steffen cfeae14b06 testing: Deleting dynamic test keys and certificates 2019-05-08 14:56:48 +02:00
Tobias Brunner 2a72056cee testing: Exclude files that are ignored in Git from the distribution
Since the complete hosts and tests directories are part of the tarball
this would include generated certificates and keys.
2019-05-08 14:56:48 +02:00
Andreas Steffen 92c001f766 testing: Remove dynamic keys and certs from repository 2019-05-08 14:56:48 +02:00
Andreas Steffen 00f1d09729 testing: Build data.sql files for SQL test cases 2019-05-08 14:56:48 +02:00
Tobias Brunner 0c924641e6 pki: Add different output options for --keyid
Makes machine-processing these identifiers easier.
2019-05-08 14:56:48 +02:00
Tobias Brunner 05275905ef testing: Build CERT and IPSECKEY RRs for strongswan.org zone
Also copy generated keys to DNSSEC test cases.
2019-05-08 14:56:48 +02:00