CVSROOT: /cvs Module name: src Changes by: st...@cvs.openbsd.org 2021/03/21 12:13:59
Modified files: sys/net : wg_noise.c Log message: wg(4): fix race between tx/rx handshakes, from Matt Dunwoodie, ok mpi@ "There is a race between sending/receiving handshake packets. This occurs if we consume an initiation, then send an initiation prior to replying to the consumed initiation. In particular, when consuming an initiation, we don't generate the index until creating the response (which is incorrect). If we attempt to create an initiation between these processes, we drop any outstanding handshake which in this case has index 0 as set when consuming the initiation. The fix attached is to generate the index when consuming the initiation so that any spurious initiation creation can drop a valid index. The patch also consolidates setting fields on the handshake."