19166 Commits

Author SHA1 Message Date
Andreas Steffen
3b7c49bc31 mgf1: Support of RSA PSS with SHA3 hash 2024-11-22 14:05:36 +01:00
Andreas Steffen
1265d78cac ntru: Remove legacy NTRU key exchange method 2024-11-22 14:05:36 +01:00
Andreas Steffen
8e3a373e18 newhope: Remove legacy Newhope key exchange method 2024-11-22 14:05:36 +01:00
Andreas Steffen
4833f29b15 bliss: Remove legacy BLISS signatures 2024-11-22 14:05:36 +01:00
Gerardo Ravago
ec982171d9 openssl: Add ML-KEM support with AWS-LC
This registers support for the ML_KEM_{512,768,1024} key exchange
algorithms in the `openssl` plugin when built using AWS-LC as the
libcrypto. To do this, we introduce the `openssl_kem` source files
which implement the key exchange algorithm using the Key Encapsulation
Mechanism (KEM) API. Future KEM algorithms can be implemented
generically using this interface by substituting the appropriate NIDs.

It also supports both seeded (via DRBG) and unseeded modes depending
on the user's requirements for KATs or entropy sources.

It should be noted that this does not add support for KEM algorithms
within upstream OpenSSL and is API incompatible. Future work will need
to condition out the incompatibilities as-appropriate. However, the
high-level logic should be the same for all KEMs and KEM APIs.

References strongswan/strongswan#2228
Closes strongswan/strongswan#2490
2024-11-22 14:04:02 +01:00
Tobias Brunner
d14bb3881b botan: Add support for ML-KEM 2024-11-22 14:03:17 +01:00
Tobias Brunner
974f9c37df Use Botan 3.6.1 for tests
With 3.6.0 support for ML-KEM was added.
2024-11-22 14:03:17 +01:00
Tobias Brunner
ebdaab6861 botan: Add support for AES in ECB mode to support DRBG_CTR_AES
This DRBG is used to test ML-KEM.
2024-11-22 14:03:17 +01:00
Tobias Brunner
0a3889086d botan: Fix include issue that prevented parsing public keys
Botan stopped including build.h in ffi.h with 3.4.0, so we have to
add this here explicitly to check for the enabled key types.
2024-11-22 14:03:17 +01:00
Tobias Brunner
1bb6f1dd73 wolfssl: Add support for ML-KEM 2024-11-22 14:03:17 +01:00
Tobias Brunner
307dea6b5f Use wolfSSL 5.7.4 for tests
This adds support for ML-KEM etc.
2024-11-22 14:03:17 +01:00
Tobias Brunner
cc53a04c7a test-vectors: Add ML-KEM test vectors
The vectors are generated using the `kat_kem` utility of the liboqs
project and then converted using the `nist_kem_kat` script.
2024-11-22 14:03:16 +01:00
Andreas Steffen
ee19c3e7dd scripts: Add script formatting NIST KEM KAT records into ke_test vectors 2024-11-22 14:03:16 +01:00
Tobias Brunner
f58fdcddad dh-speed: Use method call order compatible with KEMs
Also prints the speed of the derivation (or decapsulation) for the
initiator.
2024-11-22 14:03:16 +01:00
Tobias Brunner
09636199e6 key-exchange: Document how the interface is used with KEMs 2024-11-21 14:26:35 +01:00
Andreas Steffen
40676786aa key-exchange: Joint ke_test_vector format for DH and KEM
Both Diffie-Hellman (DH) and Key Encapsulation Mechanism (KEM) based
key exchange methods use a common ke_test_vector format. The
set_seed() function is used to provide deterministic private key
material for the crypto tests.
2024-11-21 14:26:35 +01:00
Tobias Brunner
47de9ef9a1 key-exchange: Add identifiers for ML-KEM algorithms 2024-11-21 14:26:35 +01:00
Tobias Brunner
8ea6997482 swanctl: Document soft lifetime defaults if hard lifetimes are configured 2024-10-30 12:07:04 +01:00
Tobias Brunner
d4a0dd9f93 mem-pool: Fix issue with make-before-break reauth and multiple IKE_SAs
If uniqueness checks are disabled and multiple IKE_SAs with the same
identities are created, an offline lease could have gotten reassigned
during a make-before-break reauthentication if such an SA was closed
earlier.  Checking for an online lease for the same client (IP/port)
first ensures that the correct IP is reassigned during the
reauthentication.

