18508 Commits

Author SHA1 Message Date
Andreas Steffen
3c552ac156 oqs: Support of Falcon signature algorithms 2022-10-04 09:49:04 +02:00
Andreas Steffen
4fdd9ba509 oqs: Complete post-quantum signature support 2022-10-04 09:49:04 +02:00
Andreas Steffen
cac2f84a9c ntru: Removed legacy NTRU key exchange method 2022-10-04 09:49:04 +02:00
Andreas Steffen
24d8854675 newhope: Removed legacy Newhope key exchange method 2022-10-04 09:49:04 +02:00
Andreas Steffen
c243b0b74b bliss: Removed legacy BLISS signatures 2022-10-04 09:49:04 +02:00
Andreas Steffen
e7bb08b379 oqs: Added signature tests 2022-10-04 09:49:04 +02:00
Andreas Steffen
7fde5b7459 scripts: Added nist_sig_kat script 2022-10-04 09:49:04 +02:00
Andreas Steffen
3b4d4193f5 oqs: Postponed freeing of kem object 2022-10-04 09:49:04 +02:00
Andreas Steffen
004d28a970 oqs: Support of Dilithium signature algorithms 2022-10-04 09:49:04 +02:00
Andreas Steffen
da47a6485e oqs: Update to NIST round 3 KEM candidates 2022-10-04 09:49:03 +02:00
Andreas Steffen
d33b977964 oqs: Removed BIKE round 1 version including test vectors 2022-10-04 09:49:03 +02:00
Andreas Steffen
5c884d97be testing: Added ikev2/rw-cert-qske scenario 2022-10-04 09:49:03 +02:00
Andreas Steffen
ef4c81adcc wip: ikev2: Change multi-KE codepoints for testing 2022-10-04 09:49:03 +02:00
Andreas Steffen
e38530501d frodo: FrodoKEM KE method 2022-10-04 09:49:03 +02:00
Andreas Steffen
0d46bd0ef3 oqs: Added post-quantum KEM methods based on liboqs 2022-10-04 09:49:03 +02:00
Andreas Steffen
ecba48f147 nist_kem_kat: Added script formating NIST KEM KAT records into ke_test vectors 2022-10-04 09:49:03 +02:00
Andreas Steffen
a5538e150c test-vectors: Added NIST KEM test vectors 2022-10-04 09:49:03 +02:00
Andreas Steffen
9572d31531 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.
2022-10-04 09:49:03 +02:00
Andreas Steffen
34bf42c400 key-exchange: Added NIST round 2 submission KEM candidates 2022-10-04 09:49:03 +02:00
Tobias Brunner
c0d16298ef unit-tests: Ensure listeners can track SAs via ike/child_updown/rekey()
Previously, it could happen that child_rekey() was triggered twice for
the same "old" SA.  For listeners that would mean they'd loose track as
they'd be tracking a new SA that wasn't relevant anymore and for which
no updown event would ever get triggered (it was the redundant SA in a
collision).  This new assert ensures that events are triggered in a
predictable way and listeners can track SAs properly.
2022-10-04 09:49:03 +02:00
Tobias Brunner
d0d2336b1b ikev2: Make CHILD_SAs properly trackable during rekey collisions
As the winner of a rekey collision, we previously always triggered the
child_rekey() event once when creating the redundant SA on behalf of the
peer in the passive child-rekey task and then a second time when
creating the winning SA in the active task.  However, both calls passed
the replaced CHILD_SA as "old". This made tracking CHILD_SAs impossible
because there was no transition from the redundant, "new" SA of the
first event to the "new", winning SA of the second.  Of course, when the
second event was triggered, the redundant SA might not have existed
anymore because the peer is expected to delete it, which could happen
before the CREATE_CHILD_SA response arrives at the initiator.

This refactoring ensures that the child_rekey() event is triggered in
a way that makes the CHILD_SAs trackable in all reasonable (and even
some unreasonable) scenarios.  The event is generally only triggered
once after installing the outbound SA for the new/winning CHILD_SA.
This can be when processing the CREATE_CHILD_SA in the active child-rekey
task, or when processing the DELETE for the old SA in a passive
child-delete task.  There are some cases where the event is still
triggered twice, but it is now ensured that listeners can properly
transition to the winning SA.

