From: "cron2 (Code Review)" Date: Thu, 30 Oct 2025 21:06:01 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <8994170facf4837fac6184177776bcc81ec71b4d-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="YHS+iiphJTY="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: Ensure that get_sigtype always return non-NULL List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --YHS+iiphJTY= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#3) to the change originally created by= plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/1325?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by cron2 Change subject: Ensure that get_sigtype always return non-NULL ...................................................................... Ensure that get_sigtype always return non-NULL 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 Message-Id: <20251030193003.348-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34= 060.html Signed-off-by: Gert Doering --- M src/openvpn/ssl_openssl.c 1 file changed, 11 insertions(+), 1 deletion(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/25/1325/3 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 =3D 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 =3D "(error getting name, OBJ_nid2sn failed)"; + } + return type; + } } } #endif /* ifndef LIBRESSL_VERSION_NUMBER */ -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1325?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newpatchset Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I70e221ff5d9752fec17bad18fd41dcf188ae8fbc Gerrit-Change-Number: 1325 Gerrit-PatchSet: 3 Gerrit-Owner: plaisthos Gerrit-Reviewer: cron2 Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel --YHS+iiphJTY= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 upl= oaded patch set #3 to the change originally created by plaisthos.<= /p>

Vi= ew Change

The following approvals got outdated and were removed: Code-Review+2 by cron2

Ensure that get_sigtype always retu=
rn non-NULL

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 no= w
to make linters/code checker happy and avoid similar false positivesin the future.

Reported-by: Joshua Rogers <contact@...2949...&g= t;
Found-by: ZeroPath (https://zeropath.com/)
Change-Id: I70e221ff5d9= 752fec17bad18fd41dcf188ae8fbc
Signed-off-by: Arne Schwabe <arne@...1711...= 27...>
Acked-by: Gert Doering <gert@...1296...>
Gerrit URL: = https://gerrit.openvpn.net/c/openvpn/+/1325
Message-Id: <202510301930= 03.348-1-gert@...1296...>
URL: https://www.mail-archive.com/openvpn-d= evel@lists.sourceforge.net/msg34060.html
Signed-off-by: Gert Doering <= ;gert@...1296...>
---
M src/openvpn/ssl_openssl.c
1 file change= d, 11 insertions(+), 1 deletion(-)

git pull ssh:=
//gerrit.openvpn.net:29418/openvpn refs/changes/25/1325/3
diff --=
git a/src/openvpn/ssl_openssl.c b/src/openvpn/ssl_openssl.c
index d997141..a4a6863 100644
--- a/src/openvpn/ssl_openss= l.c
+++ b/src/openvpn/ssl_openssl.c
@@ -240= 8,7 +2408,17 @@
return "(error getting na= me)";

default:
- return OBJ_nid2sn(nid)= ;
+ {+ const char *type= =3D 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 h= ere */
+ = type =3D "(error getting name, OBJ_nid2sn failed)";
= + }
+ return type;
<= span style=3D"color: hsl(120, 100%, 40%);">+ }
= }
}
#endif /* ifndef LIBRESSL_VERSION_NUM= BER */

To view, visit change 1325. To unsub= scribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I70e221ff5d9752fec17bad18fd4= 1dcf188ae8fbc
Gerrit-Change-Number: 1325
Gerrit-PatchSet: 3
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --YHS+iiphJTY=--