From patchwork Thu Oct 30 19:29:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4549 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7001:2f13:b0:72f:f16c:e055 with SMTP id sa19csp1152047mab; Thu, 30 Oct 2025 12:30:16 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWfMDs2LwsEhjIoi4SKm9A/2NOMUd+xEM9+meuncvzTVI5a2/m8cAJF8jH+d6Pv+GllYZXTjjG1CTo=@openvpn.net X-Google-Smtp-Source: AGHT+IH4dcgbrCp9b22gqFAO2wv+guoSC99cBmY2mb9xO/+nCpNU+pQi/V93BGTmd4JlZc4vx8Ks X-Received: by 2002:a05:6870:a116:b0:3d3:b66b:48e3 with SMTP id 586e51a60fabf-3daca105639mr466225fac.1.1761852616292; Thu, 30 Oct 2025 12:30:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1761852616; cv=none; d=google.com; s=arc-20240605; b=Auefs8XQ6DjUd9Gs6DHRsU8W6x7cg2kEOl30MvpoOrOWrxslCqj+03mK8RKZ0iz888 BwicjBvKTD+7GJ+/g8ETmcrndyDmxU82X7SIrxFpc46WaS6Tk1ZxIS4LG3nyTTJ1flpP sJXykDjExevf99cfKoWW84tNsOo8YVsTMLPT/2ellTp68G3Zsh1FUKKZsnlVeFg82Q/T aDD+LCsxfZnhboTOniOMgGxNeNIZwbnOj9RhSnRHPKo4wRE0/YgzHSg0rW+kYEh5IecT Z3cTKmGnok9KjCy+6ZGvR6krR9PqO1N8CH6fyRPCh15sf2VPIWwIOE4Ys2ilF/zuwBLF lD/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:dkim-signature; bh=bxtJqtHwXCpd4bovMzaOfZJUjEJLugnRUCyu7ScjI5Y=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=dfBxv0JO4xIVSk17KTPpZ42TEv5l95Y14k4CwVK6WDM12LRvJ/JEVB32nHkzDMFdjl b6RkjNrIXCfGYI0ruU/YFYfEQeXBhgTfyT646rpLSEDcIdR5sr1CjqMtqsSVyBORRc7b /+UTZsZtQTyBWL/PGy/IgqSQaPgOxl/LWfwXHj3jWB4hRECwl+pRlYXplkFOZR2AA5qY ZGMhjSYn6L3UcSLs5X1KOiI3unXbIvTT0fL9j9JB1p+J/4fmG30AiGRmci/cGuHpToc+ osskfcj07r6IsEXg7XfbkwMejzXKOt2MnM6gdWBOvCHM8GYS2I3+Fi5VHnbFdLpoDDb2 bf2Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=h3XBIghp; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=VMzLH7Rw; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=H6JaeSJP; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 586e51a60fabf-3dafd3f8a43si16167fac.326.2025.10.30.12.30.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Oct 2025 12:30:16 -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=pass header.i=@lists.sourceforge.net header.s=beta header.b=h3XBIghp; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=VMzLH7Rw; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=H6JaeSJP; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bxtJqtHwXCpd4bovMzaOfZJUjEJLugnRUCyu7ScjI5Y=; b=h3XBIghpiz3UM5DElp+GgX/7SU CC1mWniD7Jixjtsl6ONBmkarO5LQDW2BDTS7t5HSNY/i41ux3IqXjCcZncYJnSrCBeQi3fbzIupCx VlUlf9jh59cdgRb5yc//8SMx3oWWStX5iloYUc2JxZkI/QgQ+z/MVu17+xMxEtdD5J5s=; 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.95) (envelope-from ) id 1vEYLd-0008RG-Q7; Thu, 30 Oct 2025 19:30:13 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1vEYLc-0008RA-1j for openvpn-devel@lists.sourceforge.net; Thu, 30 Oct 2025 19:30:12 +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=ogtbxn7nZRchdb43v5VWw32NYjKG80mNHaUs1LwS1+Q=; b=VMzLH7RwuAj/V65u8o4oCPMgNW /UbffTmkTGmdTtCjEcDwxs6kZertAuXIxNNtwPUwUmbzwPmeHFb+fpHIe0GalYYlQmMV5PBTj6u2U DrBBOBOXUX5RLXM2ngCEpfeHnY/y2sOw3EFs0BxlVbUH0+bFSWu4FADTYmT9+IO6kWQQ=; 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=ogtbxn7nZRchdb43v5VWw32NYjKG80mNHaUs1LwS1+Q=; b=H6JaeSJPC0WOevGA7i2KZTvzmz XYCyCv7FcW4+RuV6oGjmhzqGCc/W/JVFwWSI+WUDqbIRPPPthmYrezv/htvYjcp24SHMCAVqXpdKf zG3Rc69d2UZ+KcDjbP8IpnzzWhXyCPWZkYsDxB042Fax7Cs0D5Jhyw0bF5hU0WjTl270=; Received: from [193.149.48.134] (helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1vEYLa-0000lu-RS for openvpn-devel@lists.sourceforge.net; Thu, 30 Oct 2025 19:30:11 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 59UJU4uc000389 for ; Thu, 30 Oct 2025 20:30:04 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 59UJU444000388 for openvpn-devel@lists.sourceforge.net; Thu, 30 Oct 2025 20:30:04 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Thu, 30 Oct 2025 20:29:57 +0100 Message-ID: <20251030193003.348-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.49.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-2.hosts.colo.sdot.me", 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: Arne Schwabe There is a theoretical possibility that OpenSSL returns an NID that OBJ_nid2sn cannot resolve and thus the function return NULL. This is however extremely unlikely. But we still cover this case now to make linters/code checker happy and avoid similar false positives in the future. Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1vEYLa-0000lu-RS Subject: [Openvpn-devel] [PATCH v2] Ensure that get_sigtype always return non-NULL 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?1847436368888879887?= X-GMAIL-MSGID: =?utf-8?q?1847436368888879887?= From: Arne Schwabe There is a theoretical possibility that OpenSSL returns an NID that OBJ_nid2sn cannot resolve and thus the function return NULL. This is however extremely unlikely. But we still cover this case now to make linters/code checker happy and avoid similar false positives in the future. Reported-by: Joshua Rogers Found-by: ZeroPath (https://zeropath.com/) Change-Id: I70e221ff5d9752fec17bad18fd41dcf188ae8fbc Signed-off-by: Arne Schwabe Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1325 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1325 This mail reflects revision 2 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/src/openvpn/ssl_openssl.c b/src/openvpn/ssl_openssl.c index d997141..a4a6863 100644 --- a/src/openvpn/ssl_openssl.c +++ b/src/openvpn/ssl_openssl.c @@ -2408,7 +2408,17 @@ return "(error getting name)"; default: - return OBJ_nid2sn(nid); + { + const char *type = OBJ_nid2sn(nid); + if (!type) + { + /* This is unlikely to ever happen as OpenSSL is unlikely to + * return an NID it cannot resolve itself but we silence + * linter/code checkers here */ + type = "(error getting name, OBJ_nid2sn failed)"; + } + return type; + } } } #endif /* ifndef LIBRESSL_VERSION_NUMBER */