diff options
author | Eric Biggers | 2020-07-21 15:59:16 -0700 |
---|---|---|
committer | Eric Biggers | 2020-07-21 16:02:13 -0700 |
commit | bd0d97b7191e8f3573681fa854fdb04c1a970c1e (patch) | |
tree | a32b0fd5de253bfef08c6d9730bff73998028b77 /drivers/power | |
parent | f000223c981a7c75f6f3ab7288f0be7b571c3644 (diff) |
fscrypt: switch fscrypt_do_sha256() to use the SHA-256 library
fscrypt_do_sha256() is only used for hashing encrypted filenames to
create no-key tokens, which isn't performance-critical. Therefore a C
implementation of SHA-256 is sufficient.
Also, the logic to create no-key tokens is always potentially needed.
This differs from fscrypt's other dependencies on crypto API algorithms,
which are conditionally needed depending on what encryption policies
userspace is using. Therefore, for fscrypt there isn't much benefit to
allowing SHA-256 to be a loadable module.
So, make fscrypt_do_sha256() use the SHA-256 library instead of the
crypto_shash API. This is much simpler, since it avoids having to
implement one-time-init (which is hard to do correctly, and in fact was
implemented incorrectly) and handle failures to allocate the
crypto_shash object.
Fixes: edc440e3d27f ("fscrypt: improve format of no-key names")
Cc: Daniel Rosenberg <drosen@google.com>
Link: https://lore.kernel.org/r/20200721225920.114347-2-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
Diffstat (limited to 'drivers/power')
0 files changed, 0 insertions, 0 deletions