From: "plaisthos (Code Review)" Date: Sat, 7 Oct 2023 10:25:01 +0000 In-Reply-To: References: Reply-To: arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="nmTqvxb6WAg="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: Add warning if a p2p NCP client connects to a p2mp server List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld Cc: openvpn-devel --nmTqvxb6WAg= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, plaisthos. Hello flichtenheld, I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/323?usp=3Demail to look at the new patch set (#2). The following approvals got outdated and were removed: Code-Review-1 by flichtenheld Change subject: Add warning if a p2p NCP client connects to a p2mp server ...................................................................... Add warning if a p2p NCP client connects to a p2mp server Change-Id: I85ae4e1167e1395b4f59d5d0ecf6c38befcaa8a7 --- M src/openvpn/multi.c M src/openvpn/ssl_ncp.c M src/openvpn/ssl_ncp.h 3 files changed, 13 insertions(+), 4 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/23/323/2 diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index 0d4e6f9..c38aa67 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -1811,6 +1811,15 @@ return false; } + /* Print a warning if we detect the client being in P2P mode and will + * not accept our pushed ciphers */ + if (extract_iv_proto(peer_info) & IV_PROTO_NCP_P2P) + { + msg(M_WARN, "Note: peer reports running in P2P mode (no --pull/--c= lient" + "option). It will not negotiate ciphers with this server. " + "Expect this connection to fail."); + } + if (proto & IV_PROTO_REQUEST_PUSH) { c->c2.push_request_received =3D true; diff --git a/src/openvpn/ssl_ncp.c b/src/openvpn/ssl_ncp.c index dafaef1..0ca6d42 100644 --- a/src/openvpn/ssl_ncp.c +++ b/src/openvpn/ssl_ncp.c @@ -24,7 +24,7 @@ */ /** - * @file Control Channel SSL/Data dynamic negotion Module + * @file Control Channel SSL/Data dynamic negotiation Module * This file is split from ssl.c to be able to unit test it. */ @@ -258,8 +258,8 @@ const char *peer_ncp_list =3D tls_peer_ncp_list(peer_info, &gc_tmp); - /* non-NCP client without OCC? "assume nothing" */ - /* For client doing the newer version of NCP (that send IV_CIPHER) + /* non-NCP clients without OCC? "assume nothing" */ + /* For client doing the newer version of NCP (that send IV_CIPHERS) * we cannot assume that they will accept remote_cipher */ if (remote_cipher =3D=3D NULL || (peer_info && strstr(peer_info, "IV_CIPHERS=3D"))) diff --git a/src/openvpn/ssl_ncp.h b/src/openvpn/ssl_ncp.h index d27ed24..de7a0e4 100644 --- a/src/openvpn/ssl_ncp.h +++ b/src/openvpn/ssl_ncp.h @@ -23,7 +23,7 @@ */ /** - * @file Control Channel SSL/Data dynamic negotion Module + * @file Control Channel SSL/Data dynamic negotiation Module * This file is split from ssl.h to be able to unit test it. */ -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/323?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I85ae4e1167e1395b4f59d5d0ecf6c38befcaa8a7 Gerrit-Change-Number: 323 Gerrit-PatchSet: 2 Gerrit-Owner: plaisthos Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-MessageType: newpatchset --nmTqvxb6WAg= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, plaisthos.

plaisthos uploaded patch set #2 to this change.

<= a href=3D"http://gerrit.openvpn.net/c/openvpn/+/323?usp=3Demail">View Chang= e

The following approvals got outdated and were removed: Code-Review-1 by flichtenheld

Add warning if a p2p NCP client connects to a=
 p2mp server

Change-Id: I85ae4e1167e1395b4f59d5d0ecf6c38befcaa8a7---
M src/openvpn/multi.c
M src/openvpn/ssl_ncp.c
M src/openvpn/s= sl_ncp.h
3 files changed, 13 insertions(+), 4 deletions(-)

=
git=
 pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/23/323/2
= diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c
inde= x 0d4e6f9..c38aa67 100644
--- a/src/openvpn/multi.c<= br>+++ b/src/openvpn/multi.c
@@ -1811,6 +1811,15 @@
return false;
}

+ /* Print a w= arning if we detect the client being in P2P mode and will
+ * not accept our pushed ciphers = */
+ if (extract_i= v_proto(peer_info) & IV_PROTO_NCP_P2P)
+ {
+ msg(M_WARN, "Note: peer reports running in P2P mode (= no --pull/--client"
+ "option). It will not negotiate ciphers with this ser= ver. "
+ = "Expect this connection to fail.");
+ }
+
if (proto & IV_PROTO_REQUEST_PUSH= )
{
c->c2.push_request_rec= eived =3D true;
diff --git a/src/openvpn/ssl_ncp.c b/src/op= envpn/ssl_ncp.c
index dafaef1..0ca6d42 100644
--- a/src/openvpn/ssl_ncp.c
+++ b/src/openvpn/ssl_ncp.c<= /span>
@@ -24,7 +24,7 @@
*/

/**
- * = @file Control Channel SSL/Data dynamic negotion Module
+ * @file Control Channel SSL/Data dynami= c negotiation Module
* This file is split from ssl.c to b= e able to unit test it.
*/

@@ -258,8 +258,8 @@


const char *= peer_ncp_list =3D tls_peer_ncp_list(peer_info, &gc_tmp);

- /* non-NCP cli= ent without OCC? "assume nothing" */
- /* For client doing the newer version of NCP = (that send IV_CIPHER)
+ /* non-NCP clients without OCC? "assume nothing" */=
+ /* For client doing th= e newer version of NCP (that send IV_CIPHERS)
* we ca= nnot assume that they will accept remote_cipher */
if = (remote_cipher =3D=3D NULL
|| (peer_info &&= ; strstr(peer_info, "IV_CIPHERS=3D")))
diff --git= a/src/openvpn/ssl_ncp.h b/src/openvpn/ssl_ncp.h
index d27e= d24..de7a0e4 100644
--- a/src/openvpn/ssl_ncp.h
<= span>+++ b/src/openvpn/ssl_ncp.h
@@ -23,7 +23,7 @@ */

/**
- * @file Control Channel SSL/Data dynamic n= egotion Module
+ * @f= ile Control Channel SSL/Data dynamic negotiation Module
*= This file is split from ssl.h to be able to unit test it.
= */


To view, visit <= a href=3D"http://gerrit.openvpn.net/c/openvpn/+/323?usp=3Demail">change 323= . To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I85ae4e1167e1395b4f59d5d0ecf= 6c38befcaa8a7
Gerrit-Change-Number: 323
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-MessageType: newpatchset
--nmTqvxb6WAg=--