Commit Graph
14112 Commits
Author SHA1 Message Date
Thomas Egerer d6879ef984 ha: Streamline handling of conditions and extensions
Automatically takes care of sending/receiving newly added extensions and
conditions.

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2022-02-15 15:27:13 +01:00
Tobias Brunner 801bb8536a error-notify: Handle missing alerts
References strongswan/strongswan#876.
2022-02-15 15:23:37 +01:00
Tobias Brunner 34a6cb858d openssl: Return correct number of plugin features if ECDH groups are omitted
Fixes: 46a6b06282 ("openssl: Only announce ECDH groups actually supported by OpenSSL")
2022-02-04 16:30:51 +01:00
Martin Willi 956b25a4cc proposal: Add ESN transform to default ESP AEAD proposal
The commit mentioned below adds an AES-GCM default proposal for ESP. That
proposal does not include any ESN or non-ESN transform to indicate if
extended sequence numbers are supported.

A standards-compliant peer will include one or more ESN support transforms,
and will be unable to select this proposal due to a proposal mismatch.

Fix the default AES-GCM proposal by adding a NO_ESN algorithm. While ESN has
been supported in the Linux kernel for a while, having it in the default
proposal can be problematic with kernel-libipsec or on other platforms.

Fixes: c7bef954ee ("proposal: Add AES-GCM to the ESP default AEAD proposal")
Closes strongswan/strongswan#868
2022-02-01 13:06:42 +01:00
Martin Willi 9877ce6c56 sys-logger: Optionally support mapping strongSwan loglevels to syslog levels
strongSwan logs all syslog messages using LOG_INFO for historical reasons,
regardless of the strongSwan loglevel used producing the log message.

In some setups with advanced logging infrastructure, it may be feasible
to be more verbose when logging in strongSwan, but then filter messages
on the syslog server. While this may be possible by custom syslog filtering
rules matching the log level included with the log_level setting, this is
not super convenient.

So add a new map_level setting, which can map strongSwan loglevels to
syslog loglevels. By default this is disabled, keeping the existing
behavior. If enabled, it maps strongSwan loglevels to syslog loglevels
at a given syslog loglevel offset.

Closes strongswan/strongswan#859
2022-01-24 17:33:02 +01:00
Martin Willi e3d1766aff addrblock: Allow limiting validation depth of issuer addrblock extensions
RFC3779 requires to validate the addrblocks of issuer certificates strictly,
that is, they must contain the extension and the claimed addrblock, up to
the root CA.

When working with third party root CAs that do not have the extension,
this makes using the plugin impossible. So add a depth setting that limits
the number of issuer certificates to check bottom-up towards the root CA.
A depth value of 0 disables any issuer check, the default value of -1
checks all issuers in the chain, keeping the existing behavior.

Closes strongswan/strongswan#860
2022-01-24 17:32:06 +01:00
Tobias Brunner 64cc9acbf0 eap-authenticator: Enforce failure if MSK generation fails
Without this, the authentication succeeded if the server sent an early
EAP-Success message for mutual, key-generating EAP methods like EAP-TLS,
which may be used in EAP-only scenarios but would complete without server
or client authentication.  For clients configured for such EAP-only
scenarios, a rogue server could capture traffic after the tunnel is
established or even access hosts behind the client.  For non-mutual EAP
methods, public key server authentication has been enforced for a while.

A server previously could also crash a client by sending an EAP-Success
immediately without initiating an actual EAP method.

Fixes: 0706c39cda ("added support for EAP methods not establishing an MSK")
Fixes: CVE-2021-45079
2022-01-20 17:23:24 +01:00
Tobias Brunner 627eaa22ff Fixed some typos, courtesy of codespell 2022-01-20 10:44:42 +01:00
Tobias Brunner 21b2b124a1 agent: Log socket path if connecting to it failed 2022-01-20 10:02:54 +01:00
Tobias Brunner 6867050d47 message: Add getter/setter for metadata handling 2022-01-14 10:13:21 +01:00
Tobias Brunner e3d84bc6f6 packet: Add helper function to create a clone without data 2022-01-14 10:13:21 +01:00
Tobias Brunner 93583d23d6 packet: Add getter/setter for metadata handling 2022-01-14 10:13:21 +01:00
Tobias Brunner 269ca19f13 metadata-set: Add implementation for a collection of metadata objects 2022-01-14 10:13:21 +01:00
Tobias BrunnerandThomas Egerer 531335ad20 metadata: Add metadata factory and implementation for integer types
Co-authored-by: Thomas Egerer <thomas.egerer@secunet.com>
2022-01-14 10:13:21 +01:00
Andreas Steffen 903c68e069 sw-collector: Iterate through history logs
The logrotate function causes the apt history to be split into
several parts at arbitrary points in time. If history.log only
is parsed then some package installation changes stored in
zipped backup history files might get lost.

Thus sw-collector now searches all backup history files until
a date older than the current event stored in the collector.db
database is found, so that no entries get overlooked.
2021-12-31 14:33:22 +01:00
Andreas Steffen 0b76ca13ab libtpmtss: Some minor improvements 2021-12-19 13:50:07 +01:00
Andreas Steffen 8249e6afad libtpmtss: Establish session with TPM 2.0
Using the trusted RSA or ECC Endorsement Key of the TPM 2.0 a
secure session is established via RSA public key encryption or
an ephemeral ECDH key exchange, respectively.

The session allows HMAC-based authenticated communication with
the TPM 2.0 and the exchanged parameters can be encrypted where
necessary to guarantee confidentiality.
2021-12-11 16:21:59 +01:00
Tobias Brunner 910b7d1915 openssl: Log loaded providers 2021-12-08 11:34:22 +01:00
Tobias Brunner 3cd2e2ccc6 openssl: Make fips_mode option work with OpenSSL 3 2021-12-08 11:34:18 +01:00
Tobias Brunner f556fce16b openssl: Load "legacy" provider in OpenSSL 3 for algorithms like MD4, DES etc.
We still require these algorithms for e.g. EAP-MSCHAPv2, so the option is
enabled, by default.  To use other providers (e.g. fips or even custom
ones), the option can be disabled and the providers to load/activate can
be configured in openssl.cnf.  For instance, the following has the same
effect as enabling the option:

    openssl_conf = openssl_init

    [openssl_init]
    providers = providers

    [providers]
    default = activate
    legacy = activate

    [activate]
    activate = yes
2021-12-08 11:34:13 +01:00
Tobias Brunner 46a6b06282 openssl: Only announce ECDH groups actually supported by OpenSSL
Determined by whether the library provides curves for it or not.
For instance, in the OpenSSL 3 FIPS provider the Brainpool curves are
not included.  And in the Fedora package several weak curves are
explicitly patched out and the Brainpool curves are omitted even in
non-FIPS mode.
2021-12-08 11:33:04 +01:00
Tobias Brunner 03520a0d54 openssl: Add helper to map ECDH groups to curve NIDs 2021-12-08 11:32:59 +01:00
Tobias Brunner 88e7654c6c libtls: Shutdown server socket in test teardown function
If a test fails and the server thread is blocked reading on the socket,
it would stay stuck.
2021-12-08 11:32:55 +01:00
Tobias Brunner d95381ec7a tls-socket: Handle sending fatal errors better
In particular as server, the previous code might cause it to hang in
recv() if this case wasn't triggered by a close notify (followed by a
shutdown of the socket) but it e.g. failed processing a ServerHello and
responded with a fatal alert.

