Stateless three-way handshake and control channel improvements
Status from this message: NACK, compile error.
Get series with b4
b4 am [email protected]...Versions newest first
Patches in v1
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/28 | Remove tls_init_control_channel_frame_parameters wrapper functionsrc/ src/ src/ | +6 | 1 reply | |
| 2/28 | Remove dead PID_TEST codesrc/ src/ src/ | +0 | 1 reply | |
| 3/28 | Move pre decrypt lite check to its own functionsrc/ | +15 | 7 replies | |
| 4/28 | Add documentation for swap_hmac functionsrc/ | +18 | 3 replies | |
| 5/28 | Extend tls_pre_decrypt_lite to return type of packet and keep statesrc/ src/ src/ | +99 | 1 reply | |
| 6/28 | Move ssl function related to control channel wrap/unwrap to ssl_pkt.c/hsrc/ src/ src/ +9 more | +600 | 1 reply | |
| 7/28 | Add unit tests for test_tls_decrypt_litetests/ tests/ | +370 | 1 reply | |
| 8/28 | Split out reliable_ack_parse from reliable_ack_readsrc/ src/ src/ | +56 | 2 replies | |
| 9/28 | Remove inc_pid argument from reliable_mark_deleted that is always truesrc/ src/ src/ | +4 | 1 reply | |
| 10/28 | Remove EXPONENTIAL_BACKOFF definesrc/ src/ | +0 | 1 reply | |
| 11/28 | Refactor tls-auth/tls-crypt wrapping into into own functionsrc/ | +50 | 2 replies | |
| 12/28 | Extract session_move_pre_start as own function, use local buffer variablesrc/ | +50 | 2 replies | |
| 13/28 | Change FULL_SYNC macro to no_pending_reliable_packets functionsrc/ | +57 | 1 reply | |
| 14/28 | Move tls_process_state into its own functionsrc/ | +228 | 3 replies | |
| 15/28 | Remove pointless indentation from tls_process.src/ | +27 | 2 replies | |
| 16/28 | Move CRL reload to key_state_init from S_START transitionsrc/ | +11 | 4 replies | |
| 17/28 | Implement constructing a control channel reset client as standalone fucntionsrc/ src/ src/ +2 more | +149 | 2 replies | |
| 18/28 | Implement stateless, HMAC basedsesssion id three way handshakedoc/ src/ src/ +8 more | +542 | 4 replies | |
| 19/28 | Make buf_write_u8/16/32 take the type they pretend to takesrc/ | +6 | 2 replies | |
| 20/28 | Change reliable_get_buf_sequenced to reliable_get_entry_sequencedsrc/ src/ src/ | +10 | 3 replies | |
| 21/28 | Extract read_incoming_tls_ciphertext into functionsrc/ | +33 | 2 replies | |
| 22/28 | Implement HMAC based session id for tls-crypt v2Changes.rst doc/ doc/ +10 more | +333 | 15 replies | |
| 23/28 | Optimise three-way handshake condition for S_PRE_START to S_STARTsrc/ tests/ | +9 | 2 replies | |
| 24/28 | Extract read_incoming_tls_plaintext into its own functionsrc/ | +23 | 4 replies | |
| 25/28 | Ensure that control channel packet are respecting tls-mtusrc/ src/ src/ +4 more | +229 | 4 replies | |
| 26/28 | Allow setting control channel packet size with tls-mtuChanges.rst doc/ src/ +5 more | +57 | 6 replies | |
| 27/28 | Add unit test for reliable_get_num_output_sequenced_availabletests/ tests/ tests/ | +69 | 1 reply | |
| 28/28 | Always include ACKs for the last seen control packetssrc/ src/ src/ +3 more | +125 | 1 reply |
Reviews trailers per patch
23 of 28 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Gert Doering | Frank Lichtenheld | Antonio Quartulli |
|---|---|---|---|
| Series | A-b | ||
| 1/28 | A-b | ||
| 2/28 | A-b | ||
| 3/28 | A-b | ||
| 4/28 | A-b | ||
| 5/28 | A-b | ||
| 6/28 | A-b | ||
| 7/28 | A-b | ||
| 8/28 | A-b | ||
| 9/28 | A-b | ||
| 10/28 | A-b | ||
| 11/28 | A-b | ||
| 12/28 | A-b | ||
| 13/28 | |||
| 14/28 | A-b | ||
| 15/28 | A-b | ||
| 16/28 | A-b | ||
| 17/28 | |||
| 18/28 | A-b | ||
| 19/28 | A-b | ||
| 20/28 | A-b | ||
| 21/28 | Ack-By | ||
| 22/28 | A-b A-b | A-b | |
| 23/28 | A-b | ||
| 24/28 | A-b | ||
| 25/28 | |||
| 26/28 | |||
| 27/28 | A-b | ||
| 28/28 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [Openvpn-devel] [PATCH 00/28] Stateless three-way handshake and control channel improvements
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 session on the server side leading to poential ressource exhaustian
- make the server respond with 3 answers trying to get an ACK for its answer making it a amplification
This patch series intends to solve this problem and since the patches revolve a lot around control channel behaviour, I discovered and fixed a number of other weaknesses in the control channel implementation:
- Implementing an HMAC based scheme to offer a stateless three way handshake for the server that avoids the previous mentioned problems.
- Restricting control channel packet size is now possible without breaking the protocol (--tls-mtu)
- Server and client will now always repeat previous ACKs to avoid the peer resending a packet if an ACK is gone missing. (Similar to what cumulative ACKs in other protocols achieve).
Arne Schwabe (28):
Remove tls_init_control_channel_frame_parameters wrapper function Remove dead PID_TEST code
Move pre decrypt lite check to its own function
Add documentation for swap_hmac function
Extend tls_pre_decrypt_lite to return type of packet and keep state Move ssl function related to control channel wrap/unwrap to
ssl_pkt.c/h
Add unit tests for test_tls_decrypt_lite
Split out reliable_ack_parse from reliable_ack_read
Remove inc_pid argument from reliable_mark_deleted that is always true Remove EXPONENTIAL_BACKOFF define
Refactor tls-auth/tls-crypt wrapping into into own function Extract session_move_pre_start as own function, use local buffer
variable
Change FULL_SYNC macro to no_pending_reliable_packets function Move tls_process_state into its own function
Remove pointless indentation from tls_process.
Move CRL reload to key_state_init from S_START transition Implement constructing a control channel reset client as standalone
fucntion
Implement stateless, HMAC basedsesssion id three way handshake Make buf_write_u8/16/32 take the type they pretend to take Change reliable_get_buf_sequenced to reliable_get_entry_sequenced Extract read_incoming_tls_ciphertext into function Implement HMAC based session id for tls-crypt v2
Optimise three-way handshake condition for S_PRE_START to S_START Extract read_incoming_tls_plaintext into its own function Ensure that control channel packet are respecting tls-mtu Allow setting control channel packet size with tls-mtu
Add unit test for reliable_get_num_output_sequenced_available Always include ACKs for the last seen control packets
Changes.rst | 16 + doc/doxygen/doc_protocol_overview.h | 2 + doc/man-sections/link-options.rst | 7 + doc/man-sections/tls-options.rst | 14 + doc/tls-crypt-v2.txt | 41 + src/openvpn/Makefile.am | 1 + src/openvpn/buffer.h | 13 +- src/openvpn/crypto.h | 8 + src/openvpn/init.c | 28 +- src/openvpn/mtu.h | 5 + src/openvpn/mudp.c | 164 ++- src/openvpn/multi.h | 3 + src/openvpn/openvpn.h | 6 + src/openvpn/openvpn.vcxproj | 2 + src/openvpn/openvpn.vcxproj.filters | 3 + src/openvpn/options.c | 27 + src/openvpn/options.h | 4 + src/openvpn/packet_id.c | 56 - src/openvpn/packet_id.h | 25 +- src/openvpn/reliable.c | 209 +++- src/openvpn/reliable.h | 84 +- src/openvpn/ssl.c | 1312 ++++++++++---------- src/openvpn/ssl.h | 97 +- src/openvpn/ssl_backend.h | 8 +- src/openvpn/ssl_common.h | 1 + src/openvpn/ssl_mbedtls.c | 19 +- src/openvpn/ssl_mbedtls.h | 4 + src/openvpn/ssl_openssl.c | 22 +- src/openvpn/ssl_openssl.h | 7 + src/openvpn/ssl_pkt.c | 549 ++++++++ src/openvpn/ssl_pkt.h | 295 +++++ tests/unit_tests/openvpn/Makefile.am | 29 +- tests/unit_tests/openvpn/mock_get_random.c | 10 + tests/unit_tests/openvpn/test_packet_id.c | 90 ++ tests/unit_tests/openvpn/test_pkt.c | 620 +++++++++ 35 files changed, 2825 insertions(+), 956 deletions(-) create mode 100644 src/openvpn/ssl_pkt.c create mode 100644 src/openvpn/ssl_pkt.h create mode 100644 tests/unit_tests/openvpn/test_pkt.c
Signature · 1 line
2.32.0 (Apple Git-132)