]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
The rsa_validate_keypair_multiprime() function return is not boolean
authorMatt Caswell <matt@openssl.org>
Fri, 24 Jun 2022 10:01:22 +0000 (11:01 +0100)
committerTomas Mraz <tomas@openssl.org>
Tue, 28 Jun 2022 15:05:10 +0000 (17:05 +0200)
A -ve return value from this function indicates an error which we should
treat as a failure to validate.

Fixes #18538

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18651)

crypto/rsa/rsa_chk.c

index 01fe9ead69b684b08e7e5200bd2d761a7692daa3..8ab116687427f5e1f179710732f696adfc1d462e 100644 (file)
@@ -245,7 +245,7 @@ int ossl_rsa_validate_pairwise(const RSA *key)
 #ifdef FIPS_MODULE
     return ossl_rsa_sp800_56b_check_keypair(key, NULL, -1, RSA_bits(key));
 #else
-    return rsa_validate_keypair_multiprime(key, NULL);
+    return rsa_validate_keypair_multiprime(key, NULL) > 0;
 #endif
 }