mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* ahash alg that does not implement import/export failed to register
@ 2015-12-19  1:31 Tim Chen
  2015-12-19  2:33 ` Herbert Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Tim Chen @ 2015-12-19  1:31 UTC (permalink / raw)
  To: Herbert Xu, Russell King - ARM Linux
  Cc: linux-kernel, ; linux-crypto, megha.dey

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-01-08  9:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-19  1:31 ahash alg that does not implement import/export failed to register Tim Chen
2015-12-19  2:33 ` Herbert Xu
     [not found]   ` <568E7AFB.8080905@amd.com>
2016-01-08  9:54     ` Herbert Xu

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®