From: Stephan Mueller <smueller-T9tCv8IpfcWELgA04lAiVw@public.gmane.org>
To: Tadeusz Struk <tadeusz.struk-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: 'Herbert Xu
<herbert-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>,
'Quentin Gouchet'
<quentin.gouchet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Daniel Borkmann
<dborkman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-crypto-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v13 1/2] crypto: AF_ALG: add AEAD support
Date: Fri, 12 Jun 2015 01:03:50 +0200 [thread overview]
Message-ID: <3778379.0alfAEIvmc@tauon.atsec.com> (raw)
In-Reply-To: <557A12D1.90409-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Am Thursday 11 June 2015, 15:59:29 schrieb Tadeusz Struk:
Hi Tadeusz,
>Hi Stephan,
>
>On 02/28/2015 11:50 AM, Stephan Mueller wrote:
>> + err = af_alg_wait_for_completion(ctx->enc ?
>> + crypto_aead_encrypt(&ctx->aead_req) :
>> + crypto_aead_decrypt(&ctx->aead_req),
>> + &ctx->completion);
>> +
>> + if (err) {
>> + /* EBADMSG implies a valid cipher operation took place */
>> + if (err == -EBADMSG)
>> + aead_put_sgl(sk);
>> + goto unlock;
>
>Shouldn't we free the TX sgl regardless of the error was?
>Or do we expect that the user will try to read again and it will be Ok the
>second time? Hope you still remember :)
It is the latter: as the crypto was not completed properly, leave the data in
memory. This may allow a user to send more data if he needs to for completing
the AEAD operation.
Ciao
Stephan
next prev parent reply other threads:[~2015-06-11 23:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-28 19:49 [PATCH v13 0/2] crypto: AF_ALG: add AEAD support Stephan Mueller
2015-02-28 19:50 ` [PATCH v13 1/2] " Stephan Mueller
[not found] ` <14853152.iudhcNpbrH-PJstQz4BMNNP20K/wil9xYQuADTiUCJX@public.gmane.org>
2015-06-11 22:59 ` Tadeusz Struk
[not found] ` <557A12D1.90409-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-06-11 23:03 ` Stephan Mueller [this message]
2015-02-28 19:50 ` [PATCH v13 2/2] crypto: AF_ALG: enable AEAD interface compilation Stephan Mueller
2015-03-04 9:16 ` [PATCH v13 0/2] crypto: AF_ALG: add AEAD support Herbert Xu
2015-03-04 9:25 ` 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=3778379.0alfAEIvmc@tauon.atsec.com \
--to=smueller-t9tcv8ipfcwelga04laivw@public.gmane.org \
--cc=dborkman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=herbert-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org \
--cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-crypto-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=quentin.gouchet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=tadeusz.struk-ral2JQCrhuEAvxtiuMwx3w@public.gmane.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).