18326 Commits

Author SHA1 Message Date
Tobias Brunner
8047b9becb message: Store original encrypted payload when generating fragments
If we don't do this, get_plain() will fail after generating the message
fragmented.
2022-04-29 09:51:27 +02:00
Tobias Brunner
351aefa891 ikev2: Delay IKE key derivation until next message
In particular as responder, this delays costly cryptographic operations
until the IKE_AUTH (or the next IKE_INTERMEDIATE) request is received,
which is preferable to reduce the impact of DoS attacks.

Another advantage is that the key material is not changed until all tasks
built or processed a message so e.g. IntAuth can be calculated with the
current keys without issues.
2022-04-29 09:51:27 +02:00
Andreas Steffen
ab94c31cda vici: Increase maximum proposal length 2022-04-29 09:51:27 +02:00
Andreas Steffen
042ecac221 oqs: Updated Falcon sig tests to liboqs-0.5.0 2022-04-29 09:51:27 +02:00
Andreas Steffen
2e5abed9c6 oqs: Upgraded Dilithium to NIST Round 3.1 2022-04-29 09:51:27 +02:00
Andreas Steffen
37c153b52a test-vectors: No changes for Saber KE NIST Round 3 tests 2022-04-29 09:51:27 +02:00
Andreas Steffen
374217628e oqs: Support for HQC key exchange algorithm 2022-04-29 09:51:27 +02:00
Andreas Steffen
f10d73c7bb test-vectors: Upgraded Kyber KE tests to NIST Round 3 2022-04-29 09:51:27 +02:00
Andreas Steffen
2c3e7b31f3 test-vectors: Upgraded NTRU KE tests to NIST Round 3 2022-04-29 09:51:27 +02:00
Andreas Steffen
2f3c4fac25 scripts: Fixed NIST KAT scripts 2022-04-29 09:51:27 +02:00
Andreas Steffen
42b5b5fd55 oqs: Support of Falcon signature algorithms 2022-04-29 09:51:27 +02:00
Andreas Steffen
80b898c425 oqs: Complete post-quantum signature support 2022-04-29 09:51:27 +02:00
Andreas Steffen
a89f380cf1 ntru: Removed legacy NTRU key exchange method 2022-04-29 09:51:27 +02:00
Andreas Steffen
5b99043bed newhope: Removed legacy Newhope key exchange method 2022-04-29 09:51:27 +02:00
Andreas Steffen
143c438171 bliss: Removed legacy BLISS signatures 2022-04-29 09:51:27 +02:00
Andreas Steffen
1942281d3c oqs: Added signature tests 2022-04-29 09:51:27 +02:00
Andreas Steffen
eaa8ee5a1f scripts: Added nist_sig_kat script 2022-04-29 09:51:27 +02:00
Andreas Steffen
d8ab5fe793 oqs: Postponed freeing of kem object 2022-04-29 09:51:27 +02:00
Andreas Steffen
62761b129e oqs: Support of Dilithium signature algorithms 2022-04-29 09:51:27 +02:00
Andreas Steffen
6762e6c447 oqs: Update to NIST round 3 KEM candidates 2022-04-29 09:51:27 +02:00
Andreas Steffen
1bd6dae7e4 oqs: Removed BIKE round 1 version including test vectors 2022-04-29 08:46:33 +02:00
Andreas Steffen
4d4fb385c4 testing: Added ikev2/rw-cert-qske scenario 2022-04-29 08:46:33 +02:00
Andreas Steffen
e62d5a8019 wip: ikev2: Change multi-KE codepoints for testing 2022-04-29 08:46:33 +02:00
Andreas Steffen
f812c05356 vici: List additional key exchanges
Co-authored-by: Tobias Brunner <tobias@strongswan.org>
2022-04-29 08:46:33 +02:00
Andreas Steffen
0fea978b6f frodo: FrodoKEM KE method 2022-04-29 08:46:33 +02:00
Andreas Steffen
4ca41de368 oqs: Added post-quantum KEM methods based on liboqs 2022-04-29 08:46:33 +02:00
Andreas Steffen
75669fdad1 nist_kem_kat: Added script formating NIST KEM KAT records into ke_test vectors 2022-04-29 08:46:33 +02:00
Andreas Steffen
29ddfb1dcd test-vectors: Added NIST KEM test vectors 2022-04-29 08:46:33 +02:00
Andreas Steffen
2e12f165e1 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-04-29 08:46:33 +02:00
Andreas Steffen
84e799a636 key-exchange: Added NIST round 2 submission KEM candidates 2022-04-29 08:46:33 +02:00
Tobias Brunner
97242c1bb7 wip: ike-init: Indicate support for IKE_INTERMEDIATE
wip: Not strictly necessary. I guess we should also add some checks if
the notify was not received.
2022-04-29 08:46:33 +02:00
Tobias Brunner
5607099a93 proposal: Prevent selection of duplicate key exchange methods
All additional (and the initial) key exchanges must use a different method.
2022-04-29 08:46:33 +02:00
Tobias Brunner
b16c608d1d proposal: Add helper to check if additional key exchanges are contained 2022-04-29 08:46:33 +02:00
Tobias Brunner
44da32336d proposal: Accept NONE for additional key exchanges also for IKE proposals 2022-04-29 08:46:33 +02:00
Tobias Brunner
cd82b93ecc unit-tests: Add tests for CHILD_SA rekeying with multiple key exchanges 2022-04-29 08:46:33 +02:00
Tobias Brunner
90aa732f30 unit-tests: Add tests for CHILD_SA creation with multiple key exchanges 2022-04-29 08:46:33 +02:00
Tobias Brunner
969fdf4651 unit-tests: Tests for additional key exchanges 2022-04-29 08:46:32 +02:00
Tobias Brunner
86ce787241 unit-tests: Support multiple proposals in exchange tests 2022-04-29 08:46:32 +02:00
Tobias Brunner
80d731076f proposal: Add prefix for additional key exchanges when logging proposals 2022-04-29 08:46:32 +02:00
Tobias Brunner
49a98334a4 key-exchange: Add dynamic parser for additional key exchange methods 2022-04-29 08:46:32 +02:00
Tobias Brunner
50465e81c1 child-rekey: Support CHILD_SA rekeying with multiple key exchanges 2022-04-29 08:46:32 +02:00
Tobias Brunner
bae9f3a242 child-sa: Cache and forward actual initiator flag for outbound SA
Kernel interfaces (e.g. TKM) might rely on this flag to be correct.
2022-04-29 08:46:32 +02:00
Tobias Brunner
fb580ed663 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-04-29 08:46:32 +02:00
Tobias Brunner
3112a9c09a 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-04-29 08:46:32 +02:00
Tobias Brunner
f0331fb94d ike-rekey: Support IKE_SA rekeying with multiple key exchanges 2022-04-29 08:46:32 +02:00
Tobias Brunner
5597263edc ikev2: Send deletes also for rekeyed SAs
This way we can use the IKE_REKEYED state for both redundant and old SAs
to suppress ike_updown().

