FIPS: Fix compiler errors in rsa_chk.c when building with `-DFIPS_MODE`
authorDr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Mon, 29 Apr 2019 17:12:38 +0000 (19:12 +0200)
committerDr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Tue, 30 Apr 2019 12:02:22 +0000 (14:02 +0200)
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8843)

crypto/rsa/rsa_chk.c

index 4f65dfa64b882342aff8d8d45113a7988cde767d..96a13b33305ae1449b40dfa83f7f35a7407413b5 100644 (file)
@@ -25,11 +25,9 @@ int RSA_check_key(const RSA *key)
 int RSA_check_key_ex(const RSA *key, BN_GENCB *cb)
 {
 #ifdef FIPS_MODE
-    if (!(rsa_sp800_56b_check_public(key)
-            && rsa_sp800_56b_check_private(key)
-            && rsa_sp800_56b_check_keypair(key, NULL, -1, RSA_bits(key))
-        return 0;
-
+    return rsa_sp800_56b_check_public(key)
+               && rsa_sp800_56b_check_private(key)
+               && rsa_sp800_56b_check_keypair(key, NULL, -1, RSA_bits(key));
 #else
     BIGNUM *i, *j, *k, *l, *m;
     BN_CTX *ctx;