fscrypt: factor out fscrypt_policy_to_key_spec()
authorEric Biggers <ebiggers@google.com>
Sun, 1 May 2022 05:08:53 +0000 (22:08 -0700)
committerEric Biggers <ebiggers@google.com>
Mon, 9 May 2022 23:18:54 +0000 (16:18 -0700)
commitbfb9700bdf35417454a9bb8b67221d89d7c6e75a
treef9644b43e0dee61186f19064ad432b0341ae5ef9
parenta7a5bc5fe8acc9381e38a34ef18f1115c5c22079
fscrypt: factor out fscrypt_policy_to_key_spec()

Factor out a function that builds the fscrypt_key_specifier for an
fscrypt_policy.  Before this was only needed when finding the key for a
file, but now it will also be needed for test_dummy_encryption support.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Link: https://lore.kernel.org/r/20220501050857.538984-4-ebiggers@kernel.org
fs/crypto/fscrypt_private.h
fs/crypto/keysetup.c
fs/crypto/policy.c