]> 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:37:54 +0000 (10:37 +0100)
commit4279c89a726025c758db3dafb263b17e52211304
tree088d64aa0ba92f5ea077bad75f86ee7551668be6
parent4ada436a1946cbb24db5ab4ca082b69c1bc10f37
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: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24718)
ssl/statem/extensions_clnt.c