Skip to content

Commit 573ccf8

Browse files
Max Fillingercron2
authored andcommitted
Mbed TLS: Error out if we have no valid tls-groups
Previously, when no valid groups were specified with the tls-groups option, the Mbed TLS build of OpenVPN would start up and run, but fail to complete a handshake, while the OpenSSL build would exit with an error. This commit changes the behavior of the Mbed TLS build to match the OpenSSL version. Change-Id: Ica5f37e525c3812609021750ecd3986c1420e2a4 Signed-off-by: Max Fillinger <maximilian.fillinger@sentyron.com> Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1633 Message-Id: <20260421055357.21708-1-gert@greenie.muc.de> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36699.html Signed-off-by: Gert Doering <gert@greenie.muc.de> (cherry picked from commit b2e3e0f)
1 parent 6ad8be3 commit 573ccf8

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/openvpn/ssl_mbedtls.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,12 @@ tls_ctx_set_tls_groups(struct tls_root_ctx *ctx, const char *groups)
450450
}
451451
}
452452

453+
/* Check if any groups were valid. */
454+
if (i == 0)
455+
{
456+
msg(M_FATAL, "Error: All groups in \"%s\" are invalid or unsupported.", groups);
457+
}
458+
453459
/* Recent mbedtls versions state that the list of groups must be terminated
454460
* with 0. Older versions state that it must be terminated with MBEDTLS_ECP_DP_NONE
455461
* which is also 0, so this works either way. */

0 commit comments

Comments
 (0)