From patchwork Mon Oct 15 23:26:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Rozman X-Patchwork-Id: 554 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director7.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id oFOrLii9xVtlIAAAIUCqbw for ; Tue, 16 Oct 2018 06:27:52 -0400 Received: from proxy7.mail.iad3b.rsapps.net ([172.31.255.6]) by director7.mail.ord1d.rsapps.net with LMTP id 0GsLLCi9xVuWXQAAovjBpQ ; Tue, 16 Oct 2018 06:27:52 -0400 Received: from smtp2.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy7.mail.iad3b.rsapps.net with LMTP id UN87Jii9xVsyDQAAQkQ5tQ ; Tue, 16 Oct 2018 06:27:52 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp2.gate.iad3b.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=rozman.si; dmarc=fail (p=none; dis=none) header.from=rozman.si X-Suspicious-Flag: YES X-Classification-ID: 229a9528-d12e-11e8-b597-5254000fbace-1-1 Received: from [216.105.38.7] ([216.105.38.7:37682] helo=lists.sourceforge.net) by smtp2.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 32/4A-17031-72DB5CB5; Tue, 16 Oct 2018 06:27:52 -0400 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.90_1) (envelope-from ) id 1gCMYm-0007Mc-O1; Tue, 16 Oct 2018 10:26:44 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1gCMYl-0007MW-PZ for openvpn-devel@lists.sourceforge.net; Tue, 16 Oct 2018 10:26:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:Content-Type:MIME-Version :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: 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=6l7dNtk3/qfz4taEx4LQovzTqB76fbXEERvxCflPXUw=; b=OpcWjOvp7d+/nHT5PUT4pka5ye bw3oYoMmrR7Rx3ENr3SPFOudLuwdMaAFZ04vySW5Orc4XhrxSWL3dFBz2ceX9qe6Ov36WnKAMWzBl 64gcRjHqJUqlC3Dq5QM3I+JIHJ5d6OTmoLdcWZIXy+zn4W65niZivW0lO7n4g6oTeU1I=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: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=6l7dNtk3/qfz4taEx4LQovzTqB76fbXEERvxCflPXUw=; b=M+rDhlVfa+oPS0trR9fWoVoPaP Tua3ia5shByp/9/OAYgk1bu2yLM2QPO6u2EAuS/TzfXJmAKY6K4Oen8hgbA6/WWvB0uHv0e8v5bN6 PhbiGuNCMyKKWyL4ZmTQmjWcChrC4NO/Uz2w2bN1ZUM7nyrjhI8XPUNGnHE8OAp3WvUg=; Received: from pub5.amebis.si ([213.250.55.21]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) id 1gCMYi-002g1z-9i for openvpn-devel@lists.sourceforge.net; Tue, 16 Oct 2018 10:26:43 +0000 Received: from s0.selo.doma (unknown [213.250.22.160]) by pub5.amebis.si (Postfix) with ESMTPS id 9414D204B3 for ; Tue, 16 Oct 2018 12:26:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=rozman.si; s=default; t=1539685590; bh=1gF9xM488MkqCkTZJUAjeUuEXjgGXxI6M+/DZ7lNY0U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fL/SkWY2xaAnwWygeFK/rtMXCLTwbKP27Ez433UUm6J9IOHpXhhD5qtr/HsZhMSnP /Vx0iTy4TFGj/VNcX0DO/i0big2A25YcWBYyNvWJcBqDUfYyOscR2+1lvZI65EsR+d XVeQcJohCRiVbrM1nCW5tcmO9Ffnx6GdFEFbUyyg= Received: from s0.selo.doma ([127.0.0.1]) by s0.selo.doma with Microsoft SMTPSVC(10.0.14393.0); Tue, 16 Oct 2018 12:26:30 +0200 From: Simon Rozman To: openvpn-devel@lists.sourceforge.net Date: Tue, 16 Oct 2018 12:26:23 +0200 Message-Id: <20181016102627.18676-1-simon@rozman.si> X-Mailer: git-send-email 2.19.0.windows.1 In-Reply-To: <20181010192337.6984-1-simon@rozman.si> References: <20181010192337.6984-1-simon@rozman.si> MIME-Version: 1.0 X-OriginalArrivalTime: 16 Oct 2018 10:26:30.0121 (UTC) FILETIME=[B3E4C590:01D4653A] X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 SPF_PASS SPF: sender matches SPF record -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 X-Headers-End: 1gCMYi-002g1z-9i Subject: [Openvpn-devel] [PATCH 1/5] Set output name to libopenvpnmsica.dll in MSVC builds too 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 On MinGW builds, the Libtool produces libopenvpnmsica.dll. The MSVC properties were updated to match this. Acked-by: Jon Kunkee --- src/openvpnmsica/openvpnmsica.props | 4 +++- src/openvpnmsica/openvpnmsica_resources.rc | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/openvpnmsica/openvpnmsica.props b/src/openvpnmsica/openvpnmsica.props index 0e31bc4f..fa408296 100644 --- a/src/openvpnmsica/openvpnmsica.props +++ b/src/openvpnmsica/openvpnmsica.props @@ -2,7 +2,9 @@ - + + lib$(ProjectName) + ..\compat;$(TAP_WINDOWS_HOME)/include;%(AdditionalIncludeDirectories) diff --git a/src/openvpnmsica/openvpnmsica_resources.rc b/src/openvpnmsica/openvpnmsica_resources.rc index ce60b4a1..9e8069f4 100644 --- a/src/openvpnmsica/openvpnmsica_resources.rc +++ b/src/openvpnmsica/openvpnmsica_resources.rc @@ -50,7 +50,7 @@ BEGIN VALUE "FileVersion", PACKAGE_VERSION ".0" VALUE "InternalName", "OpenVPN" VALUE "LegalCopyright", "Copyright © The OpenVPN Project" - VALUE "OriginalFilename", "openvpnmsica.dll" + VALUE "OriginalFilename", "libopenvpnmsica.dll" VALUE "ProductName", "OpenVPN" VALUE "ProductVersion", PACKAGE_VERSION ".0" END From patchwork Mon Oct 15 23:26:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Rozman X-Patchwork-Id: 557 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director12.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id UGYiMSq9xVvCDQAAIUCqbw for ; Tue, 16 Oct 2018 06:27:54 -0400 Received: from proxy7.mail.iad3b.rsapps.net ([172.31.255.6]) by director12.mail.ord1d.rsapps.net with LMTP id qJSZLiq9xVuWdAAAIasKDg ; Tue, 16 Oct 2018 06:27:54 -0400 Received: from smtp21.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy7.mail.iad3b.rsapps.net with LMTP id CBCSKCq9xVseDQAAQkQ5tQ ; Tue, 16 Oct 2018 06:27:54 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp21.gate.iad3b.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=rozman.si; dmarc=fail (p=none; dis=none) header.from=rozman.si X-Suspicious-Flag: YES X-Classification-ID: 23b45a66-d12e-11e8-8e35-525400cdc90a-1-1 Received: from [216.105.38.7] ([216.105.38.7:32689] helo=lists.sourceforge.net) by smtp21.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 48/70-29799-92DB5CB5; Tue, 16 Oct 2018 06:27:54 -0400 Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1gCMYr-0006qu-Q4; Tue, 16 Oct 2018 10:26:49 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1gCMYq-0006qQ-BK for openvpn-devel@lists.sourceforge.net; Tue, 16 Oct 2018 10:26:48 +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=emB+S2+0lH9otGt6cMWq6y6UyZs0+oDqWDqg1HkXx1w=; b=MmCtAman5du7GQfAbC2Gm9lRYh ZZFHm6WGeRnTvVjobcYMOmDr9QzNLogBm5oA9PxF6alP+kFlwM0o44oRPqQGNsLRKcJLp/nAH9uOm b7LnvSz/CNoUWdmT+o3UT4aDIX/kUblnfTDzmzJqARMVWTr1552hSbP8EAPJgatfwn7E=; 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=emB+S2+0lH9otGt6cMWq6y6UyZs0+oDqWDqg1HkXx1w=; b=bD5le0mw2C3T7kzhbivyEU2Sip 04DGx2RVjoJP0IWRkbn/qrrGrQG4On/TDjuVL/+Jzsza96jnnxoRn2uEW8UNg8Wu7M4WoufVKxzH9 AZM/Dp3hMzGU+ZOS9SDiWIG2u9Ec090eKQYA9csSEm/lWLtsQ73/nFC9fq5f7/+RNhHE=; Received: from pub5.amebis.si ([213.250.55.21]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) id 1gCMYm-002cZB-HH for openvpn-devel@lists.sourceforge.net; Tue, 16 Oct 2018 10:26:48 +0000 Received: from s0.selo.doma (unknown [213.250.22.160]) by pub5.amebis.si (Postfix) with ESMTPS id 6A89220AA7 for ; Tue, 16 Oct 2018 12:26:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=rozman.si; s=default; t=1539685595; bh=b+CHJvD+NC0Ofcplbzg76o6tafDwn1WtdYWcncg9tyk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G5lxTaw3+mYeAHW4RC0mxseac2jdp1lB+4Ps+SlO3ssthXtgOC/l8nepRwg5AJRcD Kuw6+83dqsZffhtfDUPM5OR9CXRXevIsR28oN8j9YA5+SszL0+oiImmHDTimj19SI2 rOpTftDieZ0+3BanxTVVUXmEwTP1D4vZaCk4P0cU= Received: from s0.selo.doma ([127.0.0.1]) by s0.selo.doma with Microsoft SMTPSVC(10.0.14393.0); Tue, 16 Oct 2018 12:26:35 +0200 From: Simon Rozman To: openvpn-devel@lists.sourceforge.net Date: Tue, 16 Oct 2018 12:26:24 +0200 Message-Id: <20181016102627.18676-2-simon@rozman.si> X-Mailer: git-send-email 2.19.0.windows.1 In-Reply-To: <20181016102627.18676-1-simon@rozman.si> References: <20181010192337.6984-1-simon@rozman.si> <20181016102627.18676-1-simon@rozman.si> MIME-Version: 1.0 X-OriginalArrivalTime: 16 Oct 2018 10:26:35.0147 (UTC) FILETIME=[B6E3ADB0:01D4653A] X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 SPF_PASS SPF: sender matches SPF record -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 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1gCMYm-002cZB-HH Subject: [Openvpn-devel] [PATCH 2/5] Prevent __stdcall name mangling of MSVC 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 Using `extern "C" __declspec(dllexport) __stdcall`, Win32 MSVC compiler exports the functions are as `_name@N`. Exporting functions using `/EXPORT` linker flag allows us to specify exact function name. Note: The 64-bit MSVC compiler does not exhibit `__stdcall` name- mangling. Acked-by: Jon Kunkee --- src/openvpnmsica/openvpnmsica.c | 12 ++++++++++++ src/openvpnmsica/openvpnmsica.h | 14 +++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/openvpnmsica/openvpnmsica.c b/src/openvpnmsica/openvpnmsica.c index 82333991..3b90ce05 100644 --- a/src/openvpnmsica/openvpnmsica.c +++ b/src/openvpnmsica/openvpnmsica.c @@ -145,6 +145,10 @@ openvpnmsica_setup_sequence_filename( UINT __stdcall FindTAPInterfaces(_In_ MSIHANDLE hInstall) { +#ifdef _MSC_VER +#pragma comment(linker, DLLEXP_EXPORT) +#endif + #ifdef _DEBUG MessageBox(NULL, TEXT("Attach debugger!"), TEXT(__FUNCTION__) TEXT(" v") TEXT(PACKAGE_VERSION), MB_OK); #endif @@ -247,6 +251,10 @@ cleanup_CoInitialize: UINT __stdcall EvaluateTAPInterfaces(_In_ MSIHANDLE hInstall) { +#ifdef _MSC_VER +#pragma comment(linker, DLLEXP_EXPORT) +#endif + #ifdef _DEBUG MessageBox(NULL, TEXT("Attach debugger!"), TEXT(__FUNCTION__) TEXT(" v") TEXT(PACKAGE_VERSION), MB_OK); #endif @@ -505,6 +513,10 @@ cleanup_exec_seq: UINT __stdcall ProcessDeferredAction(_In_ MSIHANDLE hInstall) { +#ifdef _MSC_VER +#pragma comment(linker, DLLEXP_EXPORT) +#endif + #ifdef _DEBUG MessageBox(NULL, TEXT("Attach debugger!"), TEXT(__FUNCTION__) TEXT(" v") TEXT(PACKAGE_VERSION), MB_OK); #endif diff --git a/src/openvpnmsica/openvpnmsica.h b/src/openvpnmsica/openvpnmsica.h index 3a64fbaa..bb8e28ec 100644 --- a/src/openvpnmsica/openvpnmsica.h +++ b/src/openvpnmsica/openvpnmsica.h @@ -55,6 +55,14 @@ extern DWORD openvpnmsica_tlsidx_session; extern "C" { #endif +#ifdef __GNUC__ +#define DLLEXP_DECL __declspec(dllexport) +#else +#define DLLEXP_DECL +#define DLLEXP_EXPORT "/EXPORT:"__FUNCTION__"="__FUNCDNAME__ +#endif + + /** * Find existing TAP interfaces and set TAPINTERFACES property with semicolon delimited list * of installed TAP interface GUIDs. @@ -64,7 +72,7 @@ extern "C" { * @return ERROR_SUCCESS on success; An error code otherwise * See: https://msdn.microsoft.com/en-us/library/windows/desktop/aa368072.aspx */ -__declspec(dllexport) UINT __stdcall +DLLEXP_DECL UINT __stdcall FindTAPInterfaces(_In_ MSIHANDLE hInstall); @@ -77,7 +85,7 @@ FindTAPInterfaces(_In_ MSIHANDLE hInstall); * @return ERROR_SUCCESS on success; An error code otherwise * See: https://msdn.microsoft.com/en-us/library/windows/desktop/aa368072.aspx */ -__declspec(dllexport) UINT __stdcall +DLLEXP_DECL UINT __stdcall EvaluateTAPInterfaces(_In_ MSIHANDLE hInstall); @@ -89,7 +97,7 @@ EvaluateTAPInterfaces(_In_ MSIHANDLE hInstall); * @return ERROR_SUCCESS on success; An error code otherwise * See: https://msdn.microsoft.com/en-us/library/windows/desktop/aa368072.aspx */ -__declspec(dllexport) UINT __stdcall +DLLEXP_DECL UINT __stdcall ProcessDeferredAction(_In_ MSIHANDLE hInstall); #ifdef __cplusplus From patchwork Mon Oct 15 23:26:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Rozman X-Patchwork-Id: 558 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director7.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id sBbZNyq9xVupeAAAIUCqbw for ; Tue, 16 Oct 2018 06:27:54 -0400 Received: from proxy11.mail.iad3b.rsapps.net ([172.31.255.6]) by director7.mail.ord1d.rsapps.net with LMTP id YDQENSq9xVt7YgAAovjBpQ ; Tue, 16 Oct 2018 06:27:54 -0400 Received: from smtp16.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy11.mail.iad3b.rsapps.net with LMTP id qPkaLyq9xVuNIQAARNREpw ; Tue, 16 Oct 2018 06:27:54 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp16.gate.iad3b.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=rozman.si; dmarc=fail (p=none; dis=none) header.from=rozman.si X-Suspicious-Flag: YES X-Classification-ID: 23a7f62c-d12e-11e8-be1c-5254004ed364-1-1 Received: from [216.105.38.7] ([216.105.38.7:26268] helo=lists.sourceforge.net) by smtp16.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 48/4C-20340-92DB5CB5; Tue, 16 Oct 2018 06:27:54 -0400 Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1gCMYq-0001er-8d; Tue, 16 Oct 2018 10:26:48 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1gCMYo-0001ek-RE for openvpn-devel@lists.sourceforge.net; Tue, 16 Oct 2018 10:26:46 +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=uwl1Lv5uhNB3u0Xs03ZLtQu0AqQ2CEXg0kNxF2Oa/4k=; b=Uj8j7qaQyG1gE9seSQkvEOZkmL iNLHR2f/SGmz1JGZN+3kaww3uWa5c0HBkmaSIUcA6D6CrusGaCllN7p4saNaiJuwAnT6BWN8P3mCl 0NaB/MCyR2r64yhfl6iqMD2oOIqvPEtZS39ebD4SB4el7jD4vTcgflI3nS8ciBr+Bt5w=; 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=uwl1Lv5uhNB3u0Xs03ZLtQu0AqQ2CEXg0kNxF2Oa/4k=; b=B4zvCxce6GQf8s6lkBnGLCuqDZ ev2xUkDxOxdxQriJSJ/vGTBr5kHqBN9dDffuHNqi8/HQBeo3CneHAOhp1SUFlunj8ECddjFH089zb B2UN5mTfWVbuB9nFd2CvAA7CU5/jSO4SzYQCwrhkliTQKUQCtnFdXyyIf7DbUEFeWDRU=; Received: from pub5.amebis.si ([213.250.55.21]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) id 1gCMYm-002g28-Nv for openvpn-devel@lists.sourceforge.net; Tue, 16 Oct 2018 10:26:46 +0000 Received: from s0.selo.doma (unknown [213.250.22.160]) by pub5.amebis.si (Postfix) with ESMTPS id C9BB720ACA for ; Tue, 16 Oct 2018 12:26:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=rozman.si; s=default; t=1539685597; bh=smXLF+TfDNFKiIcnXZcvJCsgbzyZa2Op4yhqBuECpCw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y8Loe9s38p56PDndSaFOLKuiU8tFXJkA0h7xrOcV9b3XqZiPmtzcznaU1HF2x2Wx/ tkf5aN0bi9ZbTx5sptOAYPNE5++ESYeF2tid69yeKk4Y0gnq1vwMbHQE+4JCut8PN+ RPA8xZ2H9EgsjjNa/DYp9zpAHlyhk4uIscg8xZJc= Received: from s0.selo.doma ([127.0.0.1]) by s0.selo.doma with Microsoft SMTPSVC(10.0.14393.0); Tue, 16 Oct 2018 12:26:37 +0200 From: Simon Rozman To: openvpn-devel@lists.sourceforge.net Date: Tue, 16 Oct 2018 12:26:25 +0200 Message-Id: <20181016102627.18676-3-simon@rozman.si> X-Mailer: git-send-email 2.19.0.windows.1 In-Reply-To: <20181016102627.18676-1-simon@rozman.si> References: <20181010192337.6984-1-simon@rozman.si> <20181016102627.18676-1-simon@rozman.si> MIME-Version: 1.0 X-OriginalArrivalTime: 16 Oct 2018 10:26:37.0531 (UTC) FILETIME=[B84F72B0:01D4653A] X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 SPF_PASS SPF: sender matches SPF record -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 X-Headers-End: 1gCMYm-002g28-Nv Subject: [Openvpn-devel] [PATCH 3/5] Define _WIN32_WINNT=_WIN32_WINNT_VISTA in MSVC 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 This makes MSVC and MinGW build environments more alike. Acked-by: Jon Kunkee --- src/openvpnmsica/openvpnmsica.props | 1 + src/tapctl/tapctl.props | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/openvpnmsica/openvpnmsica.props b/src/openvpnmsica/openvpnmsica.props index fa408296..074635d0 100644 --- a/src/openvpnmsica/openvpnmsica.props +++ b/src/openvpnmsica/openvpnmsica.props @@ -8,6 +8,7 @@ ..\compat;$(TAP_WINDOWS_HOME)/include;%(AdditionalIncludeDirectories) + _WIN32_WINNT=_WIN32_WINNT_VISTA;%(PreprocessorDefinitions) Windows diff --git a/src/tapctl/tapctl.props b/src/tapctl/tapctl.props index 152954ed..0257b9ff 100644 --- a/src/tapctl/tapctl.props +++ b/src/tapctl/tapctl.props @@ -7,7 +7,7 @@ - _CONSOLE;%(PreprocessorDefinitions) + _CONSOLE;_WIN32_WINNT=_WIN32_WINNT_VISTA;%(PreprocessorDefinitions) ..\compat;$(TAP_WINDOWS_HOME)/include;%(AdditionalIncludeDirectories) From patchwork Mon Oct 15 23:26:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Rozman X-Patchwork-Id: 556 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director10.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id iMBFCCm9xVs8DQAAIUCqbw for ; Tue, 16 Oct 2018 06:27:53 -0400 Received: from proxy6.mail.iad3b.rsapps.net ([172.31.255.6]) by director10.mail.ord1d.rsapps.net with LMTP id AJ6YBSm9xVtiYQAApN4f7A ; Tue, 16 Oct 2018 06:27:53 -0400 Received: from smtp3.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy6.mail.iad3b.rsapps.net with LMTP id QIFYOyi9xVuffAAARawThA ; Tue, 16 Oct 2018 06:27:52 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp3.gate.iad3b.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=rozman.si; dmarc=fail (p=none; dis=none) header.from=rozman.si X-Suspicious-Flag: YES X-Classification-ID: 2299f546-d12e-11e8-8d58-525400bb3479-1-1 Received: from [216.105.38.7] ([216.105.38.7:3445] helo=lists.sourceforge.net) by smtp3.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 3F/E9-13753-82DB5CB5; Tue, 16 Oct 2018 06:27:52 -0400 Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1gCMYu-0006rq-VG; Tue, 16 Oct 2018 10:26:52 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1gCMYt-0006rW-8E for openvpn-devel@lists.sourceforge.net; Tue, 16 Oct 2018 10:26:51 +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=/wDATU51nQTp/Q6gjI8ag7nd0kZy6ZLd3zRi4fKXLFc=; b=lDsMHz4QdL9ahRGHkZ+rEfTYdI 6RDs3BB1AYyOO+VVivWliMqbNbaWhGEEN8wlsDN7o845e0AKx4/4EAyhgSXYdohhRrTy2KVkd294K RON/XtwDrC3S5FDUzoYF+7mMmV5/jmmFll1NolhrBJRSgcd5FB9VxbP+A2H1+DEbeHKY=; 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=/wDATU51nQTp/Q6gjI8ag7nd0kZy6ZLd3zRi4fKXLFc=; b=COYs/f71Z5+iqTrlPn5IROfSy5 KvDeOWCfFCHD3jEnttLFO0USAVjwIAdEN9oyo4VG3mqtuXed6ARbBLzvHIVMFzXrPxeQ/cDcP6iK1 BHjyf3Sjq+AWWOZ+qzZY8ZzVEsdm1ervHbRDGwmVoO9a8UvGTlxDbjfboOEv/dhXk9CQ=; Received: from pub5.amebis.si ([213.250.55.21]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) id 1gCMYq-004nwZ-44 for openvpn-devel@lists.sourceforge.net; Tue, 16 Oct 2018 10:26:51 +0000 Received: from s0.selo.doma (unknown [213.250.22.160]) by pub5.amebis.si (Postfix) with ESMTPS id 0478F20D86 for ; Tue, 16 Oct 2018 12:26:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=rozman.si; s=default; t=1539685598; bh=oClKOzG06iJLJbTJAhtBPCJEwLd8hO5+r/bMKQzKShk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J1vStOXUgcJRRw/TuxogUKV1m2E7MbwjfHGPcWIiEVWPqKk7tU3zCdbpVcLuegIPl iflA6WxO9AHAFKEug7ajv3j0vfLjW/n1kAg7Rtnw2F6/mScUtn+b9PnCkwqUQ/dgFq nGKULJT/xY25wsXJLlL0zOF7ZIGQLZtPBX0USURk= Received: from s0.selo.doma ([127.0.0.1]) by s0.selo.doma with Microsoft SMTPSVC(10.0.14393.0); Tue, 16 Oct 2018 12:26:37 +0200 From: Simon Rozman To: openvpn-devel@lists.sourceforge.net Date: Tue, 16 Oct 2018 12:26:26 +0200 Message-Id: <20181016102627.18676-4-simon@rozman.si> X-Mailer: git-send-email 2.19.0.windows.1 In-Reply-To: <20181016102627.18676-1-simon@rozman.si> References: <20181010192337.6984-1-simon@rozman.si> <20181016102627.18676-1-simon@rozman.si> MIME-Version: 1.0 X-OriginalArrivalTime: 16 Oct 2018 10:26:37.0791 (UTC) FILETIME=[B8771EF0:01D4653A] X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 SPF_PASS SPF: sender matches SPF record -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 X-Headers-End: 1gCMYq-004nwZ-44 Subject: [Openvpn-devel] [PATCH 4/5] Add MSI custom action for reliable Windows 10 detection 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 This patch introduces a `FindSystemInfo()` MSI custom action to reliably detect Windows 10. The MSI built-in properties for Windows version detection depend on bootstrapper's manifest. We could provide our own Windows 10 compatible EXE bootstrapper, but that would cover the Windows 10 detection in the `InstallUISequence` only. The `InstallExecuteSequence` is launched by msiexec.exe which we cannot tamper with would still report `VersionNT` as Windows 8 (603). Acked-by: Jon Kunkee --- src/openvpnmsica/Makefile.am | 2 +- src/openvpnmsica/openvpnmsica.c | 124 ++++++++++++++++++++++++++++++-- src/openvpnmsica/openvpnmsica.h | 15 ++++ 3 files changed, 136 insertions(+), 5 deletions(-) diff --git a/src/openvpnmsica/Makefile.am b/src/openvpnmsica/Makefile.am index d46170b4..ecca74bc 100644 --- a/src/openvpnmsica/Makefile.am +++ b/src/openvpnmsica/Makefile.am @@ -41,7 +41,7 @@ libopenvpnmsica_la_CFLAGS = \ -municode -D_UNICODE \ -UNTDDI_VERSION -U_WIN32_WINNT \ -D_WIN32_WINNT=_WIN32_WINNT_VISTA -libopenvpnmsica_la_LDFLAGS = -ladvapi32 -lole32 -lmsi -lsetupapi -lshlwapi -no-undefined -avoid-version +libopenvpnmsica_la_LDFLAGS = -ladvapi32 -lole32 -lmsi -lsetupapi -lshlwapi -lversion -no-undefined -avoid-version endif libopenvpnmsica_la_SOURCES = \ diff --git a/src/openvpnmsica/openvpnmsica.c b/src/openvpnmsica/openvpnmsica.c index 3b90ce05..d1642d6a 100644 --- a/src/openvpnmsica/openvpnmsica.c +++ b/src/openvpnmsica/openvpnmsica.c @@ -36,13 +36,15 @@ #include #include #include -#ifdef _MSC_VER -#pragma comment(lib, "shlwapi.lib") -#endif #include #include #include +#ifdef _MSC_VER +#pragma comment(lib, "shlwapi.lib") +#pragma comment(lib, "version.lib") +#endif + /** * Local constants @@ -119,7 +121,7 @@ openvpnmsica_setup_sequence_filename( { size_t len_action_name_z = _tcslen(openvpnmsica_cleanup_action_seqs[i].szName) + 1; TCHAR *szPropertyEx = (TCHAR*)malloc((len_property_name + len_action_name_z) * sizeof(TCHAR)); - memcpy(szPropertyEx , szProperty , len_property_name * sizeof(TCHAR)); + memcpy(szPropertyEx , szProperty , len_property_name * sizeof(TCHAR)); memcpy(szPropertyEx + len_property_name, openvpnmsica_cleanup_action_seqs[i].szName, len_action_name_z * sizeof(TCHAR)); _stprintf_s( szFilenameEx, _countof(szFilenameEx), @@ -142,6 +144,120 @@ openvpnmsica_setup_sequence_filename( } +UINT __stdcall +FindSystemInfo(_In_ MSIHANDLE hInstall) +{ +#ifdef _MSC_VER +#pragma comment(linker, DLLEXP_EXPORT) +#endif + +#ifdef _DEBUG + MessageBox(NULL, TEXT("Attach debugger!"), TEXT(__FUNCTION__) TEXT(" v") TEXT(PACKAGE_VERSION), MB_OK); +#endif + + UINT uiResult; + BOOL bIsCoInitialized = SUCCEEDED(CoInitialize(NULL)); + + /* Set MSI session handle in TLS. */ + struct openvpnmsica_tls_data *s = (struct openvpnmsica_tls_data *)TlsGetValue(openvpnmsica_tlsidx_session); + s->hInstall = hInstall; + + // Get Windows version. + OSVERSIONINFOEX ver_info = { .dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX) }; + if (!GetVersionEx((LPOSVERSIONINFO)&ver_info)) { + uiResult = GetLastError(); + msg(M_NONFATAL | M_ERRNO, "%s: GetVersionEx() failed", __FUNCTION__); + goto cleanup_CoInitialize; + } + + // The Windows version is usually spoofed, check using RtlGetVersion(). + TCHAR szDllPath[0x1000]; + ExpandEnvironmentStrings(TEXT("%SystemRoot%\\System32\\ntdll.dll"), szDllPath, +#ifdef UNICODE + _countof(szDllPath) +#else + _countof(szDllPath) - 1 +#endif + ); + HMODULE hNtDllModule = LoadLibrary(szDllPath); + if (hNtDllModule) + { + typedef NTSTATUS (WINAPI* fnRtlGetVersion)(PRTL_OSVERSIONINFOW); + fnRtlGetVersion RtlGetVersion = (fnRtlGetVersion)GetProcAddress(hNtDllModule, "RtlGetVersion"); + if (RtlGetVersion) + { + RTL_OSVERSIONINFOW rtl_ver_info = { .dwOSVersionInfoSize = sizeof(RTL_OSVERSIONINFOW) }; + if (RtlGetVersion(&rtl_ver_info) == 0) + if ( + rtl_ver_info.dwMajorVersion > ver_info.dwMajorVersion || + rtl_ver_info.dwMajorVersion == ver_info.dwMajorVersion && rtl_ver_info.dwMinorVersion > ver_info.dwMinorVersion || + rtl_ver_info.dwMajorVersion == ver_info.dwMajorVersion && rtl_ver_info.dwMinorVersion == ver_info.dwMinorVersion && rtl_ver_info.dwBuildNumber > ver_info.dwBuildNumber) + { + // We got RtlGetVersion() and it reported newer version than GetVersionEx(). + ver_info.dwMajorVersion = rtl_ver_info.dwMajorVersion; + ver_info.dwMinorVersion = rtl_ver_info.dwMinorVersion; + ver_info.dwBuildNumber = rtl_ver_info.dwBuildNumber; + ver_info.dwPlatformId = rtl_ver_info.dwPlatformId; + } + } + + FreeLibrary(hNtDllModule); + } + + // We don't trust RtlGetVersion() either. Check the version resource of kernel32.dll. + ExpandEnvironmentStrings(TEXT("%SystemRoot%\\System32\\kernel32.dll"), szDllPath, +#ifdef UNICODE + _countof(szDllPath) +#else + _countof(szDllPath)-1 +#endif + ); + + DWORD dwHandle; + DWORD dwVerInfoSize = GetFileVersionInfoSize(szDllPath, &dwHandle); + if (dwVerInfoSize) + { + LPVOID pVersionInfo = malloc(dwVerInfoSize); + if (pVersionInfo) + { + // Read version info. + if (GetFileVersionInfo(szDllPath, dwHandle, dwVerInfoSize, pVersionInfo)) + { + // Get the value for the root block. + UINT uiSize = 0; + VS_FIXEDFILEINFO *pVSFixedFileInfo = NULL; + if (VerQueryValue(pVersionInfo, TEXT("\\"), &pVSFixedFileInfo, &uiSize) && uiSize && pVSFixedFileInfo) + if (HIWORD(pVSFixedFileInfo->dwProductVersionMS) > ver_info.dwMajorVersion || + HIWORD(pVSFixedFileInfo->dwProductVersionMS) == ver_info.dwMajorVersion && LOWORD(pVSFixedFileInfo->dwProductVersionMS) > ver_info.dwMinorVersion || + HIWORD(pVSFixedFileInfo->dwProductVersionMS) == ver_info.dwMajorVersion && LOWORD(pVSFixedFileInfo->dwProductVersionMS) == ver_info.dwMinorVersion && HIWORD(pVSFixedFileInfo->dwProductVersionLS) > ver_info.dwBuildNumber) + { + // We got kernel32.dll version and it is newer. + ver_info.dwMajorVersion = HIWORD(pVSFixedFileInfo->dwProductVersionMS); + ver_info.dwMinorVersion = LOWORD(pVSFixedFileInfo->dwProductVersionMS); + ver_info.dwBuildNumber = HIWORD(pVSFixedFileInfo->dwProductVersionLS); + } + } + + free(pVersionInfo); + } + } + + uiResult = MsiSetProperty(hInstall, TEXT("DriverCertification"), ver_info.dwMajorVersion >= 10 ? ver_info.wProductType > VER_NT_WORKSTATION ? TEXT("whql") : TEXT("attsgn") : TEXT("")); + if (uiResult != ERROR_SUCCESS) + { + SetLastError(uiResult); /* MSDN does not mention MsiSetProperty() to set GetLastError(). But we do have an error code. Set last error manually. */ + msg(M_NONFATAL | M_ERRNO, "%s: MsiSetProperty(\"TAPINTERFACES\") failed", __FUNCTION__); + goto cleanup_CoInitialize; + } + + uiResult = ERROR_SUCCESS; + +cleanup_CoInitialize: + if (bIsCoInitialized) CoUninitialize(); + return uiResult; +} + + UINT __stdcall FindTAPInterfaces(_In_ MSIHANDLE hInstall) { diff --git a/src/openvpnmsica/openvpnmsica.h b/src/openvpnmsica/openvpnmsica.h index bb8e28ec..da145062 100644 --- a/src/openvpnmsica/openvpnmsica.h +++ b/src/openvpnmsica/openvpnmsica.h @@ -63,6 +63,21 @@ extern "C" { #endif +/** + * Determines Windows information: + * - Sets `DriverCertification` MSI property to "", "attsgn" or "whql" + * according to the driver certification required by the running version of + * Windows. + * + * @param hInstall Handle to the installation provided to the DLL custom action + * + * @return ERROR_SUCCESS on success; An error code otherwise + * See: https://msdn.microsoft.com/en-us/library/windows/desktop/aa368072.aspx + */ +DLLEXP_DECL UINT __stdcall +FindSystemInfo(_In_ MSIHANDLE hInstall); + + /** * Find existing TAP interfaces and set TAPINTERFACES property with semicolon delimited list * of installed TAP interface GUIDs. From patchwork Mon Oct 15 23:26:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Rozman X-Patchwork-Id: 555 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director9.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id YOcTMSi9xVu1eAAAIUCqbw for ; Tue, 16 Oct 2018 06:27:52 -0400 Received: from proxy7.mail.iad3b.rsapps.net ([172.31.255.6]) by director9.mail.ord1d.rsapps.net with LMTP id mNOILii9xVucbQAAalYnBA ; Tue, 16 Oct 2018 06:27:52 -0400 Received: from smtp33.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy7.mail.iad3b.rsapps.net with LMTP id sC+dKCi9xVsaDQAAQkQ5tQ ; Tue, 16 Oct 2018 06:27:52 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp33.gate.iad3b.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=rozman.si; dmarc=fail (p=none; dis=none) header.from=rozman.si X-Suspicious-Flag: YES X-Classification-ID: 22d2e888-d12e-11e8-a925-525400fb5834-1-1 Received: from [216.105.38.7] ([216.105.38.7:48204] helo=lists.sourceforge.net) by smtp33.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id AC/7D-30416-82DB5CB5; Tue, 16 Oct 2018 06:27:52 -0400 Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1gCMYq-0006qa-Mq; Tue, 16 Oct 2018 10:26:48 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1gCMYp-0006q9-11 for openvpn-devel@lists.sourceforge.net; Tue, 16 Oct 2018 10:26:47 +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=20M64mkV04otVaJko6LpE/NzJM0AFoXnn4q+Jf3+GDs=; b=glKY9M0+y99RH98HLQkpejJyEk SWglzYwraFdRVmyvrruSXpB/FkVO/SUs8TeKP2o8H8OJ1yrxA4nQ4lw8XoGJ2yMgIUhGFg9bdS7aC 1oh+8FAmoK8WlXIjlOH+pINt0PFrkPPdt/Z1ixvAMHH0wmnolQhKtnF0OOzYA1shkvG4=; 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=20M64mkV04otVaJko6LpE/NzJM0AFoXnn4q+Jf3+GDs=; b=UviUwFMquHSpgpPOxSxHc/Tr9D 0b+ldEVEeKMJaIfjmQURpxqAhogHwwtQ8aNTGBJsuCTw6g6UX6Tb/nBnEA5EfiRHNdMFA1NtiZJMV j3mjrABSxAKCxiMwHijJ+GZR0rqlKQ674pt6oAkQjEmCpI86hkqnF1glQqMiVJRaU8dY=; Received: from pub5.amebis.si ([213.250.55.21]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) id 1gCMYn-002g29-5t for openvpn-devel@lists.sourceforge.net; Tue, 16 Oct 2018 10:26:46 +0000 Received: from s0.selo.doma (unknown [213.250.22.160]) by pub5.amebis.si (Postfix) with ESMTPS id 331A620D96 for ; Tue, 16 Oct 2018 12:26:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=rozman.si; s=default; t=1539685598; bh=CDX946L3t8+Hjy/cpgSD+ucoRvdmu6zXIK8WpYnWQ8Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QsVxVvvRrJNQFkRwDSr9ykAbkYAaCAppz6I3H9yMK6NxmVF0LiY7JFypOkTkLTQ4V wExGTeRAcqb4XwIBgyH4IOBhx59J6hrrmC3AqkqO3oMZK2CLXp8SQmDFjbORtfXYLM VSSJZC4sT2onsIDH8yddV4CXMOZAO5e1nQ2c18tQ= Received: from s0.selo.doma ([127.0.0.1]) by s0.selo.doma with Microsoft SMTPSVC(10.0.14393.0); Tue, 16 Oct 2018 12:26:38 +0200 From: Simon Rozman To: openvpn-devel@lists.sourceforge.net Date: Tue, 16 Oct 2018 12:26:27 +0200 Message-Id: <20181016102627.18676-5-simon@rozman.si> X-Mailer: git-send-email 2.19.0.windows.1 In-Reply-To: <20181016102627.18676-1-simon@rozman.si> References: <20181010192337.6984-1-simon@rozman.si> <20181016102627.18676-1-simon@rozman.si> MIME-Version: 1.0 X-OriginalArrivalTime: 16 Oct 2018 10:26:38.0081 (UTC) FILETIME=[B8A35F10:01D4653A] X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 SPF_PASS SPF: sender matches SPF record -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 X-Headers-End: 1gCMYn-002g29-5t Subject: [Openvpn-devel] [PATCH 5/5] Detect TAP interfaces with root-enumerated hardware ID 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 This patch extends the TAP interface enumerating to detect the TAP interfaces registered using "root\tap0901" hardware ID. Before, only TAP interfaces with legacy "tap0901" HWID were detected by openvpn.exe. The openvpnmsica.dll and tapctl.exe install TAP interfaces using root- enumerated HWIDs, and were not detected by openvpn.exe. Acked-by: Gert Doering --- src/openvpn/tun.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 948fd17d..5fde2ab8 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -3524,7 +3524,8 @@ get_tap_reg(struct gc_arena *gc) if (status == ERROR_SUCCESS && data_type == REG_SZ) { - if (!strcmp(component_id, TAP_WIN_COMPONENT_ID)) + if (!strcmp(component_id, TAP_WIN_COMPONENT_ID) || + !strcmp(component_id, "root\\" TAP_WIN_COMPONENT_ID)) { struct tap_reg *reg; ALLOC_OBJ_CLEAR_GC(reg, struct tap_reg, gc);