public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephan Mueller <smueller@chronox.de>
To: Tadeusz Struk <tadeusz.struk@intel.com>
Cc: "'Herbert Xu" <herbert@gondor.apana.org.au>,
	"'Quentin Gouchet'" <quentin.gouchet@gmail.com>,
	Daniel Borkmann <dborkman@redhat.com>,
	linux-api@vger.kernel.org, linux-crypto@vger.kernel.org,
	linux-kernel@vger.kernel.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@intel.com>

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

  reply	other threads:[~2015-06-11 23:04 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
2015-06-11 22:59   ` Tadeusz Struk
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@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 \
    --cc=tadeusz.struk@intel.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