summaryrefslogtreecommitdiff
path: root/src/lib/tests/auth_test.c
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2026-01-22 23:11:58 +0100
committerSander Vrijders <sander@ouroboros.rocks>2026-01-23 08:30:11 +0100
commita5d9c04f821b72e27f196ff2015078f87d4d9a5e (patch)
treebcf765ce4cd55d6cc89f00405c6a250ce04054e0 /src/lib/tests/auth_test.c
parentfb1aeb3ffff2948edeb710e65aef261b589c7403 (diff)
downloadouroboros-a5d9c04f821b72e27f196ff2015078f87d4d9a5e.tar.gz
ouroboros-a5d9c04f821b72e27f196ff2015078f87d4d9a5e.zip
lib: Add automatic key rotation for encryption
Implement forward-secret key rotation using HKDF key derivation. The operation is based on QUIC RFC 9001 and wireguard. Keys rotate every 2^KEY_ROTATION_BIT packets, with the current phase (P) signaled via controlling a bit in the IV (bit 7, first bit on the wire). Default 20 (1M packets). The wire format, after the DT header is: [ P | random IV ][ encrypted blob ][ AEAD tag ] Works with and without retransmission, and the FRCT header is fully contained in the encrypted blob if used. The receiver detects phase changes and rotates accordingly, keeping the previous key valid during a grace period. This handles packet reordering in unreliable flows: the 3/4 period protection window prevents premature rotation when late packets arrive, while the 1/2 period grace window ensures the old key remains available for decryption. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/lib/tests/auth_test.c')
0 files changed, 0 insertions, 0 deletions