On 07/20/2015 08:12 AM, Dan Carpenter wrote:
The patch a990532023b9: "crypto: qat - Add support for RSA algorithm"
from Jul 15, 2015, leads to the following Smatch warning:
drivers/crypto/qat/qat_common/qat_asym_algs.c:446 qat_rsa_get_n()
warn: was && intended here instead of ||?
drivers/crypto/qat/qat_common/qat_asym_algs.c
444 ret = -EINVAL;
445 /* In FIPS mode only allow key size 2K & 3K */
446 if (fips_enabled && (ctx->key_sz != 256 || ctx->key_sz != 384)) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Looks like the static checker is correct.
The logic is if fips_enabled we want to accept only key size 2K (256 bytes) or 3K (384 bytes)
so the condition looks ok to me. Maybe the comment above is misleading?
regards,
T