From patchwork Mon Sep 25 09:44:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Lichtenheld X-Patchwork-Id: 3367 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:fe0a:b0:d7:3b0f:3938 with SMTP id pz10csp1086195dyc; Mon, 25 Sep 2023 02:45:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHJWtSMmfOh1JEj/TVAv7GpCOICwYJ4coofIfY1ufjyO1u2d/HjVtWhXFGMMHmC3HbwQZdt X-Received: by 2002:a05:6870:c105:b0:1d6:790f:2007 with SMTP id f5-20020a056870c10500b001d6790f2007mr5525705oad.4.1695635143603; Mon, 25 Sep 2023 02:45:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695635143; cv=none; d=google.com; s=arc-20160816; b=JGcWBZ1rELdlyX0t8YSNctj2/HqPRt/eBt7yA19ti9ObOgIofoyAefXUJmyp1GLJPl xZOIMjFEGVvY979uQLntOGyHXYt3PfF93Fn+SHzRG85GupNKFBhDak/aaYOFRABzIVCL NNEQ0XcmMEjCQElgUAq8w2VVkVCqAjp3Uasa5uP15JCX2p+AO4+J4BcpBQoy2kCbJCof vasdUzT1BOxtCnHZkMyr+5fLPriRVZ36QSf6/jTRzIK4e4QcTjpjax5FnBEFp1ynh972 LU3k1X0EWjaZEvOJ1n1IHlMSQebQC8sSd6O6HuU8yXSttSHHBCOtYI8P8vNTFFZsZpdy ZtlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:content-transfer-encoding:cc:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=IKpsz0FmXZjkw3YF7UIeGKfkILhMB1YJ+67CxaQKk20=; fh=H6mFs2pVe2/avHEN3ZXlblBRMUbfPBnqHVZOzcm8npI=; b=TI2H6yh5zJyZ11Zl+koh2h/xA08PKNTHLUIyG8s9FmnGqav2jGzfuGmC8z+1TpnRkY gay8vobBt02pzNt4/Gpp0TxF0p8jVfOsccK+n6ooF7lX0NgUJgBYVbqOX+mspK1aHnYv oAYwF+N7uMpfoxkUySzOCf4kl69ED4g3Wicg+NvAEq/JKO9ls6pueSOdwI8A5WxqaQOT kXY4nvUH07vnU/fJzPOiruhMQ51ePZqfaRcyHnnGnx7GWSknYxy2KQUd+BGPKgel2aXq +HmoYZ5L+JnOykV3M/fy0ODCF6yfBgRNZMjY2PcRaOouOasrJ/JJpzGuXXyPLWUnwCLf Zv1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=EYwxPe8r; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=QHOFeMmK; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=C0kpBCB9; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id n5-20020a63f805000000b00577bf1de778si9610640pgh.585.2023.09.25.02.45.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Sep 2023 02:45:43 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=EYwxPe8r; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=QHOFeMmK; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=C0kpBCB9; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1qki8w-0000qi-Kg; Mon, 25 Sep 2023 09:44:42 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qki8q-0000qH-VL for openvpn-devel@lists.sourceforge.net; Mon, 25 Sep 2023 09:44:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=WUfmpfEzriM59XcYQG+ShXZNPGUAfgMlz802fpIUy7Y=; b=EYwxPe8rZN+Bjvq/eQAYwMMOP8 Epacnu072vTjAfEV6qZwJIWUnnitr03+5sW6AVGHNBZmcK9YjiAQ3LH43sVgM3XSi5yqAmJLEXUQ+ AZmq/UHx0iorsaM1H3v1hRN9orl57VKRocKdQl+gzBWxYri/Ho0sfNvmQ3UNgFaQXvok=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=WUfmpfEzriM59XcYQG+ShXZNPGUAfgMlz802fpIUy7Y=; b=QHOFeMmKL2GYYGORfRma8X+9rR VPHJibhN2mCZwi49Fj7h7MKgN44G0XYBkx4R1ABrNsxKor84cQPVtAcefTznr51yAqJthuEbco7Iz i8GFw7vYsXaQY1nGBFs4YuQpBhMVYf5Whi8iy0erRIPEUlKz98ZVC22DlCz6yNyE64I8=; Received: from mout-p-103.mailbox.org ([80.241.56.161]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1qki8d-005j9z-Vp for openvpn-devel@lists.sourceforge.net; Mon, 25 Sep 2023 09:44:34 +0000 Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-103.mailbox.org (Postfix) with ESMTPS id 4RvHyN4fqmz9sdT; Mon, 25 Sep 2023 11:44:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lichtenheld.com; s=MBO0001; t=1695635052; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WUfmpfEzriM59XcYQG+ShXZNPGUAfgMlz802fpIUy7Y=; b=C0kpBCB9lvlSgJuvu17Rz2PzzySzXn37B17AgGvAaV6tawMVccwjeBJNGvkFzosKdhMqBi FQrgJ5ZIFBGYWyPWlbhX81d2yhWhZsgDd5CcE6IgH7cO4GkqKAxdkaRt4t6OkI1t+OiENa na6L5Fk+8+pYVD1oU2A4iWKvQVN98yVfd8w2tZHKa9l0OKBWR6UubJfDqW5yYzm663odZ8 tLIw7aL3T1xZ3Cw7JLCXz16cOYLN7ObdyQfNheGeJM6lIdQe4NOX4iilie2jRUJEjKsKI2 vKexMEqpADJdVopmGpz8+/QxYuheguuAGBvRd0X2smKFY7YLqGv/pw9k8CMctQ== From: Frank Lichtenheld To: openvpn-devel@lists.sourceforge.net Date: Mon, 25 Sep 2023 11:44:09 +0200 Message-Id: <20230925094409.40429-1-frank@lichtenheld.com> In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 4RvHyN4fqmz9sdT X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Arne Schwabe 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. Content analysis details: (-0.9 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [80.241.56.161 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-Headers-End: 1qki8d-005j9z-Vp Subject: [Openvpn-devel] [PATCH] Mock openvpn_exece on win32 also for test_tls_crypt X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Hund Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1778002316020531907?= X-GMAIL-MSGID: =?utf-8?q?1778002316020531907?= From: Arne Schwabe 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) --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to release/2.6. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/313 This mail reflects revision 2 of this Change. Acked-by according to Gerrit (reflected above): Heiko Hund diff --git a/tests/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/Makefile.am @@ -77,7 +77,7 @@ pkt_testdriver_CFLAGS = @TEST_CFLAGS@ \ -I$(top_srcdir)/include -I$(top_srcdir)/src/compat -I$(top_srcdir)/src/openvpn pkt_testdriver_LDFLAGS = @TEST_LDFLAGS@ -pkt_testdriver_SOURCES = test_pkt.c mock_msg.c mock_msg.h \ +pkt_testdriver_SOURCES = test_pkt.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 \ @@ -104,6 +104,7 @@ -Wl,--wrap=parse_line \ -Wl,--wrap=rand_bytes tls_crypt_testdriver_SOURCES = 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_tests/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 unsigned 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 unsigned int flags) -{ - ASSERT(0); -} -#endif - struct test_pkt_context { struct tls_auth_standalone tas_tls_auth; struct tls_auth_standalone tas_crypt;