Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Stephan Mueller <smueller@chronox.de>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: 'LKML' <linux-kernel@vger.kernel.org>, linux-crypto@vger.kernel.org
Subject: Re: [PATCH] crypto: AEAD: add check for presence of auth tag
Date: Mon, 05 Jan 2015 11:26:48 +0100	[thread overview]
Message-ID: <7639295.Yx6QIQScqO@tachyon.chronox.de> (raw)
In-Reply-To: <20150105101901.GA24736@gondor.apana.org.au>

Am Montag, 5. Januar 2015, 21:19:01 schrieb Herbert Xu:

Hi Herbert,

> On Tue, Dec 30, 2014 at 10:16:03PM +0100, Stephan Mueller wrote:
> > The AEAD decryption operation requires the authentication tag to be
> > present as part of the cipher text buffer. The added check verifies that
> > the caller provides a cipher text buffer with at least the
> > authentication tag.
> > 
> > As the cipher text is provided as a scatterlist, loop through the
> > scatterlist until we know we have sufficient cipher text bytes to invoke
> > the AEAD decryption operation.
> 
> There is no need to vet the scatterlist.  For kernel users it's
> up to them to ensure that the length is valid with respect to the
> sg list.
> 
> For the user-space interface obviously you should ensure that a
> valid length is supplied.

Then it seems I misunderstood you in your last comments. I thought the check 
that the authentication tag is present should be moved to the crypto API so 
that all users benefit from it.

As the authentication tag is "inline" in the ciphertext data stream, the only 
way I see to check for its presence is to verify that sufficient ciphertext is 
provided.

If the AEAD user space interface should perform the check, then the code drop 
provided with patch v6 would already cover that.

Could you please help me understand where that check should be and what should 
be done at the crypto API level?

Thanks

-- 
Ciao
Stephan

  reply	other threads:[~2015-01-05 10:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-30 21:16 [PATCH] crypto: AEAD: add check for presence of auth tag Stephan Mueller
2015-01-05 10:19 ` Herbert Xu
2015-01-05 10:26   ` Stephan Mueller [this message]
2015-01-05 10:39     ` Herbert Xu
2015-01-05 10:53       ` Stephan Mueller
2015-01-05 10:55         ` Herbert Xu
2015-01-05 11:00           ` Stephan Mueller

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=7639295.Yx6QIQScqO@tachyon.chronox.de \
    --to=smueller@chronox.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@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