linux-sg2042/fs/crypto
Eric Biggers 218d921b58 fscrypt: add new helper functions for test_dummy_encryption
Unfortunately the design of fscrypt_set_test_dummy_encryption() doesn't
work properly for the new mount API, as it combines too many steps into
one function:

  - Parse the argument to test_dummy_encryption
  - Check the setting against the filesystem instance
  - Apply the setting to the filesystem instance

The new mount API has split these into separate steps.  ext4 partially
worked around this by duplicating some of the logic, but it still had
some bugs.  To address this, add some new helper functions that split up
the steps of fscrypt_set_test_dummy_encryption():

  - fscrypt_parse_test_dummy_encryption()
  - fscrypt_dummy_policies_equal()
  - fscrypt_add_test_dummy_key()

While we're add it, also add a function fscrypt_is_dummy_policy_set()
which will be useful to avoid some #ifdef's.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Link: https://lore.kernel.org/r/20220501050857.538984-5-ebiggers@kernel.org
2022-05-09 16:18:54 -07:00
..
Kconfig fscrypt: relax Kconfig dependencies for crypto API algorithms 2021-04-22 17:31:32 +10:00
Makefile fscrypt: add inline encryption support 2020-07-08 10:29:30 -07:00
bio.c block: pass a block_device and opf to bio_reset 2022-02-02 07:50:00 -07:00
crypto.c fscrypt: split up FS_CRYPTO_BLOCK_SIZE 2022-04-13 15:03:09 -07:00
fname.c fscrypt: split up FS_CRYPTO_BLOCK_SIZE 2022-04-13 15:03:09 -07:00
fscrypt_private.h fscrypt: add new helper functions for test_dummy_encryption 2022-05-09 16:18:54 -07:00
hkdf.c fscrypt: allow 256-bit master keys with AES-256-XTS 2021-09-22 11:29:38 -07:00
hooks.c fscrypt: add fscrypt_symlink_getattr() for computing st_size 2021-07-25 20:01:06 -07:00
inline_crypt.c fscrypt: log when starting to use inline encryption 2022-04-13 22:35:25 -07:00
keyring.c fscrypt: add new helper functions for test_dummy_encryption 2022-05-09 16:18:54 -07:00
keysetup.c fscrypt: factor out fscrypt_policy_to_key_spec() 2022-05-09 16:18:54 -07:00
keysetup_v1.c fscrypt: stop pretending that key setup is nofs-safe 2020-09-22 06:48:42 -07:00
policy.c fscrypt: add new helper functions for test_dummy_encryption 2022-05-09 16:18:54 -07:00