]> 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:13 +0000 (20:05 +0200)
commite036da34fe8d21407290ec16b382d6db7f2ef687
tree7d5bfce94c03b1c6abf34befc2aad3d76c39a297
parent866cb2ce2bf2eae88833731bf24c249de5111bff
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