From: "plaisthos (Code Review)" Date: Wed, 29 Oct 2025 11:30:50 +0000 References: Reply-To: arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <44a3f5a239d65cbe0e3b9d4ea3e7f512e7ad3b46-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="ozkiDa9PGGo="; 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 --ozkiDa9PGGo= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld. Hello flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1325?usp=3Demail to review the following change. 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, 9 insertions(+), 1 deletion(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/25/1325/1 diff --git a/src/openvpn/ssl_openssl.c b/src/openvpn/ssl_openssl.c index d997141..1e1912e 100644 --- a/src/openvpn/ssl_openssl.c +++ b/src/openvpn/ssl_openssl.c @@ -2408,7 +2408,15 @@ 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: newchange Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I70e221ff5d9752fec17bad18fd41dcf188ae8fbc Gerrit-Change-Number: 1325 Gerrit-PatchSet: 1 Gerrit-Owner: plaisthos Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel Gerrit-Attention: flichtenheld --ozkiDa9PGGo= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: flichtenheld.

plaisthos would like flichtenheld to review this change.

V= iew Change

Ensure that get_sigtype always return non-N=
ULL

There is a theoretical possibility that OpenSSL returns an NID t= hat
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 <contact@...2949...>
Fo= und-by: ZeroPath (https://zeropath.com/)
Change-Id: I70e221ff5d9752fec17= bad18fd41dcf188ae8fbc
Signed-off-by: Arne Schwabe <arne@...1227...>= ;
---
M src/openvpn/ssl_openssl.c
1 file changed, 9 insertions(+),= 1 deletion(-)

git pull ssh://gerrit.openvpn.net=
:29418/openvpn refs/changes/25/1325/1
diff --git a/src/openvpn/ssl_=
openssl.c b/src/openvpn/ssl_openssl.c
index d997141..1e1912= e 100644
--- a/src/openvpn/ssl_openssl.c
++= + b/src/openvpn/ssl_openssl.c
@@ -2408,7 +2408,15 @@=
return "(error getting name)";
<= span>
default:
- return OBJ_nid2sn(nid);
+ const char *type =3D OBJ_nid= 2sn(nid);
+ = if (!type)
+ = {
+ = /* This is unlikely to ever happen as OpenSSL is unlikely to
<= span style=3D"color: hsl(120, 100%, 40%);">+ * return an NI= D 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_NUMB= ER */

To view, visit change 1325. To unsubs= cribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I70e221ff5d9752fec17bad18fd4= 1dcf188ae8fbc
Gerrit-Change-Number: 1325
Gerrit-PatchSet: 1
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...>
= --ozkiDa9PGGo=--