From: Matt Caswell Date: Fri, 21 Jun 2024 09:41:55 +0000 (+0100) Subject: Correct return values for tls_construct_stoc_next_proto_neg X-Git-Tag: openssl-3.3.2~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=311babac7f52d75bcaa8c8b812758ca08b3bf004;p=thirdparty%2Fopenssl.git Correct return values for tls_construct_stoc_next_proto_neg Return EXT_RETURN_NOT_SENT in the event that we don't send the extension, rather than EXT_RETURN_SENT. This actually makes no difference at all to the current control flow since this return value is ignored in this case anyway. But lets make it correct anyway. Follow on from CVE-2024-5535 Reviewed-by: Tomas Mraz Reviewed-by: Neil Horman (Merged from https://github.com/openssl/openssl/pull/24716) (cherry picked from commit e10a3a84bf73a3e6024c338b51f2fb4e78a3dee9) --- diff --git a/ssl/statem/extensions_srvr.c b/ssl/statem/extensions_srvr.c index afa33ce3f55..15f16dc9925 100644 --- a/ssl/statem/extensions_srvr.c +++ b/ssl/statem/extensions_srvr.c @@ -1516,9 +1516,10 @@ EXT_RETURN tls_construct_stoc_next_proto_neg(SSL_CONNECTION *s, WPACKET *pkt, return EXT_RETURN_FAIL; } s->s3.npn_seen = 1; + return EXT_RETURN_SENT; } - return EXT_RETURN_SENT; + return EXT_RETURN_NOT_SENT; } #endif