]> git.ipfire.org Git - thirdparty/openssl.git/commit
More correctly handle a selected_len of 0 when processing NPN
authorMatt Caswell <matt@openssl.org>
Fri, 31 May 2024 10:18:27 +0000 (11:18 +0100)
committerMatt Caswell <matt@openssl.org>
Thu, 27 Jun 2024 09:32:15 +0000 (10:32 +0100)
commitc015a9dcb0e0e5edf2d870181a6c9ba9a1305722
tree3f9b8d9443c3f84346b4ab686795f778771c30bc
parente86ac436f0bd54d4517745483e2315650fae7b2c
More correctly handle a selected_len of 0 when processing NPN

In the case where the NPN callback returns with SSL_TLEXT_ERR_OK, but
the selected_len is 0 we should fail. Previously this would fail with an
internal_error alert because calling OPENSSL_malloc(selected_len) will
return NULL when selected_len is 0. We make this error detection more
explicit and return a handshake failure alert.

Follow on from CVE-2024-5535

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24716)

(cherry picked from commit c6e1ea223510bb7104bf0c41c0c45eda5a16b718)
ssl/statem/extensions_clnt.c