From: "plaisthos (Code Review)" Date: Wed, 29 Oct 2025 11:48:44 +0000 In-Reply-To: References: Reply-To: arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <293af57cba2cc31607665874fd7260bb6043e9e5-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="EWRmih9yJtg="; 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: flichtenheld Cc: openvpn-devel --EWRmih9yJtg= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld. Hello flichtenheld,=20 I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/1325?usp=3Demail to look at the new patch set (#2). 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 --- 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/2 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: 2 Gerrit-Owner: plaisthos Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel Gerrit-Attention: flichtenheld --EWRmih9yJtg= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: flichtenheld.

plaisthos uploaded patch set #2 to this change.

<= a href=3D"http://gerrit.openvpn.net/c/openvpn/+/1325?usp=3Demail">View Chan= ge

Ensure that get_sigtype always return non-NULL
<= br>There is a theoretical possibility that OpenSSL returns an NID that
O= BJ_nid2sn cannot resolve and thus the function return NULL.

This is = however extremely unlikely. But we still cover this case now
to make lin= ters/code checker happy and avoid similar false positives
in the future.=

Reported-by: Joshua Rogers <contact@...2949...>
Found-by: = ZeroPath (https://zeropath.com/)
Change-Id: I70e221ff5d9752fec17bad18fd4= 1dcf188ae8fbc
Signed-off-by: Arne Schwabe <arne@...1227...>
---=
M src/openvpn/ssl_openssl.c
1 file changed, 11 insertions(+), 1 dele= tion(-)

git pull ssh://gerrit.openvpn.net:29418/=
openvpn refs/changes/25/1325/2
diff --git a/src/openvpn/ssl_openssl=
.c b/src/openvpn/ssl_openssl.c
index d997141..a4a6863 10064= 4
--- a/src/openvpn/ssl_openssl.c
+++ b/src= /openvpn/ssl_openssl.c
@@ -2408,7 +2408,17 @@
return "(error getting name)";
<= /span>
default:
- return OBJ_nid2sn(nid);
+ {
+ const char *type =3D OBJ_nid2sn(nid);<= br>+ if (!type)
+ {
= + /* This is unl= ikely to ever happen as OpenSSL is unlikely to
+ * return an NID it cannot resol= ve itself but we silence
+ * linter/code checkers here */
+ type =3D "(error get= ting name, OBJ_nid2sn failed)";
+ }
+ return type;
+ }
}
}<= br> #endif /* ifndef LIBRESSL_VERSION_NUMBER */

To view, visit change 1325. To unsubscribe, 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: 2
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
= --EWRmih9yJtg=--