From: Eric Biggers <ebiggers@kernel.org>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-crypto@vger.kernel.org
Subject: Re: [PATCH v2 5/7] crypto: gcm - fix incompatibility between "gcm" and "gcm_base"
Date: Thu, 18 Apr 2019 11:41:46 -0700 [thread overview]
Message-ID: <20190418184145.GB1827@sol.localdomain> (raw)
In-Reply-To: <20190418140006.x3aaja7vvntu6p5p@gondor.apana.org.au>
On Thu, Apr 18, 2019 at 10:00:06PM +0800, Herbert Xu wrote:
> Eric Biggers <ebiggers@kernel.org> wrote:
> >
> > @@ -638,7 +637,7 @@ static int crypto_gcm_create_common(struct crypto_template *tmpl,
> > goto err_free_inst;
> >
> > err = -EINVAL;
> > - if (ghash->digestsize != 16)
> > + if (strcmp(ghash->base.cra_name, "ghash") != 0)
> > goto err_drop_ghash;
>
> We should keep both tests because the self-tests can be compiled
> out so there is no guarantee that something claiming to be ghash
> actually is ghash.
>
I'm not necessarily opposed to doing this, but if we're assuming that untested,
arbitrarily broken algorithms may be registered with the crypto API under any
name, "ghash" could easily still be broken even if it declares a 16-byte digest
size. Verifying the digest size is just an extra sanity check; we're really
still relying on the implementation to be correct. (Same for the ccm patch.)
- Eric
next prev parent reply other threads:[~2019-04-18 18:41 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-10 6:46 [PATCH v2 0/7] crypto: fixes in preparation of new fuzz tests Eric Biggers
2019-04-10 6:46 ` [PATCH v2 1/7] crypto: lrw - don't access already-freed walk.iv Eric Biggers
2019-04-10 6:46 ` [PATCH v2 2/7] crypto: salsa20 " Eric Biggers
2019-04-10 19:18 ` Sasha Levin
2019-04-10 6:46 ` [PATCH v2 3/7] crypto: arm/aes-neonbs " Eric Biggers
2019-04-10 19:18 ` Sasha Levin
2019-04-10 6:46 ` [PATCH v2 4/7] crypto: arm64/aes-neonbs " Eric Biggers
2019-04-10 19:18 ` Sasha Levin
2019-04-10 6:46 ` [PATCH v2 5/7] crypto: gcm - fix incompatibility between "gcm" and "gcm_base" Eric Biggers
2019-04-10 19:18 ` Sasha Levin
2019-04-18 14:00 ` Herbert Xu
2019-04-18 18:41 ` Eric Biggers [this message]
2019-04-19 5:52 ` Herbert Xu
2019-04-10 6:46 ` [PATCH v2 6/7] crypto: ccm - fix incompatibility between "ccm" and "ccm_base" Eric Biggers
2019-04-10 19:18 ` Sasha Levin
2019-04-18 14:03 ` Herbert Xu
2019-04-10 6:46 ` [PATCH v2 7/7] crypto: vmx - return correct error code on failed setkey Eric Biggers
2019-04-10 18:08 ` [PATCH v2 0/7] crypto: fixes in preparation of new fuzz tests Ard Biesheuvel
2019-04-18 14:24 ` 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=20190418184145.GB1827@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).