From patchwork Tue Jul 4 14:08:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 3272 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7301:3c07:b0:d9:b492:11d6 with SMTP id ki7csp5004596dyb; Tue, 4 Jul 2023 07:08:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7N4XvnjWIWZhyxfrLi6j/p212Uuk+5KGljbRsA2RBON4Ek+vx4sL47JeC2vWr59RXKmEXT X-Received: by 2002:a05:6808:3082:b0:3a3:6950:bb33 with SMTP id bl2-20020a056808308200b003a36950bb33mr11668060oib.16.1688479728022; Tue, 04 Jul 2023 07:08:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688479728; cv=none; d=google.com; s=arc-20160816; b=GOTdIijA5Lgd63I6zECggAq1x7xuY4gRBbcMyIfUjdtIk3323LEyMrQ6CRdHIdDNxo /Hz2ece/nqH5MIYLJOwrP4ortdg/QwDLiiXpKYcSVCX5KpzOglKvh8avP2ifsixjEeHV YTY0ZCGZJZ5oOIe8Lg/G1/D1VQaMahKI2b9wagysu11pN9pZF1aI3aGus1siivV/drE1 Eo0O1cvCLAXskUMjUgbhZ0iNu5KSqIDWkY0/exXQRabT5C8sQ4qImRO0tfS4bEZK2Lo7 lpI+wQmGFYhLDWLVeetZ2MKJEnFsIRlC5Q9Q2SsRz/yWKS+sDKI3o++EaU+DAtzw128k D5/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from:dkim-signature:dkim-signature; bh=VSG4gLfsO/dt8PDF4dUrK84qKM/EeDzyvMEpqL5tlBI=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=sO8ZdEIXTAByNubVr7k4JH4SOzH5EzfjZCTwrcZIDG+L31dgMBCMxyc/gsrtS5Rif3 f69A79pdSE2Tr7Y24B6VEPfpBl8UYmgEfGOrLRuzD19/n9jaM1nGZ9Qc8VLjCM0bZGEk Y+LOxz4aaWknSWGVIB/fvtwRoCZ0HIPHafBsfCCwfmdSN1uN1lkISAjF8YOSjgebJAwI 3ltZt0JfHj4mVRpmcevR59qZaJ7FA9FUzUkxknSN4+l+JbqqKq2Wznn1xU2i9+FjQA02 7szw9KFHe3Oswpe+9VTgX/rNh6wayrYtnnU76LZT47IKTlfxWm6hMoB2eeoUJJu97wpH H2rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=kKJfhTwB; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=eUAOClHy; 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 m14-20020a026a4e000000b0040fda8a725fsi7666579jaf.51.2023.07.04.07.08.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2023 07:08:47 -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=kKJfhTwB; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=eUAOClHy; 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 1qGghV-00008y-UG; Tue, 04 Jul 2023 14:08:17 +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 1qGghU-00008o-BQ for openvpn-devel@lists.sourceforge.net; Tue, 04 Jul 2023 14:08:16 +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:Message-Id: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=mfTCuDYFEEITkIs/W2tGxQJ5jUrrfWotvI/uXi4ldHU=; b=kKJfhTwBcU8peSibXJ7RvZYCGv MI41rROneAJqxQ2DPdGHt9GhOiVPo2omhsAOm/zv7/nv03/TgXlG4a1st9tgTCtqTKXCk5HevxGWH fejmPjTk0snkYDojsC12vcYIRcbk4PjqTUcFiAAP2GRBamqv5LBilWauR0di7N2XtirY=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:To:From: Sender:Reply-To:Cc:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=mfTCuDYFEEITkIs/W2tGxQJ5jUrrfWotvI/uXi4ldHU=; b=e UAOClHylj0WQUUcLl3pjd6NHZiGqYBNNGuuAcvg1s0kQAtPEFxZhNPO1jplxjR3Rv4jI36m/LCPXy frGTyD/sJOzaQuX6+1mzSLD99W1KDkEdg1JmABzvazm/EK7abUjG8xtPD6goXei1+aqdzoMBBUoc7 vrkWfjLN91FXM74Y=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1qGghT-005n0U-Ff for openvpn-devel@lists.sourceforge.net; Tue, 04 Jul 2023 14:08:16 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.95 (FreeBSD)) (envelope-from ) id 1qGghJ-0006WG-OQ for openvpn-devel@lists.sourceforge.net; Tue, 04 Jul 2023 16:08:05 +0200 Received: (nullmailer pid 3851374 invoked by uid 10006); Tue, 04 Jul 2023 14:08:05 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Tue, 4 Jul 2023 16:08:05 +0200 Message-Id: <20230704140805.3851328-1-arne@rfc2549.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Score: 0.2 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-2.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: 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. Change-Id: I8c8fe298eb30e211279f3fc010584b9d3bc14b4a Signed-off-by: Arne Schwabe --- CMakeLists.txt | 2 ++ tests/unit_tests/openvpn/mock_win32_execve.c | 37 ++++++++++++++++++++ tes [...] Content analysis details: (0.2 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Headers-End: 1qGghT-005n0U-Ff 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: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1770499319232890497?= X-GMAIL-MSGID: =?utf-8?q?1770499319232890497?= 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. Change-Id: I8c8fe298eb30e211279f3fc010584b9d3bc14b4a Signed-off-by: Arne Schwabe --- CMakeLists.txt | 2 ++ tests/unit_tests/openvpn/mock_win32_execve.c | 37 ++++++++++++++++++++ tests/unit_tests/openvpn/test_pkt.c | 8 ----- 3 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 tests/unit_tests/openvpn/mock_win32_execve.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 597dc9074..2d0cd5dd0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -679,6 +679,7 @@ if (BUILD_TESTING) ) target_sources(test_pkt PRIVATE + tests/unit_tests/openvpn/mock_win32_execve.c src/openvpn/argv.c src/openvpn/base64.c src/openvpn/crypto_mbedtls.c @@ -740,6 +741,7 @@ if (BUILD_TESTING) -Wl,--wrap=buffer_write_file -Wl,--wrap=rand_bytes) target_sources(test_tls_crypt PRIVATE + tests/unit_tests/openvpn/mock_win32_execve.c src/openvpn/argv.c src/openvpn/base64.c src/openvpn/crypto_mbedtls.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 000000000..4d37ebe33 --- /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 5a53f702e..9f49ee7bd 100644 --- a/tests/unit_tests/openvpn/test_pkt.c +++ b/tests/unit_tests/openvpn/test_pkt.c @@ -69,14 +69,6 @@ print_link_socket_actual(const struct link_socket_actual *act, struct gc_arena * 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;