linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Milan Broz <gmazyland@gmail.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>, linux-crypto@vger.kernel.org
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	Eric Biggers <ebiggers@google.com>,
	dm-devel@redhat.com, linux-fscrypt@vger.kernel.org,
	Gilad Ben-Yossef <gilad@benyossef.com>
Subject: Re: [PATCH v6 3/7] md: dm-crypt: infer ESSIV block cipher from cipher string directly
Date: Mon, 1 Jul 2019 10:58:47 +0200	[thread overview]
Message-ID: <767ec609-d805-9bc2-1a73-d5000ce7f109@gmail.com> (raw)
In-Reply-To: <20190628152112.914-4-ard.biesheuvel@linaro.org>

On 28/06/2019 17:21, Ard Biesheuvel wrote:
> Instead of allocating a crypto skcipher tfm 'foo' and attempting to
> infer the encapsulated block cipher from the driver's 'name' field,
> directly parse the string that we used to allocated the tfm. These
> are always identical (unless the allocation failed, in which case
> we bail anyway), but using the string allows us to use it in the
> allocation, which is something we will need when switching to the
> 'essiv' crypto API template.
> 
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

>  drivers/md/dm-crypt.c | 35 +++++++++-----------

> @@ -2445,21 +2451,10 @@ static int crypt_ctr_cipher_new(struct dm_target *ti, char *cipher_in, char *key
>  
>  	/* Alloc AEAD, can be used only in new format. */

^^ This comment is now obsolete, please move it with the code or remove it.

>  	if (crypt_integrity_aead(cc)) {
> -		ret = crypt_ctr_auth_cipher(cc, cipher_api);
> -		if (ret < 0) {
> -			ti->error = "Invalid AEAD cipher spec";
> -			return -ENOMEM;
> -		}
>  		cc->iv_size = crypto_aead_ivsize(any_tfm_aead(cc));
>  	} else
>  		cc->iv_size = crypto_skcipher_ivsize(any_tfm(cc));

Otherwise

Reviewed-by: Milan Broz <gmazyland@gmail.com>

Thanks,
Milan


  reply	other threads:[~2019-07-01  8:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-28 15:21 [PATCH v6 0/7] crypto: switch to crypto API for ESSIV generation Ard Biesheuvel
2019-06-28 15:21 ` [PATCH v6 1/7] crypto: essiv - create wrapper template " Ard Biesheuvel
2019-06-29  4:23   ` Eric Biggers
2019-06-28 15:21 ` [PATCH v6 2/7] fs: crypto: invoke crypto API for ESSIV handling Ard Biesheuvel
2019-06-28 18:00   ` Eric Biggers
2019-06-28 18:09     ` Ard Biesheuvel
2019-06-28 15:21 ` [PATCH v6 3/7] md: dm-crypt: infer ESSIV block cipher from cipher string directly Ard Biesheuvel
2019-07-01  8:58   ` Milan Broz [this message]
2019-06-28 15:21 ` [PATCH v6 4/7] md: dm-crypt: switch to ESSIV crypto API template Ard Biesheuvel
2019-07-01  8:59   ` Milan Broz
2019-07-02  8:07     ` Ard Biesheuvel
2019-07-02 16:30     ` Ard Biesheuvel
2019-06-28 15:21 ` [PATCH v6 5/7] crypto: essiv - add test vector for essiv(cbc(aes),aes,sha256) Ard Biesheuvel
2019-06-28 15:21 ` [PATCH v6 6/7] crypto: arm64/aes-cts-cbc - factor out CBC en/decryption of a walk Ard Biesheuvel
2019-06-28 15:21 ` [PATCH v6 7/7] crypto: arm64/aes - implement accelerated ESSIV/CBC mode Ard Biesheuvel

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=767ec609-d805-9bc2-1a73-d5000ce7f109@gmail.com \
    --to=gmazyland@gmail.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=dm-devel@redhat.com \
    --cc=ebiggers@google.com \
    --cc=gilad@benyossef.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-fscrypt@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;
as well as URLs for NNTP newsgroup(s).