Some corner cases are now also handled correctly, e.g. if a responder's
DELETE for the new CHILD_SA arrives before its CREATE_CHILD_SA response
that actually creates it on the initiator.  Also handled properly are
responders of rekeyings that incorrectly send a DELETE for the old
CHILD_SA (previously this caused both, the new and the old SA, to get
deleted).
2022-10-04 09:49:03 +02:00
Tobias Brunner
dfedc558fb wip: ike-init: Indicate support for IKE_INTERMEDIATE
wip: We should also add some checks if the notify was not received.
2022-10-04 09:49:03 +02:00
Tobias Brunner
4661c27b74 proposal: Prevent selection of duplicate key exchange methods
All additional (and the initial) key exchanges must use a different method.
2022-10-04 09:49:03 +02:00
Tobias Brunner
6592280f2c proposal: Add helper to check if additional key exchanges are contained 2022-10-04 09:49:03 +02:00
Tobias Brunner
4e6a46ccd0 proposal: Accept NONE for additional key exchanges also for IKE proposals 2022-10-04 09:49:03 +02:00
Tobias Brunner
3eca38cc79 unit-tests: Add tests for CHILD_SA rekeying with multiple key exchanges 2022-10-04 09:49:03 +02:00
Tobias Brunner
7ca2ddd0c4 unit-tests: Add tests for CHILD_SA creation with multiple key exchanges 2022-10-04 09:49:03 +02:00
Tobias Brunner
bc4e7c90d6 unit-tests: Tests for additional key exchanges 2022-10-04 09:49:03 +02:00
Tobias Brunner
f8d856b851 unit-tests: Support multiple proposals in exchange tests 2022-10-04 09:49:03 +02:00
Andreas Steffen
63a01f6190 vici: Increase maximum proposal length 2022-10-04 09:49:03 +02:00
Andreas Steffen
5bed7b1868 vici: List additional key exchanges
Co-authored-by: Tobias Brunner <tobias@strongswan.org>
2022-10-04 09:49:03 +02:00
Tobias Brunner
2f63a36ade proposal: Add prefix for additional key exchanges when logging proposals 2022-10-04 09:49:03 +02:00
Tobias Brunner
49fd5f136e key-exchange: Add dynamic parser for additional key exchange methods 2022-10-04 09:49:03 +02:00
Tobias Brunner
4832be01ae child-rekey: Support CHILD_SA rekeying with multiple key exchanges 2022-10-04 09:49:03 +02:00
Tobias Brunner
32e08ddb17 unit-tests: Fix CHILD_SA rekey tests after INVALID_KE_PAYLOAD handling changes
The responder doesn't create a CHILD_SA and allocate an SPI anymore
when responding with an INVALID_KE_PAYLOAD notify.
2022-10-04 09:49:03 +02:00
Tobias Brunner
abce9feb6a child-create: Add support for multiple key exchanges
It also changes that payloads are built before installing the CHILD_SA on
the responder, that is, the KE payload is generated before keys are derived,
so that key_exchange_t::get_public_key() is called before get_shared_secret(),
or it's internal equivalent, which could be relevant for KE implementations
that want to ensure that the key can't be used again after the key
derivation.
2022-10-04 09:49:03 +02:00
Tobias Brunner
d3da7b1fdd ike-rekey: Support IKE_SA rekeying with multiple key exchanges 2022-10-04 09:49:02 +02:00
Tobias Brunner
d68cd46478 ike-init: Add support for multiple key exchanges
Initially, this is handled with a key derivation for each
IKE_INTERMEDIATE exchange.  When rekeying the keys are derived only when
all IKE_FOLLOWUP_KE exchanges are done.
2022-10-04 09:49:02 +02:00
Tobias Brunner
930d82783d bus: Support multiple key exchanges in ike/child_keys() events 2022-10-04 09:49:02 +02:00
Tobias Brunner
3bbc2d6aca keymat_v2: Support key derivation with multiple key exchanges 2022-10-04 09:49:02 +02:00
Tobias Brunner
20e6dc0665 key-exchange: Add helper to concatenate shared secrets of several key exchanges 2022-10-04 09:49:02 +02:00
Tobias Brunner
e9771db66f keymat_v2: Proper cleanup if derive_ike_keys() is called multiple times 2022-10-04 09:49:02 +02:00
Tobias Brunner
cf0a861678 ike-auth: Calculate and collect IntAuth for IKE_INTERMEDIATE exchanges
The message ID of the first IKE_AUTH exchange is a safe-guard against
potential truncation attacks if IKE_INTERMEDIATE exchanges are not used
for multiple key exchanges but some other future use where the number of
exchanges might not depend on the selected proposal.
2022-10-04 09:49:02 +02:00
Tobias Brunner
cd3d8d2040 pubkey-authenticator: Handle IntAuth data 2022-10-04 09:49:02 +02:00
Tobias Brunner
17773226ce psk-authenticator: Handle IntAuth data 2022-10-04 09:49:02 +02:00
Tobias Brunner
b2aa035fc6 eap-authenticator: Handle IntAuth data 2022-10-04 09:49:02 +02:00
Tobias Brunner
8a7910522c keymat_v2: Include optional IntAuth in signed octets 2022-10-04 09:49:02 +02:00
Tobias Brunner
69d5c3fade authenticator: Add optional method to set IntAuth data 2022-10-04 09:49:02 +02:00
Tobias Brunner
d9f3527519 message: Store original encrypted payload when generating fragments
If we don't do this, get_plain() will fail after generating the message
fragmented.
2022-10-04 09:49:02 +02:00
Tobias Brunner
d290c54362 message: Add method to generate data to authenticate IKE_INTERMEDIATE exchanges 2022-10-04 09:49:02 +02:00