Enable TCP non-linear packet ID
PATCH v2 1/1 Enable TCP non-linear packet ID
In reply to a message not in the archiveImplementation with multiple threads needs that to be able run encryption in parallel. Tested with James' OpenVPN 3 server.
--- src/openvpn/comp.c | 1 + src/openvpn/init.c | 1 - src/openvpn/options.c | 5 ----- src/openvpn/packet_id.c | 7 +++---- src/openvpn/packet_id.h | 2 +- src/openvpn/ssl.c | 3 +-- 6 files changed, 6 insertions(+), 13 deletions(-)
src/openvpn/comp.c +1 -0
@@ -160,6 +160,7 @@ comp_generate_peer_info_string(const struct compress_options *opt, struct bufferbuf_printf (out,"IV_LZO_STUB=1\n" );buf_printf (out,"IV_COMP_STUB=1\n" );buf_printf (out,"IV_COMP_STUBv2=1\n" ); +buf_printf (out,"IV_TCPNL=1\n" ); } }
src/openvpn/init.c +0 -1
@@ -2143,7 +2143,6 @@ do_init_crypto_static (struct context *c, const unsigned int flags)if (options->replay) {packet_id_init (&c->c2.crypto_options.packet_id, -link_socket_proto_connection_oriented (options->ce.proto), options->replay_window, options->replay_time,"STATIC" ,0 );
src/openvpn/options.c +0 -5
@@ -2215,11 +2215,6 @@ options_postprocess_verify_ce (const struct options *options, const struct conne/* * Check consistency of replay options */ -if ((!proto_is_udp (ce->proto)) - && (options->replay_window != defaults.replay_window - || options->replay_time != defaults.replay_time)) -msg (M_USAGE ,"--replay-window only makes sense with --proto udp" ); -if (!options->replay && (options->replay_window != defaults.replay_window || options->replay_time != defaults.replay_time))
src/openvpn/packet_id.c +3 -4
@@ -76,10 +76,9 @@ packet_id_debug (int msglevel, }void -packet_id_init (struct packet_id *p,bool tcp_mode,int seq_backtrack,int time_backtrack,const char *name,int unit) +packet_id_init (struct packet_id *p,int seq_backtrack,int time_backtrack,const char *name,int unit) { -dmsg (D_PID_DEBUG ,"PID packet_id_init tcp_mode=%d seq_backtrack=%d time_backtrack=%d" , - tcp_mode, +dmsg (D_PID_DEBUG ,"PID packet_id_init seq_backtrack=%d time_backtrack=%d" , seq_backtrack, time_backtrack);
@@ -88,7 +87,7 @@ packet_id_init (struct packet_id *p, bool tcp_mode, int seq_backtrack, int time_ p->rec.name = name; p->rec.unit = unit; -if (seq_backtrack && !tcp_mode) +if (seq_backtrack) {ASSERT (MIN_SEQ_BACKTRACK <= seq_backtrack && seq_backtrack <=MAX_SEQ_BACKTRACK );ASSERT (MIN_TIME_BACKTRACK <= time_backtrack && time_backtrack <=MAX_TIME_BACKTRACK );
src/openvpn/packet_id.h +1 -1
@@ -210,7 +210,7 @@ struct packet_idstruct packet_id_rec rec; }; -void packet_id_init (struct packet_id *p,bool tcp_mode,int seq_backtrack,int time_backtrack,const char *name,int unit); +void packet_id_init (struct packet_id *p,int seq_backtrack,int time_backtrack,const char *name,int unit);void packet_id_free (struct packet_id *p);/* should we accept an incoming packet id ? */
src/openvpn/ssl.c +1 -2
@@ -799,7 +799,7 @@ key_state_init (struct tls_session *session, struct key_state *ks)/* init packet ID tracker */ if (session->opt->replay) { -packet_id_init (&ks->crypto_options.packet_id, session->opt->tcp_mode, +packet_id_init (&ks->crypto_options.packet_id, session->opt->replay_window, session->opt->replay_time,"SSL" , ks->key_id); }
@@ -948,7 +948,6 @@ tls_session_init (struct tls_multi *multi, struct tls_session *session)/* initialize packet ID replay window for --tls-auth */ packet_id_init (&session->tls_auth.packet_id, - session->opt->tcp_mode, session->opt->replay_window, session->opt->replay_time,"TLS_AUTH" , session->key_id);
Signature · 1 line
2.8.4 (Apple Git-73)
ACK.
Amazingly simple - "just remove all notion of TCP in the packet ID code".
Your patch has been applied to the master branch.
I have fixed a small whitespace error in comp.c.
commit 55755e6ee56516c96525e6bf313c173653af1a4b
Author: Arne Schwabe Date: Sat Sep 17 16:15:38 2016 +0200
Enable TCP non-linear packet ID
Acked-by: Gert Doering <[email protected]...>
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg12513.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering