Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only restart PQ if there was actually a previous handshake
There was a potential race condition in our PQ restart logic that could cause restart to be called erroneously before the initial handshake was performed. The decision on whether to restart PQ was done based on the time since last handshake, as reported by the wireguard interface. The problem was that wireguard will uses None to represent both the case where no handshake has been performed and the case where a connection has been rejected after 180 seconds, so our PQ restart logic would incorrectly trigger if there was a wg consolidation happening between PQ peer being added and a handshake happening. Now there's an additional timestamp in the PQ entity to help guide if PQ should be restarted
- Loading branch information