From patchwork Fri Sep 22 10:50:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Lichtenheld X-Patchwork-Id: 3361 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7301:2697:b0:d7:3b0f:3938 with SMTP id ha23csp3652855dyb; Fri, 22 Sep 2023 03:51:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGi8lKOMiyIVBxuLkzdSaXB0E11ZUsD4v4OlJ0zNR2l70E2kpavnSP7ufCGgKNsbYq1Xzdp X-Received: by 2002:a17:902:e744:b0:1b8:aded:524c with SMTP id p4-20020a170902e74400b001b8aded524cmr8256303plf.1.1695379918892; Fri, 22 Sep 2023 03:51:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695379918; cv=none; d=google.com; s=arc-20160816; b=vAwjeIcmkkL1wIg4iHK+tjiCP3wb6p1bXxttjvBthf9KjAM/z5zR9Fy7aKNzQcVPdj n+ss2Crc3tet6Winxhy4s99NPnZd3yOiWJ3IsvXoyRWSv3+TBtgxfSCl3E4CWeGVtTeF 1wODJGQcnGD8j57ntWDYYjbq1Q0nV/qTRdeHnSG/tzMdH10JSVjwDvwUsVErMUd8sc+2 vxs9aXYJtaeZbJpOe2c5WRK/P1MD2OfX86uxJVwQVGxGEsBPPzP6zrqg/ZjYUNTt6h7i r7mJsjRZ/rKlgOHP8NcrLdajjFvoNGoYhLAAOlN7ss/X20bRqM6mmqRdAk2wezFSySw2 9aew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:content-transfer-encoding:cc: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:dkim-signature; bh=r+/b9gBtslClrgm+oML6olCZfFrUkw+IPKAlBwCkOCI=; fh=ZRBZ3p4fvLYBwsG7McdxRCx2fnmH9YCsPK+JAqT+6LA=; b=PA0HAFMiOzX4Nb00sYHZJZaUiHuIe/H7rkXRE0Q1zF2l0LQG8UPm/kCI5K8+g7mzG3 fI28ftU6noLE32blG6mpUoEwuuasptnhv7JtrKn8PAw+dsT0Qcm9j6njdQSKErl7VPD1 3fHec8ZYA4k8d6zBAA8NgPZKUVPznD0sVmSloR+kGqOAlpLJ3t1x3u2V4xbUmwt9XwiH YqqUiuPF4LfN3snGSd8wUuctGIwJv/fu/a3r34NfH2hVfcMk8Ls8z6rVntq0QAVQQEHF htNE1QlgovoC71zUaHYaVx33UyXJDMLziF/hrYPyyNMOV5qjWSAQOaxS4tiI1IiGsUvG Zbsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="iyB3PDM/"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Wsj5+lME; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=i+bxHnH8; 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 n13-20020a170903110d00b001c5da8b630fsi3240447plh.421.2023.09.22.03.51.58 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Sep 2023 03:51:58 -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="iyB3PDM/"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Wsj5+lME; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=i+bxHnH8; 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-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1qjdkZ-00024v-Rd; Fri, 22 Sep 2023 10:51:08 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qjdkY-00024o-QZ for openvpn-devel@lists.sourceforge.net; Fri, 22 Sep 2023 10:51:07 +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=cV+BtEsEQLxwUUIDcj1mTf/nzOC7qbD6auwScCqBm9A=; b=iyB3PDM/DAD0Y4OyVP3tgn+7rC 00Nlqw2kvz4JwecIjturSqHSigdf3NSO5amm4B4aaDxT6rT7IiilUR8yIcwkJa6AQgqPp+TNbqJwk +bMYUWSoKjJV+rzqoqdTtehClRfp464KbCfi2jwAD7ISvhwXGf1lQ/CQ+5QAfXBzvU7o=; 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=cV+BtEsEQLxwUUIDcj1mTf/nzOC7qbD6auwScCqBm9A=; b=Wsj5+lMEGLVBe+zWVO170sJNXq OSZyx71y47B5anx+W2UxaYTQdWo216DykWtmg7M68HTAmcdPZvhfucSNG+aEHJsQ1TNNz5NQrbtgx odQwY6ZVwVpoVbVwQ+8w42iiKaUKXNeedTQlSzbXs0EZ+2wRG0iphqVWSvorkKcj4pX8=; Received: from mout-p-201.mailbox.org ([80.241.56.171]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1qjdkX-0022uk-Ee for openvpn-devel@lists.sourceforge.net; Fri, 22 Sep 2023 10:51:07 +0000 Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4RsTZm2PQdz9srJ; Fri, 22 Sep 2023 12:50:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lichtenheld.com; s=MBO0001; t=1695379856; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cV+BtEsEQLxwUUIDcj1mTf/nzOC7qbD6auwScCqBm9A=; b=i+bxHnH8yP6ha8X/PUyPhFDqLTos36mD41GhIBvYFMuNUovEaVPe9rYyDH97KQIpTP+NlR nNfUXexeW/o2wo4tji0fwQRXUj6xwwlPctTYhGb8iZMUfsEYvXsqFNiL2GfewNbp/eCsG4 uatTkau6EJcEZ/QXGOvVMseUeFGqNQNDWPoIBe+LGT2tuskgLeMTQc8KudJtOjmooH9YkA Iqy43uTeJd1srea8EWzgIk686mcqrOTivyklhiwAUPrpgA3ENFlHt3Y4bSDrnvonFaJYDw S9WlCqcgYPSdag6eAMJNzgppElx8HolJg1WhLuCi/NNJJVZgmFfxLZqiWJtfLA== From: Frank Lichtenheld To: openvpn-devel@lists.sourceforge.net Date: Fri, 22 Sep 2023 12:50:55 +0200 Message-Id: <20230922105055.37969-1-frank@lichtenheld.com> In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: -0.9 (/) 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: From: Lev Stipakov "INFO_PRE, ..." command length is limited to 256 bytes. If the server implementation pushes command which is too long, warn the user and don't send the truncated command to a management client. Content analysis details: (-0.9 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [80.241.56.171 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-Headers-End: 1qjdkX-0022uk-Ee Subject: [Openvpn-devel] [PATCH] Warn user if INFO control command is too long 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: , Cc: Lev Stipakov Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1777734694305067135?= X-GMAIL-MSGID: =?utf-8?q?1777734694305067135?= From: Lev Stipakov "INFO_PRE,..." command length is limited to 256 bytes. If the server implementation pushes command which is too long, warn the user and don't send the truncated command to a management client. Change-Id: If3c27a2a2ba24f2af0e3e3c95eea57ed420b2542 Signed-off-by: Lev Stipakov Acked-by: Frank Lichtenheld --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to release/2.6. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/329 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Frank Lichtenheld diff --git a/src/openvpn/push.c b/src/openvpn/push.c index d468211..19849c5 100644 --- a/src/openvpn/push.c +++ b/src/openvpn/push.c @@ -244,8 +244,14 @@ * for management greeting and we don't want to confuse the client */ struct buffer out = alloc_buf_gc(256, &gc); - buf_printf(&out, ">%s:%s", "INFOMSG", m); - management_notify_generic(management, BSTR(&out)); + if (buf_printf(&out, ">%s:%s", "INFOMSG", m)) + { + management_notify_generic(management, BSTR(&out)); + } + else + { + msg(D_PUSH_ERRORS, "WARNING: Received INFO command is too long, won't notify management client."); + } gc_free(&gc); }