Re: crypto: qat - Add support for RSA algorithm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 20, 2015 at 09:13:32AM -0700, Tadeusz Struk wrote:
> 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?

Logically ->key_sz can't be both 256 and 384 at the same time.  What you
are describing is &&.  This seems like an important function, my guess
is we have never tested it with fips_enabled?

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux