From patchwork Fri Jul 21 13:55:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "plaisthos (Code Review)" X-Patchwork-Id: 3297 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:14c5:b0:d7:3b0f:3938 with SMTP id g5csp89077dyh; Fri, 21 Jul 2023 06:56:54 -0700 (PDT) X-Google-Smtp-Source: APBJJlHot2sKhAMzKjNLXvJXANf6Xt/mM8DegLJ+mYnNa5Ysdg0ppAngoBgxQ8fnktPYppkNqgBK X-Received: by 2002:a05:6a20:7f8f:b0:10b:bf2d:71bb with SMTP id d15-20020a056a207f8f00b0010bbf2d71bbmr3296520pzj.27.1689947814247; Fri, 21 Jul 2023 06:56:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689947814; cv=none; d=google.com; s=arc-20160816; b=F8CSmjJKw3VKx9YaS6t6Z2WjrSfJ1X8wteLUy8ZH6wpCXRRRch/d2D1t5DRR7pPZ8J NBwdvRH2SrxFUIsPA3au+yHbNUXkndNBGexwHL0qhYBMEbJBINvP5Oq6UgBmEbD41LIK phxtCIO1IPyZwz3NRzWHXcvu3uxGUYCD4gZZBSgXcFl5Q0ra4T6vRvLszpAgGsphKEJn yB+884BVpNeKRhFNtLcgYmvDUMpyL99LO654OBGUxsTxwht7S74buFacAmazzmQ16waM eEo4M7YGHGbw9bkAtAxSQo6jYuphyu+CXAbfF/ySzn9nqG3dI2IbjFkI7RphL19xuUCd 1EqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:cc:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:user-agent :mime-version:message-id:references:auto-submitted:date:from :dkim-signature:dkim-signature:dkim-signature; bh=/YsGIrXJR7F10+UhoCTKVJutZrLLGnAAsMDO4AwPaTQ=; fh=xS7EertazuZidIdoLZrk6dO7TG/RuSpuF6WQZp229lM=; b=WzIaqOFqB2gzvjaNhXniu1H6McHiXBzZeU9lCUkWd+OI+kSvwT6dLgK0o5ZVs+CtYi kBC97yVhLMhIcqDqQJv/3bSWtvhCjb67VCrxee82h1hfAzLDI564HAflaBdA1FxBAQw1 IHOB9FI/TAsF3CkVjIeJrAi7GtIVku7JZ4pUrFt1jpzRrHL+OoIJPcOoIWPK2kK9AgXA q/W4uSSoWTIsEYhptY7Px7L30Qvj0yq/PCergx4sUrMLGOhZNQdPmbILDJHW3VmQXfA5 qd4nquHWYAUlreGipWRbQ7eyizVEJZJu5khwIdisaXoz4/+Iyyj4/ZlFH3wfOClgEj1e /pZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=BSJ+o1FB; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=OkzbenqB; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=HHyvrEMd; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvpn.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id k6-20020a056a00134600b006543a5c8fb7si3253045pfu.286.2023.07.21.06.56.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Jul 2023 06:56:54 -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=BSJ+o1FB; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=OkzbenqB; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=HHyvrEMd; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvpn.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 1qMqbw-0004pl-Qi; Fri, 21 Jul 2023 13:55:59 +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 1qMqbv-0004pP-7K for openvpn-devel@lists.sourceforge.net; Fri, 21 Jul 2023 13:55:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Content-Transfer-Encoding:MIME-Version :Message-ID:Reply-To:References:Subject:List-Unsubscribe:List-Id:Cc:Date:From :Sender:To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help: List-Subscribe:List-Post:List-Owner:List-Archive; bh=6HQimjLuP0SdTdD3rnGh9HPwCqTVplHaUDkkg4GDFWw=; b=BSJ+o1FBbo4cZY1C1fWMhIM1Uv YTmo8OvXDfa+L98f1bVgsRahISEAEhhW39U8QDmxkwHha7pPvxsbStW7raKaRQtACgH0g3tdIoAse 3zydFPUONnzfkqpMvWK0T3h3WASL/GHl0yiK0IfJe7p6+DCE9mXy8WicKvjdP5/XKMBA=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Reply-To: References:Subject:List-Unsubscribe:List-Id:Cc:Date:From:Sender:To:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help:List-Subscribe:List-Post: List-Owner:List-Archive; bh=6HQimjLuP0SdTdD3rnGh9HPwCqTVplHaUDkkg4GDFWw=; b=O kzbenqBrVt0exwqluADZNeXBEi0u8XR43S102nc83lnEa3Cf8fKROrb+UMdev4FQAOgEXStINUppV lYo2rQHHccI7H40cAv+HeyJhmBI6+5uW+Swt5nZ3HgDqtth95WnM53x8UaA6UtiFPELOTN5FLiLG7 Uq/z8N68rX3SCLrI=; Received: from mail-wm1-f50.google.com ([209.85.128.50]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1qMqbn-00FJgR-Jo for openvpn-devel@lists.sourceforge.net; Fri, 21 Jul 2023 13:55:58 +0000 Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-3fbc5d5746cso17283045e9.2 for ; Fri, 21 Jul 2023 06:55:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1689947745; x=1690552545; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:date:from:from:to:cc :subject:date:message-id:reply-to; bh=6HQimjLuP0SdTdD3rnGh9HPwCqTVplHaUDkkg4GDFWw=; b=HHyvrEMddYqM5lJPTLzfDwcePfeu1BI/hqvdoV2g/9V7HeJ/KjbrUILa5hyzjbt8pG yEoiYS+bp0bdZmj53YckoA3750PsycNtvdYOMK8xEJ3o2vu+Y0PLrRA5L6GzIAiP7dCG +VCKUbmbF/dHNgOWB5TfJOR7Q2+Fy/a63Wm2SYKHd5Uqy8izdUWbHaBU5wNUslkr4laC N64xPwDq+E687UDeLka/0YyORY8bPqQoKFADV5ulZIpcyvc+Yc62hsa4NeE5LvX88o5j ZJ6Zu3xcBgS4TXIWNl5DuSZ1bARgyaGYSAuny2NLBAnfHdf4fsdtdgHAT+b2bSR+FXrB /nVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689947745; x=1690552545; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6HQimjLuP0SdTdD3rnGh9HPwCqTVplHaUDkkg4GDFWw=; b=RYebGem8HKxmbXSWuYHubmtkLRSJ2tJBHosHu8KEnjV5XDN5+qo7II9fVy6dKtw/o5 V1V7wreymSDHSNZ0MM4W3fxvmgn5tGSU5zMa/PQ/YrCgS0L2VqZiEKA0x/gWqTTjmXvS zIxZU9MovJgRfBcYN824ybvuVkxRbII6LJl9RsssA1d7bkdDVoVZhhx+ayk19RybPlj0 p2x8WskZqhnBpOKFoCmKQOsE1YA+34u/PfLPQ+0U0SjE2ccgttaWH7pCOBFzm8TeA+rs uKammNYUW8QYfkP8+p6qDXKfkI/JNoPD4A/AOHlvNcvWc0jccds5FnJlrLiBLtnCHVQY 5plQ== X-Gm-Message-State: ABy/qLabhlT+CRzJf4nRv/KpsDMvQYHfXWzbKSuOpWVcoMH90Hh2YHZM TUQ6vDDhI6/bww28KRAE48smd9xA/L7d7xPGtI4= X-Received: by 2002:a1c:4b17:0:b0:3f9:846:d892 with SMTP id y23-20020a1c4b17000000b003f90846d892mr1499515wma.9.1689947745140; Fri, 21 Jul 2023 06:55:45 -0700 (PDT) Received: from gerrit.openvpn.in (ec2-18-159-0-78.eu-central-1.compute.amazonaws.com. [18.159.0.78]) by smtp.gmail.com with ESMTPSA id c22-20020a05600c0ad600b003fa98908014sm6113800wmr.8.2023.07.21.06.55.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jul 2023 06:55:44 -0700 (PDT) From: "flichtenheld (Code Review)" X-Google-Original-From: "flichtenheld (Code Review)" X-Gerrit-PatchSet: 1 Date: Fri, 21 Jul 2023 13:55:43 +0000 Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: I8c8fe298eb30e211279f3fc010584b9d3bc14b4a X-Gerrit-Change-Number: 313 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: ccabffde4b482f20f0d9365849d831685ce55010 References: Message-ID: <155134cb806730d3745f10042a4ee6fee9c9bac0-HTML@gerrit.openvpn.net> MIME-Version: 1.0 User-Agent: Gerrit/3.8.0 X-Spam-Score: 1.0 (+) 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: Attention is currently required from: plaisthos. flichtenheld has uploaded this change for review. ( http://gerrit.openvpn.net/c/openvpn/+/313?usp=email ) Change subject: Mock openvpn_exece on win32 also for test_tls_crypt Content analysis details: (1.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.128.50 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.128.50 listed in list.dnswl.org] 1.2 MISSING_HEADERS Missing To: header -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 WEIRD_PORT URI: Uses non-standard port number for HTTP 0.0 HTML_MESSAGE BODY: HTML included in message -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 T_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML X-Headers-End: 1qMqbn-00FJgR-Jo Subject: [Openvpn-devel] [S] Change in openvpn[release/2.6]: 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: , Reply-To: frank@lichtenheld.com, arne-openvpn@rfc2549.org, openvpn-devel@lists.sourceforge.net Cc: plaisthos , openvpn-devel Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1772038719406441077?= X-GMAIL-MSGID: =?utf-8?q?1772038719406441077?= Attention is currently required from: plaisthos. flichtenheld has uploaded this change for review. ( http://gerrit.openvpn.net/c/openvpn/+/313?usp=email ) 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: Frank Lichtenheld (cherry picked from commit ede590e57c96c2b16d9bf462c4b1dd967b37c432) --- 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/1 diff --git a/tests/unit_tests/openvpn/Makefile.am b/tests/unit_tests/openvpn/Makefile.am index 650126c..6244b69 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;