From patchwork Tue May 18 04:32:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 1817 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director7.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id wOaSEUDQo2CpRgAAIUCqbw (envelope-from ) for ; Tue, 18 May 2021 10:33:36 -0400 Received: from proxy3.mail.ord1d.rsapps.net ([172.30.191.6]) by director7.mail.ord1d.rsapps.net with LMTP id gEZpEUDQo2CwBgAAovjBpQ (envelope-from ) for ; Tue, 18 May 2021 10:33:36 -0400 Received: from smtp29.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy3.mail.ord1d.rsapps.net with LMTPS id iE8NEUDQo2CRLwAA7WKfLA (envelope-from ) for ; Tue, 18 May 2021 10:33:36 -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: smtp29.gate.ord1d.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=greenie.muc.de X-Suspicious-Flag: YES X-Classification-ID: 06cd1022-b7e6-11eb-bdd1-525400f257a9-1-1 Received: from [216.105.38.7] ([216.105.38.7:33538] helo=lists.sourceforge.net) by smtp29.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 37/FA-22554-F30D3A06; Tue, 18 May 2021 10:33:35 -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.92.3) (envelope-from ) id 1lj0lv-0005Pd-4D; Tue, 18 May 2021 14:32:35 +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.92.3) (envelope-from ) id 1lj0lu-0005PQ-4H for openvpn-devel@lists.sourceforge.net; Tue, 18 May 2021 14:32:34 +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=Lu7S09336YLNGds97kBrD9lp0ibHwc5ZheFlMMTTXFw=; b=Ah77R+8zs/xhZj1uD9+2sSrjU7 UX8oBws9iJXeAVRnOgk0rg//U1wpUC7jO3Kh4RywWHa4twDk3FWH+B1jdNsfOIJWtdjl7jAdZM/bk azpLSyIke0eKVuMKkx/8jUMN/U3IGPVd97Zfoq9WyLoX8mtnqMx7wLaG9c73ss54VuQM=; 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=Lu7S09336YLNGds97kBrD9lp0ibHwc5ZheFlMMTTXFw=; b=BCC+D8JDuXAkYh9YRcPVx9vUpW ASCKvkSr53EHWt0em8Q5uauXyirrUxv96MHtNY0bOiMoMoxjPJx1WF9IK8G0aJFjmumBWA5psntq3 hMz6lJB3uo0+Qt8dKFUsbvh45ZEYOb4R6FcGPlHLZu89hfHQ4lCui0GJdjjtSIkNMxF4=; Received: from dhcp-174.greenie.muc.de ([193.149.48.174] helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) id 1lj0lo-0006NU-Rc for openvpn-devel@lists.sourceforge.net; Tue, 18 May 2021 14:32:34 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.15.2/8.14.9) with ESMTP id 14IEWInm014568 for ; Tue, 18 May 2021 16:32:18 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.15.2/8.14.9/Submit) id 14IEWIdH014567 for openvpn-devel@lists.sourceforge.net; Tue, 18 May 2021 16:32:18 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Tue, 18 May 2021 16:32:18 +0200 Message-Id: <20210518143218.14520-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.26.3 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1lj0lo-0006NU-Rc Subject: [Openvpn-devel] [PATCH] Ignore leading whitespace and comment lines for peer-fingerprint. 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 Inline peer-fingerprint blocks can benefit from a bit of structuring by indentation or by putting comments ("# this is Alice's key"). Signed-off-by: Gert Doering --- src/openvpn/options.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/openvpn/options.c b/src/openvpn/options.c index db460796..cfc30193 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -1145,8 +1145,13 @@ parse_hash_fingerprint_multiline(const char *str, int nbytes, int msglevel, const char *line; while ((line = strsep(&lines, "\n"))) { - /* skip empty lines */ - if (strlen(line) == 0) + /* ignore leading whitespace */ + while(isspace(*line)) + { + line++; + } + /* skip empty lines and comment lines */ + if (strlen(line) == 0 || *line == '#') { continue; }