Commit Graph

17153 Commits

Author SHA1 Message Date
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
Tobias Brunner 1e059c837b testing: Rename public keys in DNSSEC scenarios
We will generate PEM-encoded public keys with the script.
2019-05-08 14:56:48 +02:00
Tobias Brunner 326bb5f2c5 testing: Convert keys and certificates for all TKM scenarios 2019-05-08 14:56:48 +02:00
Tobias Brunner 0136852f19 testing: Disable leak detective in build-certs script 2019-05-08 14:56:48 +02:00
Andreas Steffen 8db01c6a3f testing: Script building fresh certificates 2019-05-08 14:56:48 +02:00
Tobias Brunner 3ee352a691 smp: Use correct printf specifier to print SPIs 2019-05-08 14:48:54 +02:00
Tobias Brunner e6e4113e9f fast: Use correct printf specifier to print content length 2019-05-08 14:48:54 +02:00
Tobias Brunner 12e64e5cf4 libimcv: Use proper printf specifier for unsigned issuer and responder IDs 2019-05-08 14:48:54 +02:00
Tobias Brunner 994cff3fac swima-collector: Use proper type for field precision 2019-05-08 14:48:54 +02:00
Tobias Brunner a4abb263c9 openssl: Fix build with OpenSSL 1.1.1 without compatibility layer
If OpenSSL is built with --api, defines for deprecated functions in
OpenSSL's header files are not visible anymore.

Fixes #3045.
2019-05-08 14:28:18 +02:00
Tobias Brunner 91dce6e876 travis: Build OpenSSL 1.1.1 without compatibility layer for older versions
Configuring 1.1.1 is not actually possible with 1.1.1b, not sure if
that's on purpose.
2019-05-08 14:27:19 +02:00
Tobias Brunner 885c05b0da travis: Make sure crypto plugins are actually loaded 2019-05-08 14:27:13 +02:00