References strongswan/strongswan#2472
2024-10-25 14:52:46 +02:00
Tobias Brunner
f09b8203d3 file-logger: Take options as a struct and combine ms/us suffix options
References strongswan/strongswan#2475
2024-10-25 14:49:11 +02:00
Tobias Brunner
768fec23bc file-logger: Add support to log timestamp in microseconds
Closes strongswan/strongswan#2475
2024-10-25 14:48:17 +02:00
Tobias Brunner
a2fba6db4a file-logger: Add option to log messages as JSON objects
Closes strongswan/strongswan#2222
2024-10-25 14:45:12 +02:00
Tobias Brunner
c87aae300a socket-default: Always open IPv4 sockets before IPv6 sockets
Since we now open sockets for each address family independently (via
IPV6_V6ONLY) and without SO_REUSEADDR, it could happen with the previous
order on Linux that opening the port that was allocated as ephemeral
port for IPv6 was already used by a different process for IPv4.

Most IPv6 sockets on ephemeral ports will not have IPV6_V6ONLY set, so
the same port is also reserved for IPv4.  Therefore, it's save to assume
that any ephemeral port we first get for IPv4 is free for IPv6.

References strongswan/strongswan#2494
2024-10-25 14:40:35 +02:00
Tobias Brunner
3d0f6958a9 openssl: Add support for new API to squeeze data from XOFs
This new API doesn't require a temporary buffer and generating a lot
of already consumed output.
2024-10-25 14:28:40 +02:00
Tobias Brunner
bee06c9ec5 leak-detective: Whitelist OpenSSL 3.2 function 2024-10-25 14:28:35 +02:00
Andreas Steffen
0be6fd7735 certificate_printer: Fix spacing for additional CRL/OCSP URIs
Multiple occurences of CRL and OCSP URIs where not indented correctly.
2024-10-18 15:45:07 +02:00
Tobias Brunner
5019e3ece0 nm: Update build files and switch from intltool to gettext
gnome-common has been deprecated, so has intltool.  This follows GNOME's
recommended migration paths.
2024-10-16 08:16:43 +02:00
Tobias Brunner
faf40b8d74 Revert "conf: Add support for escaping dots in section/option names"
This reverts commit 84a3077e780e7b25bf536da42a583bdc18448362.

Support for dots in names of settings was removed quite a while ago and
now the \. sequence caused `SyntaxWarning: invalid escape sequence`.
2024-10-15 12:59:41 +02:00
Tobias Brunner
60336ceecb wolfssl: Don't undef PARSE_ERROR as headers included later might refer to it 2024-10-15 11:14:35 +02:00
Tobias Brunner
8e020bc9e3 vici-config: Same order for default ESP proposals if unset or set to "default"
The order was different when not setting `esp_proposals` or explicitly
configuring `default`.

Fixes: 33412158f58c ("ike: Send AEAD ESP default proposal first")
2024-10-02 10:33:05 +02:00
Tobias Brunner
089977b69d generator: Make debug log for payload substructure rules more clear
Similar to the previous commit.  Instead of

  generating rule 10 (1258)

followed by (or not if the list is empty)

  generating payload of type PROPOSAL_SUBSTRUCTURE

we now get

  generating rule 10 LIST of PROPOSAL_SUBSTRUCTURE

in the debug log.
2024-10-02 10:08:51 +02:00
Tobias Brunner
2ec6d50a3c parser: Make debug log for payload substructure rules more clear
Instead of this

  parsing rule 10 (1258)

we now see this

  parsing rule 10 LIST of PROPOSAL_SUBSTRUCTURE

in the debug log. Particularly useful if the list is empty as there won't
be a message like this following it:

  x bytes left, parsing recursively PROPOSAL_SUBSTRUCTURE
2024-10-02 10:07:36 +02:00
Tobias Brunner
be0af46d89 Merge branch 'tun-device-ipv6'
Adds support for IPv6 addresses on TUN devices, in particular, to support
virtual IPv6 addresses on FreeBSD/macOS.

