From: "cron2 (Code Review)" Date: Mon, 25 Sep 2023 20:10:57 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., heiko@...515..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <3133f17ef22fe8df89fa80b3cdd7ce8f6390a0f6-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="lElnZaq9zw0="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[release/2.6]: Mock openvpn_exece on win32 also for test_tls_crypt List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld , d12fk Cc: openvpn-devel --lElnZaq9zw0= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#3) to the change originally created by= flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/313?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by d12fk Change subject: Mock openvpn_exece on win32 also for test_tls_crypt ...................................................................... Mock openvpn_exece on win32 also for test_tls_crypt This function is needed to commpile on win32 as run_command.c defines it on Unix Linux but on windows it is defined in win32.c which pulls in too many other unresolvable symbols. Patch v2: Also add mock_win32_execve.c to automake files Change-Id: I8c8fe298eb30e211279f3fc010584b9d3bc14b4a Signed-off-by: Arne Schwabe Acked-by: Heiko Hund Acked-by: Frank Lichtenheld (cherry picked from commit ede590e57c96c2b16d9bf462c4b1dd967b37c432) Message-Id: <20230925094409.40429-1-frank@...2641...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27= 097.html Signed-off-by: Gert Doering --- M tests/unit_tests/openvpn/Makefile.am A tests/unit_tests/openvpn/mock_win32_execve.c M tests/unit_tests/openvpn/test_pkt.c 3 files changed, 39 insertions(+), 9 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/13/313/3 diff --git a/tests/unit_tests/openvpn/Makefile.am b/tests/unit_tests/openvp= n/Makefile.am index 650126c..dd3985d 100644 --- a/tests/unit_tests/openvpn/Makefile.am +++ b/tests/unit_tests/openvpn/Makefile.am @@ -77,7 +77,7 @@ pkt_testdriver_CFLAGS =3D @TEST_CFLAGS@ \ -I$(top_srcdir)/include -I$(top_srcdir)/src/compat -I$(top_srcdir)/src/op= envpn pkt_testdriver_LDFLAGS =3D @TEST_LDFLAGS@ -pkt_testdriver_SOURCES =3D test_pkt.c mock_msg.c mock_msg.h \ +pkt_testdriver_SOURCES =3D test_pkt.c mock_msg.c mock_msg.h mock_win32_exe= cve.c \ $(top_srcdir)/src/openvpn/argv.c \ $(top_srcdir)/src/openvpn/base64.c \ $(top_srcdir)/src/openvpn/buffer.c \ @@ -104,6 +104,7 @@ -Wl,--wrap=3Dparse_line \ -Wl,--wrap=3Drand_bytes tls_crypt_testdriver_SOURCES =3D test_tls_crypt.c mock_msg.c mock_msg.h \ + mock_win32_execve.c \ $(top_srcdir)/src/openvpn/argv.c \ $(top_srcdir)/src/openvpn/base64.c \ $(top_srcdir)/src/openvpn/buffer.c \ diff --git a/tests/unit_tests/openvpn/mock_win32_execve.c b/tests/unit_test= s/openvpn/mock_win32_execve.c new file mode 100644 index 0000000..4d37ebe --- /dev/null +++ b/tests/unit_tests/openvpn/mock_win32_execve.c @@ -0,0 +1,37 @@ +/* + * OpenVPN -- An application to securely tunnel IP networks + * over a single TCP/UDP port, with support for SSL/TLS-based + * session authentication and key exchange, + * packet encryption, packet authentication, and + * packet compression. + * + * Copyright (C) 2023 OpenVPN Inc + * Copyright (C) 2023 Arne Schwabe + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include "config.h" +#include "syshead.h" + +#include "win32.h" + +#ifdef _WIN32 +int +openvpn_execve(const struct argv *a, const struct env_set *es, const unsig= ned int flags) +{ + ASSERT(0); +} +#endif diff --git a/tests/unit_tests/openvpn/test_pkt.c b/tests/unit_tests/openvpn= /test_pkt.c index 736f131..eb69829 100644 --- a/tests/unit_tests/openvpn/test_pkt.c +++ b/tests/unit_tests/openvpn/test_pkt.c @@ -71,14 +71,6 @@ return "dummy print_link_socket_actual from unit test"; } -#ifdef _WIN32 -int -openvpn_execve(const struct argv *a, const struct env_set *es, const unsig= ned int flags) -{ - ASSERT(0); -} -#endif - struct test_pkt_context { struct tls_auth_standalone tas_tls_auth; struct tls_auth_standalone tas_crypt; -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/313?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: release/2.6 Gerrit-Change-Id: I8c8fe298eb30e211279f3fc010584b9d3bc14b4a Gerrit-Change-Number: 313 Gerrit-PatchSet: 3 Gerrit-Owner: flichtenheld Gerrit-Reviewer: d12fk Gerrit-CC: openvpn-devel Gerrit-CC: plaisthos Gerrit-MessageType: newpatchset --lElnZaq9zw0= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #3 to the change originally cr= eated by flichtenheld.

View Change

The following approvals got outda= ted and were removed: Code-Review+2 by d12fk

Mock openvpn_exece on win32 also for test_tls_crypt<=
br>
This function is needed to commpile on win32 as run_command.c define= s it
on Unix Linux but on windows it is defined in win32.c which pulls i= n too
many other unresolvable symbols.

Patch v2: Also add mock_wi= n32_execve.c to automake files

