]> git.ipfire.org Git - thirdparty/openssh-portable.git/commit
upstream: Fix EVP_CIPHER_CTX_ctrl() return checks
authortb@openbsd.org <tb@openbsd.org>
Fri, 14 Mar 2025 09:49:49 +0000 (09:49 +0000)
committerDamien Miller <djm@mindrot.org>
Tue, 18 Mar 2025 04:56:36 +0000 (15:56 +1100)
commit0ce5281f017c3ad7bdcc2bbd9745119a73e0cbb8
treefd8296d5dd17ea05427e3ca0bca5faa3113295ea
parent2e81100763d5885e500f065b04c16ed87ce74318
upstream: Fix EVP_CIPHER_CTX_ctrl() return checks

While this API tries to translate negative return values (i.e. -1) to 0
in BoringSSL and LibreSSL, it is still possible for it to return negative
values in prinicple. We even incorrectly document that -1 can be returned
while Boring and OpenSSL plead the Fifth.

In OpenSSL 3 there are now code paths that explicitly return -1 and they
started shifting their return checks to <= 0 - of course they do this in
inconsistent and sometimes incorrect manner. While these paths aren't
reachable from ssh right now, who can really tell what happens in the two
hundred lines of inscrutable bloated mess this has become.

So error check with <= 0 to ensure that we don't accidentally translate an
error to success.

ok markus schwarze

OpenBSD-Commit-ID: a855c833cf4ecfce43bedc761f26ad924f70483c
cipher.c