mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tim Chen <tim.c.chen@linux.intel.com>
To: Herbert Xu <herbert@gondor.apana.org.au>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	"; linux-crypto" <linux-crypto@vger.kernel.org>,
	"megha.dey" <megha.dey@intel.com>
Subject: ahash alg that does not implement import/export failed to register
Date: Fri, 18 Dec 2015 17:31:34 -0800	[thread overview]
Message-ID: <1450488694.30844.11.camel@schen9-desk2.jf.intel.com> (raw)

Herbert,

There are some ahash algorithms like x86's sha1-mb and
ghash that failed to register because of the newly added
check of non-zero statesize from commit 8996eafd.  But
since there are algorithms that do not implement an import or
export, there is no state required for them.  Wonder if the check
should be modified to something like:

diff --git a/crypto/ahash.c b/crypto/ahash.c
index 9c1dc8d..f512183 100644
--- a/crypto/ahash.c
+++ b/crypto/ahash.c
@@ -544,7 +544,10 @@ static int ahash_prepare_alg(struct ahash_alg *alg)
        struct crypto_alg *base = &alg->halg.base;
 
        if (alg->halg.digestsize > PAGE_SIZE / 8 ||
-           alg->halg.statesize > PAGE_SIZE / 8 ||
+           alg->halg.statesize > PAGE_SIZE / 8)
+               return -EINVAL;
+
+       if ((alg->import || alg->export) &&
            alg->halg.statesize == 0)
                return -EINVAL;

Thanks.

Tim


             reply	other threads:[~2015-12-19  1:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-19  1:31 Tim Chen [this message]
2015-12-19  2:33 ` Herbert Xu
     [not found]   ` <568E7AFB.8080905@amd.com>
2016-01-08  9:54     ` Herbert Xu

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=1450488694.30844.11.camel@schen9-desk2.jf.intel.com \
    --to=tim.c.chen@linux.intel.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=megha.dey@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®