Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1295257 > unrolled thread

ahash alg that does not implement import/export failed to register

Started byTim Chen <tim.c.chen@linux.intel.com>
First post2015-12-19 02:40 +0100
Last post2015-12-19 03:40 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  ahash alg that does not implement import/export failed to register Tim Chen <tim.c.chen@linux.intel.com> - 2015-12-19 02:40 +0100
    Re: ahash alg that does not implement import/export failed to  register Herbert Xu <herbert@gondor.apana.org.au> - 2015-12-19 03:40 +0100

#1295257 — ahash alg that does not implement import/export failed to register

FromTim Chen <tim.c.chen@linux.intel.com>
Date2015-12-19 02:40 +0100
Subjectahash alg that does not implement import/export failed to register
Message-ID<qHeF3-4Zt-9@gated-at.bofh.it>
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1295272 — Re: ahash alg that does not implement import/export failed to register

FromHerbert Xu <herbert@gondor.apana.org.au>
Date2015-12-19 03:40 +0100
SubjectRe: ahash alg that does not implement import/export failed to register
Message-ID<qHfB8-5yW-5@gated-at.bofh.it>
In reply to#1295257
On Fri, Dec 18, 2015 at 05:31:34PM -0800, Tim Chen wrote:
> 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:

No import and export are required by algif_hash so they must be
implemented.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web