OSDN Git Service

fscrypt: remove internal key size constants
authorEric Biggers <ebiggers@google.com>
Mon, 30 Apr 2018 22:51:46 +0000 (15:51 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Thu, 28 Jun 2018 19:21:30 +0000 (12:21 -0700)
commitff8e7c745e2bb71c549a0813dc8fbd8a1daf970f
treeede21182dca469770e20d66b22ed0f36852a3b3d
parent7149dd4d39b54d3a59ecea7b2a95c842aa39a283
fscrypt: remove internal key size constants

With one exception, the internal key size constants such as
FS_AES_256_XTS_KEY_SIZE are only used for the 'available_modes' array,
where they really only serve to obfuscate what the values are.  Also
some of the constants are unused, and the key sizes tend to be in the
names of the algorithms anyway.  In the past these values were also
misused, e.g. we used to have FS_AES_256_XTS_KEY_SIZE in places that
technically should have been FS_MAX_KEY_SIZE.

The exception is that FS_AES_128_ECB_KEY_SIZE is used for key
derivation.  But it's more appropriate to use
FS_KEY_DERIVATION_NONCE_SIZE for that instead.

Thus, just put the sizes directly in the 'available_modes' array.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/crypto/fscrypt_private.h
fs/crypto/keyinfo.c