]> 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:30:51 +0000 (10:30 +0100)
commitc6e1ea223510bb7104bf0c41c0c45eda5a16b718
treeef0c68b944d69f3c91e12b1ef21a9a297482c613
parent2ebbe2d7ca8551c4cb5fbb391ab9af411708090e
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)
ssl/statem/extensions_clnt.c