Change-Id: I8c8fe298eb30e211279f3fc01= 0584b9d3bc14b4a
Signed-off-by: Arne Schwabe <arne@...1227...>
A= cked-by: Heiko Hund <heiko@...515...>
Acked-by: Frank Lichtenheld = <frank@...2641...>
(cherry picked from commit ede590e57c96c2b16d9b= f462c4b1dd967b37c432)
Message-Id: <20230925094409.40429-1-frank@...2375...= 41...>
URL: https://www.mail-archive.com/openvpn-devel@...1357...= rge.net/msg27097.html
Signed-off-by: Gert Doering <gert@...1296...>= ;
---
M tests/unit_tests/openvpn/Makefile.am
A tests/unit_tests/op= envpn/mock_win32_execve.c
M tests/unit_tests/openvpn/test_pkt.c
3 fil= es changed, 39 insertions(+), 9 deletions(-)

git pull ssh://gerri=
t.openvpn.net:29418/openvpn refs/changes/13/313/3
diff --git a/test=
s/unit_tests/openvpn/Makefile.am b/tests/unit_tests/openvpn/Makefile.am
index 650126c..dd3985d 100644
--- a/tests/unit= _tests/openvpn/Makefile.am
+++ b/tests/unit_tests/openvpn/M= akefile.am
@@ -77,7 +77,7 @@
pkt_testdrive= r_CFLAGS =3D @TEST_CFLAGS@ \
-I$(top_srcdir)/include -I$= (top_srcdir)/src/compat -I$(top_srcdir)/src/openvpn
pkt_te= stdriver_LDFLAGS =3D @TEST_LDFLAGS@
-pkt_testdriver_SOURCES =3D test_pkt.c mock_msg.c mock_msg.h \=
+pkt_testdriver_SOUR= CES =3D test_pkt.c mock_msg.c mock_msg.h mock_win32_execve.c \
$(top_srcdir)/src/openvpn/argv.c \

$(top_srcdir)/sr= c/openvpn/base64.c \
$(top_srcdir)/src/openvpn/buffer.c \=
@@ -104,6 +104,7 @@
-Wl,--wrap=3Dparse_l= ine \
-Wl,--wrap=3Drand_bytes
tls_crypt_= testdriver_SOURCES =3D test_tls_crypt.c mock_msg.c mock_msg.h \
<= span style=3D"color: hsl(120, 100%, 40%);">+ mock_win32_execve.c \ $(top_srcdir)/src/openvpn/argv.c \
$(top_srcdir= )/src/openvpn/base64.c \
$(top_srcdir)/src/openvpn/buffer= .c \
diff --git a/tests/unit_tests/openvpn/mock_win32_execv= e.c b/tests/unit_tests/openvpn/mock_win32_execve.c
new file= mode 100644
index 0000000..4d37ebe
--- /de= v/null
+++ b/tests/unit_tests/openvpn/mock_win32_execve.c
@@ -0,0 +1,37 @@
+/*
+ * O= penVPN -- An application to securely tunnel IP networks
+ * over a single TCP/UDP po= rt, with support for SSL/TLS-based
+ * session authentication and key exchange,
+ * packet en= cryption, packet authentication, and
+ * packet compression.
+ *
+ * Copyright (C) 2023 OpenVPN Inc <sales@...515...>=
+ * Copyright (C) 2= 023 Arne Schwabe <arne@...1227...>
+ *
+ *
+ * This prog= ram is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU G= eneral Public License version 2

+ * as published by the Free Software Foundation.
+ *

+ * This program is distributed in the hope that i= t will be useful,
+ *= but WITHOUT ANY WARRANTY; without even the implied warranty of
= + * MERCHANTABILITY or FITNESS= FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
= + *
+ * You should have received a copy of the GNU = General Public License along
+ * with this program; if not, write to the Free Software Foundati= on, Inc.,
+ * 51 Fra= nklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#= include "config.h"
+#include "syshead.h"
+
= +#include "win32.h"
+
+#ifdef _W= IN32
+int
<= span style=3D"color: hsl(120, 100%, 40%);">+openvpn_execve(const struct arg= v *a, const struct env_set *es, const unsigned int flags)
+{
+ ASSERT(0);
+}
+#en= dif
diff --git a/tests/unit_tests/openvpn/test_pkt.c b/test= s/unit_tests/openvpn/test_pkt.c
index 736f131..eb69829 1006= 44
--- a/tests/unit_tests/openvpn/test_pkt.c
+++ b/tests/unit_tests/openvpn/test_pkt.c
@@ -71,14 +71,6= @@
return "dummy print_link_socket_actual from u= nit test";
}

-#ifdef _WIN32
-int
-openvpn_execve(const struct argv *a, const struct env_set *es, const = unsigned int flags)
-{<= /span>
- ASSERT(0);<= br>-}
-#endif
-
struct test_pkt_context {
= struct tls_auth_standalone tas_tls_auth;
struct tls_a= uth_standalone tas_crypt;

To view, visi= t change = 313. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: release/2.6
Gerrit-Change-Id: I8c8fe298eb30e211279f3fc0105= 84b9d3bc14b4a
Gerrit-Change-Number: 313
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: d12fk <heiko@...515...>=
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-CC: plaisthos <arne-openvpn@...2639...= ..>
Gerrit-MessageType: newpatchset
--lElnZaq9zw0=--