The rsa_validate_keypair_multiprime() function return is not boolean

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)
This commit is contained in:
Matt Caswell 2022-06-24 11:01:22 +01:00 committed by Tomas Mraz
parent 08f876d0de
commit 518f1ee81d

View 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
}