Re: [PATCH v2 0/4] crypto: switch to crypto API for ESSIV generation

2019-06-18 Thread Milan Broz
On 18/06/2019 23:27, Ard Biesheuvel wrote: > This series creates an ESSIV template that produces a skcipher or AEAD > transform based on a tuple of the form ',,' > (or ',,' for the AEAD case). It exposes the > encapsulated sync or async skcipher/aead by passing through all operations, > while using

[PATCH v2 1/4] crypto: essiv - create wrapper template for ESSIV generation

2019-06-18 Thread Ard Biesheuvel
Implement a template that wraps a (skcipher,cipher,shash) or (aead,cipher,shash) tuple so that we can consolidate the ESSIV handling in fscrypt and dm-crypt and move it into the crypto API. This will result in better test coverage, and will allow future changes to make the bare cipher interface int

[PATCH v2 2/4] fs: crypto: invoke crypto API for ESSIV handling

2019-06-18 Thread Ard Biesheuvel
Instead of open coding the calculations for ESSIV handling, use a ESSIV skcipher which does all of this under the hood. Signed-off-by: Ard Biesheuvel --- fs/crypto/Kconfig | 1 + fs/crypto/crypto.c | 5 -- fs/crypto/fscrypt_private.h | 9 -- fs/crypto/keyinfo.c | 88

[PATCH v2 3/4] md: dm-crypt: infer ESSIV block cipher from cipher string directly

2019-06-18 Thread Ard Biesheuvel
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

[PATCH v2 4/4] md: dm-crypt: switch to ESSIV crypto API template

2019-06-18 Thread Ard Biesheuvel
Replace the explicit ESSIV handling in the dm-crypt driver with calls into the crypto API, which now possesses the capability to perform this processing within the crypto subsystem. Signed-off-by: Ard Biesheuvel --- drivers/md/Kconfig| 1 + drivers/md/dm-crypt.c | 208 +++-

[PATCH v2 0/4] crypto: switch to crypto API for ESSIV generation

2019-06-18 Thread Ard Biesheuvel
This series creates an ESSIV template that produces a skcipher or AEAD transform based on a tuple of the form ',,' (or ',,' for the AEAD case). It exposes the encapsulated sync or async skcipher/aead by passing through all operations, while using the cipher/shash pair to transform the input IV into

[dm-devel] [PATCH] dm log writes: Fix the wrong comment on the logged sequence

2019-06-18 Thread Qu Wenruo
dm-log-writes records the sequence of completion, not submission, thus for the following sequence (W=write, C=complete): Wa,Wb,Wc,Cc,Ca,FLUSH,FUAd,Cb,CFLUSH,CFUAd The logged results in log device should be: c,a,b,flush,fua Fix the comment to give a better example. Signed-off-by: Qu Wenruo