OpenCloudOS-Kernel/fs/crypto
Eric Biggers 50c961de59 fscrypt: calculate NUL-padding length in one place only
Currently, when encrypting a filename (either a real filename or a
symlink target) we calculate the amount of NUL-padding twice: once
before encryption and once during encryption in fname_encrypt().  It is
needed before encryption to allocate the needed buffer size as well as
calculate the size the symlink target will take up on-disk before
creating the symlink inode.  Calculating the size during encryption as
well is redundant.

Remove this redundancy by always calculating the exact size beforehand,
and making fname_encrypt() just add as much NUL padding as is needed to
fill the output buffer.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-01-11 23:30:08 -05:00
..
Kconfig fscrypt: add support for AES-128-CBC 2017-06-23 20:05:07 -04:00
Makefile fscrypt: new helper function - fscrypt_file_open() 2017-10-18 19:52:37 -04:00
bio.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
crypto.c fscrypt: trim down fscrypt.h includes 2018-01-11 22:06:19 -05:00
fname.c fscrypt: calculate NUL-padding length in one place only 2018-01-11 23:30:08 -05:00
fscrypt_private.h fscrypt: calculate NUL-padding length in one place only 2018-01-11 23:30:08 -05:00
hooks.c fscrypt: calculate NUL-padding length in one place only 2018-01-11 23:30:08 -05:00
keyinfo.c fscrypt: trim down fscrypt.h includes 2018-01-11 22:06:19 -05:00
policy.c fscrypt: lots of cleanups, mostly courtesy by Eric Biggers 2017-11-14 11:35:15 -08:00