All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Tadeusz Struk <tadeusz.struk@intel.com>
Cc: qat-linux@intel.com, linux-crypto@vger.kernel.org
Subject: Re: crypto: qat - Add support for RSA algorithm
Date: Mon, 20 Jul 2015 21:59:02 +0300	[thread overview]
Message-ID: <20150720185902.GL5422@mwanda> (raw)
In-Reply-To: <55AD1E2C.5090302@intel.com>

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

      reply	other threads:[~2015-07-20 18:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-20 15:12 crypto: qat - Add support for RSA algorithm Dan Carpenter
2015-07-20 15:12 ` Dan Carpenter
2015-07-20 16:13 ` Tadeusz Struk
2015-07-20 18:59   ` Dan Carpenter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150720185902.GL5422@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=qat-linux@intel.com \
    --cc=tadeusz.struk@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.