17999 Commits

Author SHA1 Message Date
Tobias Brunner
b667eb37b9 swanctl: Clear possibly unencrypted key/container files from memory 2021-10-04 11:30:03 +02:00
Tobias Brunner
3a739424e1 pem: Clear possibly unencrypted key file from memory 2021-10-04 11:30:03 +02:00
Tobias Brunner
e2e21f2486 chunk: Optionally clear mmap'd chunk before unmapping
This is mostly for the non-mmap case as with mmap available, access to the
unmapped memory isn't easily possible (e.g. opening the same area with
MAP_ANONYMOUS | MAP_UNINITIALIZED is usually prevented by the missing
CONFIG_MMAP_ALLOW_UNINITIALIZED option in most kernels).
2021-10-04 11:30:03 +02:00
Tobias Brunner
b9aafa7ebf vici: Clear all request messages in case they contain secrets 2021-10-04 11:30:03 +02:00
Tobias Brunner
4bea9e8b60 vici: Clear cached strings in case the message contained shared secrets 2021-10-04 11:30:03 +02:00
Tobias Brunner
66e80f3d1b pem: Clear chunks after decrypting files 2021-10-04 11:30:03 +02:00
Tobias Brunner
16d91ab761 shared-key: Clear shared secret when destroyed 2021-10-04 11:30:03 +02:00
Tobias Brunner
5c24b05f0c Merge branch 'testing-bullseye'
Use Debian bullseye as base image for the testing environment.
2021-10-01 17:13:18 +02:00
Tobias Brunner
3edf3856d4 testing: Use Debian bullseye as base image 2021-10-01 15:05:44 +02:00
Tobias Brunner
bc51815839 testing: Determine Debian version in TNC scenarios automatically again
Was statically set to 10 since f3d96b7bc9e2 ("Version bump to 5.9.1dr1").
2021-10-01 15:05:44 +02:00
Tobias Brunner
f2420cee49 libimcv: Add Debian 11 (bullseye) to IMV database 2021-10-01 15:05:44 +02:00
Tobias Brunner
1ec01f10a2 testing: Replace arp with ip neigh
The net-tools package, which provides arp and other older utilities like
ifconfig, is not installed anymore on Debian bullseye.
2021-10-01 15:05:44 +02:00
Tobias Brunner
ccac9c3047 testing: Allow DNS via TCP in net2net-dnscert scenario
New versions of Bind limit the maximum UDP message size to 1232 bytes,
which is the same that newer versions of libunbound propose as maximum via
EDNS in requests, so increasing the limit on the server wouldn't help.

Instead we allow DNS via TCP so the client can switch after receiving the
truncated UDP response.
2021-10-01 15:05:44 +02:00
Tobias Brunner
5b9c46b988 testing: Remove support for Debian jessie and FreeRADIUS 2 2021-10-01 15:05:44 +02:00
Tobias Brunner
dff5a0cab8 testing: Support build with Debian bullseye base image 2021-10-01 15:05:44 +02:00
Tobias Brunner
f92ad8454b openssl: Use correct key types when adopting Ed25519/448 keys
Fixes: cbf07ab5b0b6 ("openssl: Add support for Ed25519/Ed448")
2021-10-01 15:04:13 +02:00
Tobias Brunner
c463a14483 openssl: Remove workaround for Brainpool ECDH curves for older OpenSSL versions
Using the workaround with the EVP interface, which we use to derive shared
keys since 74e02ff5e624 ("openssl: Mainly use EVP interface for ECDH"),
would actually require us to register the OIDs of these curves as NID.
Otherwise, the two EC_GROUPs used by private and public key objects
are not considered the same and the key derivation fails.

Since the curves are supported by OpenSSL since 1.0.2 it's probably rare to
find a version without them nowadays.  One exception is the old BoringSSL
version we still use on Android, which defines the NIDs but not the curve
data.  However, that version also lacks support to register OIDs as NIDs,
so the only option to support these groups there would be to got back to not
using the EVP interface, which isn't in anyone's interest.  If there really
is a need for them there, we could probably patch BoringSSL or use OpenSSL.
2021-10-01 15:04:13 +02:00
Tobias Brunner
3e148e5b76 github: Fix build on macOS due to moved OpenSSL location 2021-09-30 16:24:25 +02:00
Tobias Brunner
72e5b3b702 crl: Fix compilation with OpenSSL 3.0
Closes strongswan/strongswan#635
2021-09-30 11:57:43 +02:00
Tobias Brunner
2fbbd05ec5 github: Use OpenSSL 1.1 on macOS
The "openssl" alias now defaults to OpenSSL 3.0, which produces a lot of
deprecation warnings.  To avoid build failures due to `-Werror`, stay with
OpenSSL 1.1 until we can get rid of these issues.
2021-09-23 17:02:17 +02:00
Tobias Brunner
b94236487c kernel-pfkey: Wipe request/response messages when managing SAs 2021-09-23 15:28:22 +02:00
Andreas Steffen
1b21a00fa7 Version bump to 5.9.4dr2 5.9.4dr2 2021-09-21 14:18:16 +02:00
Tobias Brunner
e166e6913c Change shebang for Python scripts to use python3 2021-09-21 12:51:47 +02:00
Tobias Brunner
6467f0416f testing: Fix updown script in route-based/net2net-xfrmi-ike scenario
With the update to Python 3 the encoding of the values in vici messages
changed to bytestrings (the keys are properly decoded).  And getting the
first CHILD_SA also needs a change.

