Skip to contentSkip to conversation

fscrypto: remove unneeded Kconfig dependencies

PATCH Applied Eric Biggers 3 participants 4 messages Oct 24, 2016 – Nov 26, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fscrypto: remove unneeded Kconfig dependencies

SHA256 and ENCRYPTED_KEYS are not needed. CTR shouldn't be needed either, but I left it for now because it was intentionally added by commit 71dea01ea2ed ("ext4 crypto: require CONFIG_CRYPTO_CTR if ext4 encryption is enabled"). So it sounds like there may be a dependency problem elsewhere, which I have not been able to identify specifically, that must be solved before CTR can be removed.

---
 fs/crypto/Kconfig | 2 --
 1 file changed, 2 deletions(-)
fs/crypto/Kconfig +0 -2
index 92348fa..f514978 100644
@@ -8,9 +8,7 @@ config FS_ENCRYPTION
 	select CRYPTO_XTS
 	select CRYPTO_CTS
 	select CRYPTO_CTR
-	select CRYPTO_SHA256
 	select KEYS
-	select ENCRYPTED_KEYS
 	help
 	  Enable encryption of files and directories.  This
 	  feature is similar to ecryptfs, but it is more memory
Signature · 1 line
2.8.0.rc3.226.g39d4020
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Eric Biggers

SHA256 and ENCRYPTED_KEYS are not needed. CTR shouldn't be needed either, but I left it for now because it was intentionally added by commit 71dea01ea2ed ("ext4 crypto: require CONFIG_CRYPTO_CTR if ext4 encryption is enabled"). So it sounds like there may be a dependency problem elsewhere, which I have not been able to identify specifically, that must be solved before CTR can be removed.

FWIW, Strictly speaking we could also get rid of the dependency on BLOCK. Only very few functions in fs/crypto/crypto.c use block specific functions, these could be placed in a different file.
The use case would be very small systems with UBIFS and encrypted files. i.e. kexec() style bootloaders.

Thanks,
//richard

#2 lore raw
Quoted 8 lines · Richard Weinberger

FWIW, Strictly speaking we could also get rid of the dependency on BLOCK. Only very few functions in fs/crypto/crypto.c use block specific functions, these could be placed in a different file.
The use case would be very small systems with UBIFS and encrypted files. i.e. kexec() style bootloaders.

Thanks,
//richard

Yes, that makes sense if UBIFS is going to be using the code too. Feel free to propose a patch. As I understand it, the assumption would be that if a filesystem needs the block-specific functions in fs/crypto/, then it itself would necessarily already depend on CONFIG_BLOCK. It should work to just conditionally compile the block-specific functions based on CONFIG_BLOCK, either via #ifdefs or by having a separate file like fs/crypto/block.c and putting 'fscrypto-$(CONFIG_BLOCK) += block.o' in fs/crypto/Makefile. The separate file sounds preferable.

Eric

maintainer Applied
#3 lore raw
In reply to Eric Biggers
Quoted 8 lines · Eric Biggers

SHA256 and ENCRYPTED_KEYS are not needed. CTR shouldn't be needed either, but I left it for now because it was intentionally added by commit 71dea01ea2ed ("ext4 crypto: require CONFIG_CRYPTO_CTR if ext4 encryption is enabled"). So it sounds like there may be a dependency problem elsewhere, which I have not been able to identify specifically, that must be solved before CTR can be removed.

Applied, thanks.

- Ted