Fixes: 09fbaad6bd ("tls-socket: Don't fail reading if sending data failed")
2021-12-08 11:32:50 +01:00
Andreas Steffen 01485770fd gcrypt: Support of AES-CFB encryption 2021-12-06 13:43:45 +01:00
Andreas Steffen 2d1a1cc907 botan: Support of AES-CFB encryption 2021-12-06 13:28:31 +01:00
Andreas Steffen 54d7e39d40 wolfssl: Support of AES-CFB encryption 2021-12-06 12:53:11 +01:00
Andreas Steffen 695a04d146 openssl: Support of AES-CFB encryption 2021-12-06 12:52:37 +01:00
Tobias Brunner dcaf9b38f3 child-rekey: Uninstall old outbound SA earlier on initiator/winner
This is useful for kernel implementations where the ordering of SAs
is unpredictable and the new SA might otherwise not be used until the
DELETE response has been received, which is not ideal as the responder
might not keep the old SA around that long.  On Linux, it makes no
difference as we switch to the new outbound SA immediately because the
updated outbound policy references its SPI.
2021-12-01 11:00:40 +01:00
Tobias Brunner 66fd0c4db7 charon-tkm: Make only tests requiring TKM optional
This way we can run many unit tests without having to run the TKM in the
background and as regular user.  To run the other tests, TESTS_TKM can
optionally be defined when running `make check`.
2021-11-29 15:29:22 +01:00
zhangxiaojun df0999ec93 android: Improved simplified Chinese translation / 完善了简体中文翻译
Closes strongswan/strongswan#779
2021-11-26 15:45:53 +01:00
Tobias Brunner e43052893d vici: Fix check before applying identity to public keys 2021-11-23 16:15:41 +01:00
Tobias Brunner 11b10bc2b0 farp: Fix incompatible function types warning 2021-11-17 18:21:30 +01:00
Tobias Brunner cceca1a3c4 eap-radius: Fix incompatible function types warnings 2021-11-17 18:18:09 +01:00
Tobias Brunner 9b2e9a943c processor: Fix incompatible function types warnings 2021-11-17 18:06:20 +01:00
Tobias Brunner 0917edb468 blocking-queue: Fix incompatible function types warning 2021-11-17 17:46:27 +01:00
Andreas Steffen 519db56f2f testing: Added RSA PKCS1 encryption tests 2021-11-10 21:06:10 +01:00
Andreas Steffen 6bb5c4f2bb testing: Added RSA OAEP encryption tests 2021-11-10 21:06:10 +01:00
Andreas Steffen 93bf894cd2 gcrypt: Support RSA OAEP SHA1 encryption/decryption 2021-11-10 21:06:10 +01:00
Andreas Steffen b50e8a88ff gcrypt: Enable RSA PKCS1 encryption/decryption 2021-11-10 20:17:49 +01:00
Andreas Steffen be52ad7c6d botan: RSA OAEP labels are not supported 2021-11-10 20:03:22 +01:00
Andreas Steffen 9cfdc32597 wolfssl: Support OAEP labels 2021-11-10 20:03:22 +01:00
Andreas Steffen 6adb543341 openssl: Implemented RSA OAEP encryption/decryption with optional labels 2021-11-10 20:03:22 +01:00
Andreas Steffen 4abb29f639 credentials: Added void *params to public_key encrypt() and private_key decrypt() methods 2021-11-09 17:58:28 +01:00
Andreas Steffen c8341fca61 botan: Fully enable RSA OAEP decryption 2021-11-09 17:58:28 +01:00
Tobias Brunner f4bfdec21f kernel-pfroute: Set lower MTU on TUN devices
The default MTU of 1500 is too high if kernel-libipsec is used (considering
the overhead of UDP-encapsulated ESP), but might also have an effect if
a TUN device is only used to install a virtual IP (the route points to it,
so the system might use its MTU and 1500 would still be too high).

This also works around an issue on macOS 12 where no RTM_IFINFO event
is sent for the newly created TUN device (neither for the creation,
setting it "up", nor adding the address).  Changing the MTU, however,
triggers such an event and we can detect the virtual IP.

Closes strongswan/strongswan#707
2021-11-09 09:43:01 +01:00
Tobias Brunner eb19699a7a ike: Fix length of vendor ID Cisco VPN 3000 client
The actual length of the data is 16 bytes.

Fixes: 6c49ddfbca ("ike: Add additional Vendor IDs for third-party implementations")
2021-11-03 11:01:09 +01:00
Volker Rümelin 9747376c69 ike: Fix prefix length and data of vendor ID Cisco VPN Concentrator
Currently the length of vendor ID Cisco VPN Concentrator is 16
bytes but the string has only 13+1 bytes. The actual vendor
ID has 16 bytes with a prefix length of 14 bytes and two version
bytes.

Fixes: 6c49ddfbca ("ike: Add additional Vendor IDs for third-party implementations")
2021-11-03 11:01:09 +01:00
Volker Rümelin 865a387c6c ikev1: Fix prefix length of vendor ID Cisco Unity
Before commit 6c49ddfbca ("ike: Add additional Vendor IDs for
third-party implementations") the prefix length of vendor ID
Cisco Unity was hardcoded to 14. Since we need to know the actual
length of this VID to send it, the length can't be overloaded
with a prefix length. Revert part of commit 6c49ddfbca to
fix this problem.

Fixes: 6c49ddfbca ("ike: Add additional Vendor IDs for third-party implementations")
2021-11-03 11:00:59 +01:00
Volker Rümelin 5e1d1cd30f ikev1: Fix prefix length of vendor ID MS NT5 ISAKMPOAKLEY
Before commit 6c49ddfbca ("ike: Add additional Vendor IDs for
third-party implementations") the prefix length of vendor ID
MS NT5 ISAKMPOAKLEY was hardcoded to 16. Change the prefix length
accordingly.

Fixes: 6c49ddfbca ("ike: Add additional Vendor IDs for third-party implementations")
2021-11-03 10:25:51 +01:00