Closes strongswan/strongswan#2465
2024-09-25 16:12:49 +02:00
Tobias Brunner
bf165afb78 kernel-pfroute: Route via interface if we don't have a next hop
Compared to RTA_IFP, the format is different when passing an interface
as RTA_GATEWAY, it requires the interface's address and not its name.
2024-09-25 16:12:34 +02:00
Tobias Brunner
fccc76449d tun-device: Fix handling of IPv6 addresses
struct ifreq can't be used for IPv6 as the ifr_addr member is not large
enough.  Actually, configuring an IPv6 address via an AF_INET socket won't
work anyway.  And unfortunately, it's not standardized how IPv6 addresses
are installed, so we have to do this quite differently on Linux and on BSD.
However, we already use SIOCAIFADDR for IPv4 on newer FreeBSD systems,
which wasn't the case when this patch was originally created in 2014.
2024-09-25 15:45:32 +02:00
Tobias Brunner
74208e2cc3 Merge branch 'tkm-multi-ke'
Adds support for multiple key exchanges to charon-tkm.
2024-09-19 15:20:31 +02:00
Tobias Brunner
2b1885b892 testing: Add TKM scenarios with multiple key exchanges 2024-09-19 14:39:13 +02:00
Tobias Brunner
5a8f0767b8 charon-tkm: Add tests with multiple key exchanges 2024-09-19 14:39:13 +02:00
Stefan Berghofer
7975a0cfa4 charon-tkm: Adapt to interface changes to support multiple key exchanges
Also includes ESA flags.

Co-authored-by: Tobias Brunner <tobias@strongswan.org>
2024-09-19 14:39:13 +02:00
Tobias Brunner
301abbeaff Merge branch 'vici-reload-tasks'
Consider queued child-creating tasks when reloading configs that have
`start` as start action.  Besides some possible corner cases it fixes
handling IKE_SAs that are current getting established and have no
established CHILD_SAs yet.

Closes strongswan/strongswan#2418
2024-09-19 10:11:49 +02:00
Tobias Brunner
a4a3dcf6c2 vici-config: Consider queued tasks when terminating IKE/CHILD_SAs
This is particularly important for IKE_SAs that are not yet established,
which would get terminated as they have no established CHILD_SAs yet.

Fixes: 72f9a21b22e9 ("Merge branch 'vici-reload-actions'")
2024-09-18 11:53:17 +02:00
Tobias Brunner
961763b84d quick-mode: Allow "aborting" task if it's currently active
Basically the same as the previous commit.
2024-09-18 11:53:17 +02:00
Tobias Brunner
e81cf3bd36 child-create: Allow "aborting" task if it's currently active
We can't actually abort an active exchange, but we can delete the SA
immediately after its creation.
2024-09-18 11:53:17 +02:00
Tobias Brunner
cf3c90dba6 quick-mode: Add getter for child config 2024-09-18 11:53:17 +02:00
Tobias Brunner
04c9316db5 child-create: Add getter for child config 2024-09-18 11:53:17 +02:00
Tobias Brunner
9d4c7bebfc checksum: Avoid compiler warning/error when building monolithic
References strongswan/strongswan#2446
2024-09-18 11:49:35 +02:00
Tobias Brunner
decccd4f63 github: Update AWS-LC to 1.35.0 for tests 2024-09-18 08:49:52 +02:00
Thomas Egerer
cf7fb47788 array: Don't use realloc() with zero size in array_compress()
The behavior of realloc(3) with zero size was apparently implementation
defined.  While glibc documents the behavior as equivalent to free(3),
that might not apply to other C libraries.  With C17, this behavior has
been deprecated, and with C23, the behavior is now undefined.  It's also
why valgrind warns about this use.

Hence, when array_compress() would call realloc() with a zero size, we
now call free() explicitly and set the pointer to NULL.

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2024-09-12 08:53:26 +02:00
Andreas Steffen
957aae8f64 cert-enroll: Fixed typo
This typo prevented the cert-enroll script from successfully
signalling a detected change of the sub CA certificate.
2024-09-07 17:17:07 +02:00
Tobias Brunner
55a660d9f7 github: Use more verbose output for apt-get calls
With -qq we don't see any detailed error messages.
2024-09-05 10:59:20 +02:00