diff options
author | Eric Biggers <ebiggers@google.com> | 2019-10-10 01:34:16 +0200 |
---|---|---|
committer | Eric Biggers <ebiggers@google.com> | 2019-10-21 22:22:08 +0200 |
commit | 4006d799d93b159fd834c50999265b5c534a71d5 (patch) | |
tree | 7f28f0fc26f9b5145dec54ffd8ca1af2a3589453 /fs/crypto/keysetup_v1.c | |
parent | Linux 5.4-rc4 (diff) | |
download | linux-4006d799d93b159fd834c50999265b5c534a71d5.tar.xz linux-4006d799d93b159fd834c50999265b5c534a71d5.zip |
fscrypt: invoke crypto API for ESSIV handling
Instead of open-coding the calculations for ESSIV handling, use an ESSIV
skcipher which does all of this under the hood. ESSIV was added to the
crypto API in v5.4.
This is based on a patch from Ard Biesheuvel, but reworked to apply
after all the fscrypt changes that went into v5.4.
Tested with 'kvm-xfstests -c ext4,f2fs -g encrypt', including the
ciphertext verification tests for v1 and v2 encryption policies.
Originally-from: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Diffstat (limited to 'fs/crypto/keysetup_v1.c')
-rw-r--r-- | fs/crypto/keysetup_v1.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/fs/crypto/keysetup_v1.c b/fs/crypto/keysetup_v1.c index ad1a36c370c3..5298ef22aa85 100644 --- a/fs/crypto/keysetup_v1.c +++ b/fs/crypto/keysetup_v1.c @@ -270,10 +270,6 @@ static int setup_v1_file_key_direct(struct fscrypt_info *ci, return -EINVAL; } - /* ESSIV implies 16-byte IVs which implies !DIRECT_KEY */ - if (WARN_ON(mode->needs_essiv)) - return -EINVAL; - dk = fscrypt_get_direct_key(ci, raw_master_key); if (IS_ERR(dk)) return PTR_ERR(dk); |