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.biesheu...@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 <gmazyl...@gmail.com>

Thanks,
Milan

Reply via email to