]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Add warning if a p2p NCP client connects to a p2mp server
authorArne Schwabe <arne@rfc2549.org>
Mon, 9 Oct 2023 10:53:36 +0000 (12:53 +0200)
committerGert Doering <gert@greenie.muc.de>
Wed, 18 Oct 2023 10:00:29 +0000 (12:00 +0200)
Change-Id: I85ae4e1167e1395b4f59d5d0ecf6c38befcaa8a7
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Message-Id: <20231009105336.34267-1-frank@lichtenheld.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27191.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/multi.c
src/openvpn/ssl_ncp.c
src/openvpn/ssl_ncp.h

index 0d4e6f999fd961ab274fa7b4437e8decc34d05f0..8b490ed4af0f671737d8ed9728faec4c9bfac687 100644 (file)
@@ -1811,6 +1811,15 @@ multi_client_set_protocol_options(struct context *c)
         return false;
     }
 
+    /* Print a warning if we detect the client being in P2P mode and will
+     * not accept our pushed ciphers */
+    if (proto & 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 server. "
+            "Expect this connection to fail.");
+    }
+
     if (proto & IV_PROTO_REQUEST_PUSH)
     {
         c->c2.push_request_received = true;
index dafaef1232e5904b7c3755860232af7bbba92d5e..0ca6d42b90c5ccc9c59f841dc3a28c57d762dbbe 100644 (file)
@@ -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 @@ ncp_get_best_cipher(const char *server_list, const char *peer_info,
 
     const char *peer_ncp_list = 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 == NULL
         || (peer_info && strstr(peer_info, "IV_CIPHERS=")))
index d27ed2447fded6e1d4792cba1e3aa651d19afcf3..de7a0e44bf7d9eecacc3ba336919552f999ee2a0 100644 (file)
@@ -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.
  */