The logger is now also initialized after daemonizing to avoid that opened
sockets are closed etc.
2021-09-21 12:50:12 +02:00
Andreas Steffen
3e2841572b testing: Switch to Python 3
Both swidGenerator and strongTNC were migrated to Python 3.
This allows to migrate all testing scripts to Python 3, too.
2021-09-21 09:47:43 +02:00
Tobias Brunner
a5662e8f6e keymat_v2: Properly wipe DH secret during IKE_SA rekeying
While `secret` is wiped explicitly, it wasn't when concatenating with
the nonces.
2021-09-20 16:10:03 +02:00
Andreas Steffen
91896264b2 sec-updater: Use latest versions 2021-09-09 22:54:38 +02:00
Andreas Steffen
d23ca7f345 os_info: Parse /etc/os-release first 2021-09-09 22:54:38 +02:00
Tobias Brunner
bf91b71f1a github: Remove build on Ubuntu Xenial (16.04)
Support for it will be removed later this month.
2021-09-09 12:30:17 +02:00
Tobias Brunner
a415761a8e vici: Update supported Python versions 2021-09-09 12:30:17 +02:00
Noel Kuntze
fbd4930323 vici: Add DBG4 messages that print loaded shared keys and PINs
Closes strongswan/strongswan#217
2021-09-02 10:42:41 +02:00
Tobias Brunner
3c0d7ec531 ike: Initiate new IKE_SA not until all children are queued
If there are many CHILD_SAs, the time between initiating the new IKE_SA
and checking it in might be longer (depending on what else is going on
in the daemon) than the retransmission timeout and no retransmits might
be sent afterwards for this SA (it will just linger around dead).
Calling initiate() last should avoid that (we do this similarly for MBB
reauthentication).
2021-08-24 14:31:55 +02:00
Tobias Brunner
23e46ea5ab ikev2: Only request reauth during IKE_AUTH if active reauth is not possible
If we can initiate the reauthentication ourselves, there is no reason to
explicitly request the peer to do so (at basically the same time).
2021-08-24 14:31:55 +02:00
Tobias Brunner
0d373e25e0 ike-rekey: Respond with TEMPORARY_FAILURE while reauthenticating
This could lead to duplicates as the new IKE_SA can't delete the old one
once reauthentication is complete if it was replaced by a rekeying.
2021-08-24 14:31:55 +02:00
Tobias Brunner
36161febd3 ike: Don't rekey IKE_SA while reauthenticating
If we are using make-before-break reauthentication, this could lead to
duplicates as the new IKE_SA wouldn't be able to delete the previous
one if it was replaced by a rekeying.
2021-08-24 14:31:55 +02:00
Tobias Brunner
48fbe1d2d5 ike-delete: Don't call reestablish() when reauthenticating
If we initiated a make-before-break reauthentication and the peer
concurrently deletes the IKE_SA (e.g. because it uses break-before-make
reauthentication), we would create a duplicate IKE_SA (the condition forces
a recreation of all existing CHILD_SAs because reestablish() is also called
to complete a break-before-make reauthentication).
2021-08-24 14:31:55 +02:00
Tobias Brunner
57e68ab9c5 openssl: Improve compatibility to newer BoringSSL releases
Closes strongswan/strongswan#352
2021-08-24 14:20:37 +02:00
Tobias Brunner
1d64b6c462 Merge branch 'swanctl-ssh-public-keys'
Minor changes that allow loading SSH public keys via `pubkeys` in
swanctl.conf.

References strongswan/strongswan#467
2021-08-23 18:04:50 +02:00
Tobias Brunner
5821f2cc01 pubkey: Ignore X.509 flags passed to the parser 2021-08-23 17:59:39 +02:00
Tobias Brunner
4dfa31c8a0 pubkey: Don't assume blobs are only ASN.1 DER
Also forward the blob's type when parsing pubkeys.
2021-08-23 17:59:39 +02:00
Tobias Brunner
de5609b297 vici: Use the more generic BUILD_BLOB to parse certificates/public keys 2021-08-23 17:59:39 +02:00
Tobias Brunner
b4a34ff5ea github: Remove github.ref from cache keys
According to the documentation for actions/cache, the lookup is already
scoped to the current branch (with fallback to any base branch including
the default branch).
2021-08-23 17:53:33 +02:00
Tobias Brunner
8d422d2c83 tpm_extendpcr: Support platforms not having syslog() 2021-08-23 11:30:15 +02:00
Tobias Brunner
4aa6da69aa tpm_extendpcr: Build does not depend on tpm plugin but libtpmtss
The utility basically requires a TSS, the tpm plugin is not used at all.
2021-08-23 10:44:41 +02:00
Andreas Steffen
0eb1d6c0e6 Version bump to 5.9.4dr1 5.9.4dr1 2021-08-22 10:55:37 +02:00
Tobias Brunner
5126e7c0fc libtpmtss: Initialize library from all users
Previously, only the tpm plugin initialized the library, so in order
to use a TPM 2.0 (a required TCTI library is loaded via init), it was
necessary to load it even if none of its actual features were used.
2021-08-20 17:10:11 +02:00
Tobias Brunner
6c1210dcf6 configure: Enforce tss-tss2 if tpm plugin is enabled
The plugin is useless without a TSS 2.0 and this is currently the only one.
2021-08-20 10:45:44 +02:00
Tobias Brunner
64b281723c openssl: Use a longer key to test/initialize HMAC instances
OpenSSL enforces a minimum of 14 bytes (112 bits) on the key size when
used in FIPS-mode (as required by SP 800-131A).  So by using an empty
string, instantiation always failed.  32 bytes (256 bits) should be safe
for now.

Closes strongswan/strongswan#557
2021-08-19 14:06:19 +02:00
Tobias Brunner
e6a904de69 testing: Fix build of tkm and tkm-rpc 2021-08-17 19:20:45 +02:00
Tobias Brunner
ce607d774b github: Use latest version of SonarScanner 2021-08-16 11:26:11 +02:00