19194 Commits

Author SHA1 Message Date
Tobias Brunner
e69e7c86e7 Merge commit 'default-plugins'
Changes the default crypto plugins from the built-in ones to openssl.
2024-11-22 14:17:17 +01:00
Andreas Steffen
6735c3d7ca Define new default plugins 2024-11-22 14:14:53 +01:00
Andreas Steffen
558529afe2 testing: Migrated wolfssl scenarios 2024-11-22 14:14:53 +01:00
Andreas Steffen
2e4c062512 testing: Migrated tnc scenarios to new default plugins 2024-11-22 14:14:53 +01:00
Andreas Steffen
11bb0a73b8 testing: Migrated tkm scenarios to new default plugins 2024-11-22 14:14:53 +01:00
Andreas Steffen
89acb24bd7 testing: Migrated sql scenarios to new default plugins 2024-11-22 14:14:53 +01:00
Andreas Steffen
b891da52b4 testing: Migrated route-based scenarios to new default plugins 2024-11-22 14:14:53 +01:00
Andreas Steffen
8fc6340c05 testing: Migrated pfkey scenarios to new default plugins 2024-11-22 14:14:53 +01:00
Andreas Steffen
93b6162d74 testing: Migrated p2pnat scenarios to new default plugins 2024-11-22 14:14:53 +01:00
Andreas Steffen
bd93dfb09b testing: Migrated libipsec scenarios to new default plugins 2024-11-22 14:14:53 +01:00
Andreas Steffen
0cf08b45dd testing: Migrated ha scenarios to new default plugins 2024-11-22 14:14:53 +01:00
Andreas Steffen
dc69cf2f65 testing: Migrated gcrypt-ikev2 scenarios 2024-11-22 14:14:53 +01:00
Andreas Steffen
b9e5764b75 testing: Migrated botan scenarios 2024-11-22 14:14:53 +01:00
Andreas Steffen
17e0f20f57 testing: Migrated af-alg scenarios 2024-11-22 14:14:53 +01:00
Andreas Steffen
fdc9e69523 testing: Migrated ike scenarios to new default plugins 2024-11-22 14:14:53 +01:00
Andreas Steffen
6ae40ac581 testing: Migrated ikev1-stroke to new default plugins 2024-11-22 14:14:53 +01:00
Andreas Steffen
950d4fe7a0 testing: Migrated ikev2-stroke scenarios to new default plugins 2024-11-22 14:14:53 +01:00
Andreas Steffen
2dbcb15338 testing: Migrated ipv6-stroke scenarios to new default plugins 2024-11-22 14:14:53 +01:00
Andreas Steffen
38bacea63b testing: Migrated ipv6 scenarios to new default plugins 2024-11-22 14:14:52 +01:00
Andreas Steffen
e7166c342b testing: Distributed openssl-ikev1 scenarios 2024-11-22 14:14:52 +01:00
Andreas Steffen
c9883d612b testing: Migrated ikev1-algs scenarios to new default plugins 2024-11-22 14:14:52 +01:00
Andreas Steffen
8060541f53 testing: Migrated ikev1 scenarios to new default plugins 2024-11-22 14:14:52 +01:00
Andreas Steffen
4df94b56c0 testing: Distributed openssl-ikev2 scenarios 2024-11-22 14:14:52 +01:00
Andreas Steffen
f766a7ed49 testing: Migrated ikev2-algs scenarios to new default plugins 2024-11-22 14:14:52 +01:00
Andreas Steffen
2099a52618 testing: Migrated ikev2 scenarios to new default plugins 2024-11-22 14:14:52 +01:00
Tobias Brunner
9de4efb1ae ml: Store decoded public/private key and matrix A on initiator
While this does require quite a bit of memory, on initiators there are
usually fewer concurrent SAs getting created so this should be less of
an issue than on a gateway that handles lots of SAs as responder.

The speed up is about 30% on the initiator during the decapsulation,
while the key generation does take a bit more time (about 3%).
2024-11-22 14:14:10 +01:00
Tobias Brunner
89f4b345e3 ml: Add software implementation of ML-KEM
This follows FIPS 203 relatively closely but takes some ideas from the
reference implementation.  In particular, how to avoid potential
side-channels via direct C division/modulo operations.  However, it just
uses Barrett reduction (no Montgomery reduction) and no negative
coefficients to avoid number format conversions and keep the
implementation clearer.
2024-11-22 14:14:08 +01:00
Tobias Brunner
930381228b memory: Add helper function to conditionally copy data in constant time 2024-11-22 14:09:53 +01:00
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