From: "Stephan Müller" <smueller@chronox.de>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: stable@vger.kernel.org, linux-crypto@vger.kernel.org
Subject: Re: [PATCH] crypto: authenc - cryptlen must be at least AAD len
Date: Thu, 07 Sep 2017 07:48:53 +0200 [thread overview]
Message-ID: <3142753.SSoe9WBuHN@positron.chronox.de> (raw)
In-Reply-To: <20170907035405.GA20751@gondor.apana.org.au>
Am Donnerstag, 7. September 2017, 05:54:05 CEST schrieb Herbert Xu:
Hi Herbert,
> >
> > What is your opinion: should this check be rather added to
> > crypto_aead_encrypt (similar to a sanity check found in
> > crypto_aead_decrypt)?
>
> Doesn't this apply to decryption as well?
There is already such check:
static inline int crypto_aead_decrypt(struct aead_request *req)
{
struct crypto_aead *aead = crypto_aead_reqtfm(req);
if (req->cryptlen < crypto_aead_authsize(aead))
return -EINVAL;
...
> Perhaps we can simply
> truncate assoclen in aead_request_set_ad.
I am not sure that would work because at the time we set the AAD len, we may
not yet have cryptlen. I.e. aead_request_set_ad may be called before
aead_request_set_crypt.
Ciao
Stephan
next prev parent reply other threads:[~2017-09-07 5:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-06 19:22 [PATCH] crypto: authenc - cryptlen must be at least AAD len Stephan Müller
2017-09-06 20:10 ` Stephan Müller
2017-09-07 3:54 ` Herbert Xu
2017-09-07 5:48 ` Stephan Müller [this message]
2017-09-07 6:01 ` Herbert Xu
2017-09-07 6:04 ` Stephan Mueller
2017-09-07 6:09 ` Herbert Xu
2017-09-08 22:20 ` [PATCH v2] crypto: add NULL check to scatterwalk_start Stephan Müller
2017-09-08 23:01 ` Stephan Müller
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=3142753.SSoe9WBuHN@positron.chronox.de \
--to=smueller@chronox.de \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=stable@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