]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Implement stateless HMAC-based sesssion-id three-way-handshake
authorArne Schwabe <arne@rfc2549.org>
Mon, 2 May 2022 15:43:10 +0000 (17:43 +0200)
committerGert Doering <gert@greenie.muc.de>
Thu, 5 May 2022 10:12:55 +0000 (12:12 +0200)
commitb364711486dc6371ad2659a5aa190941136f4f04
tree0c766020ff14f07d5041ae5cb34767a506e99ce6
parent870af5f54967821c72074a7c5c60e10a4561d95e
Implement stateless HMAC-based sesssion-id three-way-handshake

OpenVPN currently has a bit of a weakness in its early three way handshake

A single client reset packet (first packet of the handshake) will
  - trigger creating a session on the server side leading to potential
    ressource exhaustion
  - make the server respond with 3 answers trying to get an ACK for its
    P_CONTROL_HARD_RESET_SERVER_V2 answer making it an amplification

Instead of allocating a connection for each client on the initial packet
OpenVPN will now calculate a session id based on a HMAC that serves as
verifiable cookie that can be checked for authenticity when the client
responds with it. This eliminates the amplification attack and resource
exhaustion attacks.

For tls-crypt-v2 clients the HMAC based handshake is not used yet (will
be added in one of the next patches).

Patch v2: rebase on master
patch v3: fix unit tests, improve comment/style of code

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Message-Id: <20220502154310.836947-1-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg24262.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
doc/doxygen/doc_protocol_overview.h
src/openvpn/init.c
src/openvpn/mudp.c
src/openvpn/multi.h
src/openvpn/openvpn.h
src/openvpn/ssl.c
src/openvpn/ssl.h
src/openvpn/ssl_pkt.c
src/openvpn/ssl_pkt.h
tests/unit_tests/openvpn/test_pkt.c