In the ike-delete task we don't suppress events in state IKE_REKEYING as
that's the case when we delete an SA the peer is currently rekeying with
multiple key exchanges.
2022-04-29 08:46:32 +02:00
Tobias Brunner
48213c5d45 ikev2: Let ike/child-rekey tasks indicate if the passive task was adopted
This gives us more flexibility with tasks that return NEED_MORE (currently
none of the colliding tasks do, but that will change with multi-KE
rekeyings).  The active task has to check itself if the passive task is
done and should be removed from the task manager.
2022-04-29 08:46:32 +02:00
Tobias Brunner
aaa28b967b ike-rekey: Remove collision task type checks
Since f67199378df9 ("ike-rekey: Handle undetected collisions also if
delete is delayed") we only ever track tasks of type TASK_IKE_REKEY, so
there is no need to check the type or use the generic task_t interface.

Also changed some of the comments to clarify collision handling.
2022-04-29 08:46:32 +02:00
Tobias Brunner
462cad0b8b ike-rekey: Don't actively rekey already rekeyed SAs
If the peer successfully rekeyed the SA it gets marked as IKE_REKEYED
and it remains until the peer deletes it (or a timeout).  There is no
point in rekeying such SAs again.

IKE_REKEYING will be relevant if we have multi-KE rekeyings and are
waiting for followup key exchanges for a passive rekeying.
2022-04-29 08:46:32 +02:00
Tobias Brunner
d7b3617d74 ike-init: Ignore COOKIE payloads during rekeying
This ensures that process_i() only returns NEED_MORE due to multiple
key exchanges or an INVALID_KE_PAYLOAD notify.
2022-04-29 08:46:32 +02:00