From: Stephan Mueller <smueller@chronox.de>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Daniel Borkmann <dborkman@redhat.com>,
'Quentin Gouchet' <quentin.gouchet@gmail.com>,
'LKML' <linux-kernel@vger.kernel.org>,
linux-crypto@vger.kernel.org, linux-api@vger.kernel.org
Subject: Re: [PATCH v6 1/4] crypto: AF_ALG: add AEAD support
Date: Tue, 30 Dec 2014 22:30:28 +0100 [thread overview]
Message-ID: <2502404.xd4K6Vrf3P@tachyon.chronox.de> (raw)
In-Reply-To: <20141229173340.GA15790@gondor.apana.org.au>
Am Dienstag, 30. Dezember 2014, 04:33:41 schrieb Herbert Xu:
Hi Herbert,
> On Mon, Dec 29, 2014 at 04:05:40PM +0100, Stephan Mueller wrote:
> > This would mean that the check must stay in recvmsg as only here we know
> > that the caller wants data to be processed.
>
> On the send side you would do the check when MSG_MORE is unset.
> On the receive side you should stop waiting only when ctx->more
> is false and the send-side check succeeded.
>
> Perhaps rename ctx->more to ctx->done and then you can use it
> to indicate to the receive side that we're ready and have valid
> data for it. The receive side can then simply wait for ctx->done
> to become true.
I followed your advise and changed the sleep to wait for !ctx->more. Together
with the patch suggested below that was just released, I removed aead_readable
and aead_sufficient_data.
Though, I did not rename ctx->more to ctx->done due to the following:
- other AF_ALG implementations use ctx->more -- to aid code reviewers, I want
to keep the logic as close together as possible
- I do not want to negate the check for MSG_MORE -- at least for me, negating
flags always twists my mind when reading code.
The patch will come shortly after I tested all thoroughly.
>
> > > PS we should add a length check for missing/partial auth tags
> > > to crypto_aead_decrypt. We can then remove such checks from
> > > individual implementations.
> >
> > I agree in full here. Shall I create such a patch together with the AEAD
> > AF_ALG interface, or can we merge the AEAD without that patch now and
> > create a separate patch later?
>
> We should at least add a check in crypto_aead_decrypt first so as
> to guarantee nothing slips through.
>
> Thanks,
--
Ciao
Stephan
next prev parent reply other threads:[~2014-12-30 21:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-25 21:58 [PATCH v6 0/4] crypto: AF_ALG: add AEAD and RNG support Stephan Mueller
[not found] ` <5682082.ffPqvQlSqN-PJstQz4BMNNP20K/wil9xYQuADTiUCJX@public.gmane.org>
2014-12-25 21:59 ` [PATCH v6 2/4] crypto: AF_ALG: enable AEAD interface compilation Stephan Mueller
2014-12-25 22:00 ` [PATCH v6 3/4] crypto: AF_ALG: add random number generator support Stephan Mueller
[not found] ` <2323421.LJnyPUDp59-PJstQz4BMNNP20K/wil9xYQuADTiUCJX@public.gmane.org>
2014-12-29 10:41 ` Herbert Xu
2014-12-25 22:00 ` [PATCH v6 4/4] crypto: AF_ALG: enable RNG interface compilation Stephan Mueller
2014-12-29 10:41 ` Herbert Xu
[not found] ` <20141229104158.GB13699-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>
2014-12-31 7:57 ` Stephan Mueller
2014-12-25 22:01 ` [PATCH v6 1/4] crypto: AF_ALG: add AEAD support Stephan Mueller
[not found] ` <5002301.TQO37u96dE-PJstQz4BMNNP20K/wil9xYQuADTiUCJX@public.gmane.org>
2014-12-29 10:33 ` Herbert Xu
[not found] ` <20141229103319.GB13334-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>
2014-12-29 15:05 ` Stephan Mueller
[not found] ` <29582980.qoHS2EjmLy-PJstQz4BMNNP20K/wil9xYQuADTiUCJX@public.gmane.org>
2014-12-29 17:33 ` Herbert Xu
2014-12-30 21:03 ` Stephan Mueller
2014-12-30 21:30 ` Stephan Mueller [this message]
2014-12-29 10:20 ` [PATCH v6 0/4] crypto: AF_ALG: add AEAD and RNG support 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=2502404.xd4K6Vrf3P@tachyon.chronox.de \
--to=smueller@chronox.de \
--cc=dborkman@redhat.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-api@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quentin.gouchet@gmail.com \
/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).