From patchwork Thu Apr 22 05:29:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 1767 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director15.mail.ord1d.rsapps.net ([172.28.255.1]) by backend30.mail.ord1d.rsapps.net with LMTP id OAn7E56WgWBLJgAAIUCqbw (envelope-from ) for ; Thu, 22 Apr 2021 11:30:38 -0400 Received: from proxy6.mail.ord1c.rsapps.net ([172.28.255.1]) by director15.mail.ord1d.rsapps.net with LMTP id oEZqE56WgWDnTQAAIcMcQg (envelope-from ) for ; Thu, 22 Apr 2021 11:30:38 -0400 Received: from smtp25.gate.ord1c ([172.28.255.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy6.mail.ord1c.rsapps.net with LMTPS id iMwBE56WgWDqBwAA9sKXow (envelope-from ) for ; Thu, 22 Apr 2021 11:30:38 -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: smtp25.gate.ord1c.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; dmarc=none (p=nil; dis=none) header.from=rfc2549.org X-Suspicious-Flag: YES X-Classification-ID: afeb85f6-a37f-11eb-9a98-b8ca3a673c88-1-1 Received: from [216.105.38.7] ([216.105.38.7:58680] helo=lists.sourceforge.net) by smtp25.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id E9/BB-38462-D9691806; Thu, 22 Apr 2021 11:30:37 -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 1lZbH6-00086C-6K; Thu, 22 Apr 2021 15:29: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 1lZbH2-00085M-Ja for openvpn-devel@lists.sourceforge.net; Thu, 22 Apr 2021 15:29: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: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:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ERo7kTigu7VI04HCOX8+yD27Fumadx7wyNClHUl2C3A=; b=Sh1ZTKdv6LzhpzuFQTOAuOBc+4 KitcAN08rYtwqOiV4Fe3l5sraMICjA4Hi0kiDUJkJeS4RMFYcYW241Yn7KMq/xdE9kn3O41opUZJM 68l+4AQvaiT8klhlbwIA23C1jASEIl1U/6uTGvYTO1Y08K0Bn7Fhs8XWI8hkEruSPn2c=; 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: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:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=ERo7kTigu7VI04HCOX8+yD27Fumadx7wyNClHUl2C3A=; b=O7IQ0tnHG+obHjnj3idq/vI/1K 5BxOLjwvaODzUJG3mN40iA+rboPfmg5vIt09W9Y7F8md/xilOR3vZqN0owx9DTCJDvCHk+FMYRa9u 6EGP7SroNYlc0+05itmQcrHbAIE5ilQW8emtm77v3tlG79CiQLCw4OzneOb9YDJ0fHJQ=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) id 1lZbH0-0007w9-E3 for openvpn-devel@lists.sourceforge.net; Thu, 22 Apr 2021 15:29:48 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.94 (FreeBSD)) (envelope-from ) id 1lZbGt-000B9P-MN for openvpn-devel@lists.sourceforge.net; Thu, 22 Apr 2021 17:29:39 +0200 Received: (nullmailer pid 2134105 invoked by uid 10006); Thu, 22 Apr 2021 15:29:40 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Thu, 22 Apr 2021 17:29:38 +0200 Message-Id: <20210422152939.2134046-5-arne@rfc2549.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210422152939.2134046-1-arne@rfc2549.org> References: <20210422152939.2134046-1-arne@rfc2549.org> MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: rfc2549.org] 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 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Headers-End: 1lZbH0-0007w9-E3 Subject: [Openvpn-devel] [PATCH v2 5/6] Replace OS_SPECIFIC_DIRSEP with PATH_SEPARATOR 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 We have two define that do exactly the same. Also move the check from configure.ac to syshead.h since it is really only checking for Windows. Patch V2: Also remove from config-msvc.h Signed-off-by: Arne Schwabe Acked-by: Gert Doering --- config-msvc.h | 3 --- configure.ac | 8 -------- src/openvpn/platform.c | 2 +- src/openvpn/ssl_verify.c | 2 +- src/openvpn/syshead.h | 6 ++++-- 5 files changed, 6 insertions(+), 15 deletions(-) diff --git a/config-msvc.h b/config-msvc.h index e73dd8c6f..979232282 100644 --- a/config-msvc.h +++ b/config-msvc.h @@ -80,9 +80,6 @@ #define HAVE_EVP_CIPHER_CTX_RESET 1 #define HAVE_DIINSTALLDEVICE 1 -#define PATH_SEPARATOR '\\' -#define PATH_SEPARATOR_STR "\\" - #ifndef __cplusplus #define inline __inline #endif diff --git a/configure.ac b/configure.ac index a67bf2595..3b4d3cbc7 100644 --- a/configure.ac +++ b/configure.ac @@ -1133,14 +1133,6 @@ if test -n "${GIT}" -a -d "${srcdir}/.git"; then fi AC_MSG_RESULT([${GIT_CHECKOUT}]) -if test -n "${SP_PLATFORM_WINDOWS}"; then - AC_DEFINE_UNQUOTED([PATH_SEPARATOR], ['\\\\'], [Path separator]) #" - AC_DEFINE_UNQUOTED([PATH_SEPARATOR_STR], ["\\\\"], [Path separator]) #" -else - AC_DEFINE_UNQUOTED([PATH_SEPARATOR], ['/'], [Path separator]) - AC_DEFINE_UNQUOTED([PATH_SEPARATOR_STR], ["/"], [Path separator]) -fi - dnl enable --x509-username-field feature if requested if test "${enable_x509_alt_username}" = "yes"; then if test "${with_crypto_library}" = "mbedtls" ; then diff --git a/src/openvpn/platform.c b/src/openvpn/platform.c index c63c1d994..bf7b1aa0a 100644 --- a/src/openvpn/platform.c +++ b/src/openvpn/platform.c @@ -486,7 +486,7 @@ platform_gen_path(const char *directory, const char *filename, struct buffer out = alloc_buf_gc(outsize, gc); char dirsep[2]; - dirsep[0] = OS_SPECIFIC_DIRSEP; + dirsep[0] = PATH_SEPARATOR; dirsep[1] = '\0'; if (directory) diff --git a/src/openvpn/ssl_verify.c b/src/openvpn/ssl_verify.c index 7608155cd..14aaf2bf7 100644 --- a/src/openvpn/ssl_verify.c +++ b/src/openvpn/ssl_verify.c @@ -616,7 +616,7 @@ verify_check_crl_dir(const char *crl_dir, openvpn_x509_cert_t *cert, goto cleanup; } - if (!openvpn_snprintf(fn, sizeof(fn), "%s%c%s", crl_dir, OS_SPECIFIC_DIRSEP, serial)) + if (!openvpn_snprintf(fn, sizeof(fn), "%s%c%s", crl_dir, PATH_SEPARATOR, serial)) { msg(D_HANDSHAKE, "VERIFY CRL: filename overflow"); goto cleanup; diff --git a/src/openvpn/syshead.h b/src/openvpn/syshead.h index 3f2e563b7..bc628eac4 100644 --- a/src/openvpn/syshead.h +++ b/src/openvpn/syshead.h @@ -436,9 +436,11 @@ typedef unsigned short sa_family_t; * Directory separation char */ #ifdef _WIN32 -#define OS_SPECIFIC_DIRSEP '\\' +#define PATH_SEPARATOR '\\' +#define PATH_SEPARATOR_STR "\\" #else -#define OS_SPECIFIC_DIRSEP '/' +#define PATH_SEPARATOR '/' +#define PATH_SEPARATOR_STR "/" #endif /*