linux/arch
Eric Biggers 674f368a95 crypto: remove CRYPTO_TFM_RES_BAD_KEY_LEN
The CRYPTO_TFM_RES_BAD_KEY_LEN flag was apparently meant as a way to
make the ->setkey() functions provide more information about errors.

However, no one actually checks for this flag, which makes it pointless.

Also, many algorithms fail to set this flag when given a bad length key.
Reviewing just the generic implementations, this is the case for
aes-fixed-time, cbcmac, echainiv, nhpoly1305, pcrypt, rfc3686, rfc4309,
rfc7539, rfc7539esp, salsa20, seqiv, and xcbc.  But there are probably
many more in arch/*/crypto/ and drivers/crypto/.

Some algorithms can even set this flag when the key is the correct
length.  For example, authenc and authencesn set it when the key payload
is malformed in any way (not just a bad length), the atmel-sha and ccree
drivers can set it if a memory allocation fails, and the chelsio driver
sets it for bad auth tag lengths, not just bad key lengths.

So even if someone actually wanted to start checking this flag (which
seems unlikely, since it's been unused for a long time), there would be
a lot of work needed to get it working correctly.  But it would probably
be much better to go back to the drawing board and just define different
return values, like -EINVAL if the key is invalid for the algorithm vs.
-EKEYREJECTED if the key was rejected by a policy like "no weak keys".
That would be much simpler, less error-prone, and easier to test.

So just remove this flag.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2020-01-09 11:30:53 +08:00
..
alpha alpha: use pgtable-nopud instead of 4level-fixup 2019-12-04 19:44:14 -08:00
arc ARC updates for 5.5-rc1 2019-12-04 19:06:18 -08:00
arm crypto: remove CRYPTO_TFM_RES_BAD_KEY_LEN 2020-01-09 11:30:53 +08:00
arm64 crypto: remove CRYPTO_TFM_RES_BAD_KEY_LEN 2020-01-09 11:30:53 +08:00
c6x c6x: use pgtable-nopud instead of 4level-fixup 2019-12-04 19:44:15 -08:00
csky dma-mapping updates for 5.5-rc1 2019-11-28 11:16:43 -08:00
h8300 h8300: Move EXCEPTION_TABLE to RO_DATA segment 2019-11-04 18:12:55 +01:00
hexagon Kbuild updates for v5.5 2019-12-02 17:35:04 -08:00
ia64 drm msm + fixes for 5.5-rc1 2019-12-06 10:28:09 -08:00
m68k Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu 2019-12-05 12:20:42 -08:00
microblaze microblaze: use pgtable-nopmd instead of 4level-fixup 2019-12-04 19:44:15 -08:00
mips crypto: remove CRYPTO_TFM_RES_BAD_KEY_LEN 2020-01-09 11:30:53 +08:00
nds32 nds32: use pgtable-nopmd instead of 4level-fixup 2019-12-04 19:44:15 -08:00
nios2 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2019-12-01 13:26:18 -08:00
openrisc OpenRISC updates for 5.5 2019-12-02 17:18:43 -08:00
parisc parisc/hugetlb: use pgtable-nopXd instead of 4level-fixup 2019-12-04 19:44:15 -08:00
powerpc crypto: remove CRYPTO_TFM_RES_BAD_KEY_LEN 2020-01-09 11:30:53 +08:00
riscv Second set of RISC-V updates for v5.5-rc1 2019-12-04 11:07:00 -08:00
s390 crypto: remove CRYPTO_TFM_RES_BAD_KEY_LEN 2020-01-09 11:30:53 +08:00
sh Additional power management updates for 5.5-rc1 2019-12-04 10:48:09 -08:00
sparc crypto: remove CRYPTO_TFM_RES_BAD_KEY_LEN 2020-01-09 11:30:53 +08:00
um um: add support for folded p4d page tables 2019-12-04 19:44:15 -08:00
unicore32 generic ioremap support 2019-11-28 10:57:12 -08:00
x86 crypto: remove CRYPTO_TFM_RES_BAD_KEY_LEN 2020-01-09 11:30:53 +08:00
xtensa arch: sembuf.h: make uapi asm/sembuf.h self-contained 2019-12-04 19:44:14 -08:00
.gitignore
Kconfig arch/Kconfig: fix indentation 2019-12-04 19:44:12 -08:00