From patchwork Thu Dec 15 19:01:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 2916 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:c95:b0:82:e4b3:40a0 with SMTP id p21csp631571dyk; Thu, 15 Dec 2022 11:02:15 -0800 (PST) X-Google-Smtp-Source: AA0mqf5KDnokfBHh7UkPzT2D11/fKjQ79fQbec9NMck8hg3MobJmycBvna/CvoO+ELaImqTxpIUG X-Received: by 2002:a05:7500:3d1:b0:ea:b8b0:31eb with SMTP id p17-20020a05750003d100b000eab8b031ebmr4795524gab.33.1671130935397; Thu, 15 Dec 2022 11:02:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671130935; cv=none; d=google.com; s=arc-20160816; b=Xw7myiD/Z8rQbgdT4KBsXNPP9ViJC8JEaJRpNqmufoGr+jRPY0jEznI9U8Fv1jQgnK H8iIHI1DtaN9wP/OaXtQNPjE7aM5lO/pvu088af11aDKwDAxi4P/KcOXzdQMqqv7zcpy QlO7SAQHIekLArZddjb5v5YiDMi7BOqU3ePIRMLu3wW9/1stv1EF3Ia23e9zqfhMPPGq ECPSQzO9WPglJK3AF9RADW2pGcs86rc5VpmNmLycomkbWDGa/Ym7cJT/KlNQp+SZmgyb zon7oyGtPSkYN5UOy0If4XSTHIflP3qF35PjffsDAlSYHuN7ZyHg//+x2UtSrGdiZvwg Gjmg== 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:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature; bh=IWPSKJbjyeDFYCN6mVeXyoLTljAlT7Vbif4DK+c0MQM=; b=ze5186cJnnXPcSD7d/zunQnpg1boqdgxukRanIN60eIIUjN3VPdOXx+w+wrL8GWbpq LyL/mGWHpJjPwitYfTJDiJUrkuMjTZ0PB36eFo3JOdO1ihjzqRczxzKocxlZe0YfWgKE wow0rWQEvkk+Gqtr2rfyZLGrLXPL9yzLx+UvjZxUw8aADuAgTzAcoSVD82Dl8OWH55/m 51WGrx9EbmTfltRIN2hIznwsb1N+XvmRQRQtCbx69EMUdEHvkeGtC8VYDhr4ihYgCV7B ZWYdnj2MsK95q17LhLtBatL0STFXCdIFWCCgmBTnlo0t0ljgwNkiHXLwtDt3pNw9bYaH xjPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=B6R5ZlZ4; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="ZH/2Hva5"; 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 v15-20020a67c00f000000b003adac6a792csi1951461vsi.24.2022.12.15.11.02.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Dec 2022 11:02:15 -0800 (PST) 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=B6R5ZlZ4; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="ZH/2Hva5"; 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 1p5tUT-0007BA-F9; Thu, 15 Dec 2022 19:01:57 +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 1p5tUP-0007Ao-Gm for openvpn-devel@lists.sourceforge.net; Thu, 15 Dec 2022 19:01:53 +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=CfMi6dEy7BT7g8R85F4sWUaWRfF47pqc153H6I7QQxw=; b=B6R5ZlZ4yPO0PvSiC2U4qjacvw JtbrBseb5UpBFfVhoYtIT/pXgNmik3Rq8mciuDa3XtmThc9KkTHF7fTeHj1RsI4uEVfQSIkYP7J+s HNx2O86k1lKs2jfIu0EpFNY4hzBYP8VoLUe2ZZAnHPQojs/GYDOH8rPT+rQ9uv4Xpr74=; 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=CfMi6dEy7BT7g8R85F4sWUaWRfF47pqc153H6I7QQxw=; b=ZH/2Hva58L4k0rUrrSs77oNRkd cGbqvU3KyodsmZ9gy/tbFA6PtfR8nvUsKhUcfqQYw4B5dXEAeCoM0nPr0dEtX4bHegtrdc75cSzcu aIBOpCz/Abp0T93OnR+jgIKVjoLu3zEMIArB92KmguwIWVUJfAgY6oCq7Mu8ixWPqp10=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1p5tUN-0001Gj-Id for openvpn-devel@lists.sourceforge.net; Thu, 15 Dec 2022 19:01:53 +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 1p5tUF-000Kw4-Bu for openvpn-devel@lists.sourceforge.net; Thu, 15 Dec 2022 20:01:43 +0100 Received: (nullmailer pid 2107953 invoked by uid 10006); Thu, 15 Dec 2022 19:01:43 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Thu, 15 Dec 2022 20:01:39 +0100 Message-Id: <20221215190143.2107896-5-arne@rfc2549.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221215190143.2107896-1-arne@rfc2549.org> References: <20221215190143.2107896-1-arne@rfc2549.org> MIME-Version: 1.0 X-Spam-Score: 0.3 (/) 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: Signed-off-by: Arne Schwabe --- src/openvpn/misc.h | 1 + src/openvpn/ntlm.c | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/openvpn/misc.h b/src/openvpn/misc.h index 2a6c0b8b3..6a883f70a 100644 --- a/src/openvpn/misc.h +++ b/src/openvpn/misc.h @@ -67,6 +67,7 @@ struct user_pass #else #define USER_PASS_LEN [...] Content analysis details: (0.3 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 X-Headers-End: 1p5tUN-0001Gj-Id Subject: [Openvpn-devel] [PATCH 4/8] Improve documentation on user/password requirement and unicodize function 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?1752307791657942835?= X-GMAIL-MSGID: =?utf-8?q?1752307791657942835?= Signed-off-by: Arne Schwabe Acked-by: Gert Doering --- src/openvpn/misc.h | 1 + src/openvpn/ntlm.c | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/openvpn/misc.h b/src/openvpn/misc.h index 2a6c0b8b3..6a883f70a 100644 --- a/src/openvpn/misc.h +++ b/src/openvpn/misc.h @@ -67,6 +67,7 @@ struct user_pass #else #define USER_PASS_LEN 128 #endif + /* Note that username and password are expected to be null-terminated */ char username[USER_PASS_LEN]; char password[USER_PASS_LEN]; }; diff --git a/src/openvpn/ntlm.c b/src/openvpn/ntlm.c index 72c13130a..20527d442 100644 --- a/src/openvpn/ntlm.c +++ b/src/openvpn/ntlm.c @@ -140,6 +140,19 @@ my_strupr(char *str) } } +/** + * This function expects a null-terminated string in src and will + * copy it (including the terminating NUL byte), + * alternating it with 0 to dst. + * + * This basically will transform a ASCII string into valid UTF-16. + * Characters that are 8bit in src, will get the same treatment, resulting in + * invalid or wrong unicode code points. + * + * @note the function will blindly assume that dst has double + * the space of src. + * @return the length of the number of bytes written to dst + */ static int unicodize(char *dst, const char *src) {