]> git.ipfire.org Git - thirdparty/openssl.git/commit
Make error checks on RSA_public_decrypt() consistent
authorNiels Dossche <niels.dossche@ugent.be>
Tue, 19 Aug 2025 20:56:38 +0000 (22:56 +0200)
committerTomas Mraz <tomas@openssl.org>
Thu, 21 Aug 2025 18:05:07 +0000 (20:05 +0200)
commit26ea7076f53573cc0fc9544c1785d3b4145111ee
tree89614203fb92ef81db60ad7191045e071e050c25
parent743dad6ffec8a1ad59c138b16c5b31ef9e43a7ec
Make error checks on RSA_public_decrypt() consistent

Some are only checking for a value < 0, some for <= 0, some for == 0, etc.
The documentation tells us that -1 is returned on error, so at least the
== 0 ones are wrong. In general, the return values are checked
inconsistently. This patch makes the return value checks consistent to
the form that seems to occur most.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28306)

(cherry picked from commit 3e2f54a718f541b02b599bbf5109587189368e4d)
crypto/rsa/rsa_pmeth.c
providers/implementations/signature/rsa_sig.c