linux/arch/mips
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
..
alchemy treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 182 2019-05-30 11:29:20 -07:00
ar7 The main MIPS changes for a pretty light v5.3 cycle, including: 2019-07-17 09:42:03 -07:00
ath25 PCI: consolidate PCI config entry in drivers/pci 2018-11-23 11:45:34 +09:00
ath79 The main MIPS changes for a pretty light v5.3 cycle, including: 2019-07-17 09:42:03 -07:00
bcm47xx MIPS: BCM47XX: Add support for Netgear R6200 V1 2019-07-25 22:10:05 -07:00
bcm63xx MIPS: bmips: mark exception vectors as char arrays 2019-10-23 21:07:28 -07:00
bmips dma-mapping: drop the dev argument to arch_sync_dma_for_* 2019-11-20 20:31:38 +01:00
boot MIPS: CI20: DTS: Add Leds 2019-10-07 09:46:22 -07:00
cavium-octeon mips/cavium-octeon: Fix typo *must* in comment 2019-11-01 14:33:07 -07:00
cobalt treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 1 2019-05-21 11:28:39 +02:00
configs 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
crypto crypto: remove CRYPTO_TFM_RES_BAD_KEY_LEN 2020-01-09 11:30:53 +08:00
dec treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
emma treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
fw A few MIPS fixes: 2019-11-01 14:36:44 -07:00
generic MIPS: generic: Use __initconst for const init data 2019-10-08 10:54:44 -07:00
include arch: sembuf.h: make uapi asm/sembuf.h self-contained 2019-12-04 19:44:14 -08:00
jazz dma-mapping: drop the dev argument to arch_sync_dma_for_* 2019-11-20 20:31:38 +01:00
jz4740 Merge branch 'ingenic-tcu-v5.4' into mips-next 2019-08-08 15:33:16 -07:00
kernel y2038: syscall implementation cleanups 2019-12-01 14:00:59 -08:00
kvm mips: add support for folded p4d page tables 2019-11-22 10:51:22 -08:00
lantiq MIPS: lantiq: update the clock alias' for the mainline PCIe PHY driver 2019-08-24 15:13:22 +01:00
lasat treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 182 2019-05-30 11:29:20 -07:00
lib MIPS: Loongson64: Rename CPU TYPES 2019-10-31 15:03:10 -07:00
loongson2ef MIPS: Loongson2ef: Convert to early_printk_8250 2019-11-11 10:45:00 -08:00
loongson32 MIPS: Loongson{2ef, 32, 64} convert to generic fw cmdline 2019-11-11 10:44:56 -08:00
loongson64 MIPS: Loongson64: Drop setup_pcimap 2019-11-11 10:45:01 -08:00
math-emu MIPS: math-emu: Reuse name array in debugfs_fpuemu() 2019-11-11 10:56:14 -08:00
mm dma-mapping updates for 5.5-rc1 2019-11-28 11:16:43 -08:00
mti-malta MIPS: malta: Drop prom_free_prom_memory 2019-08-23 14:47:13 +01:00
net treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
netlogic MIPS: xlp: Drop boot_mem_map 2019-08-23 14:47:21 +01:00
oprofile MIPS: Loongson: Rename LOONGSON1 to LOONGSON32 2019-11-11 10:43:13 -08:00
paravirt
pci dma-mapping updates for 5.5-rc1 2019-11-28 11:16:43 -08:00
pic32 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 445 2019-06-05 17:37:18 +02:00
pistachio A batch of MIPS fixes: 2019-06-08 13:09:31 -07:00
pmcs-msp71xx MIPS: pmcs-msp71xx: Remove unused addr variable 2019-10-03 15:47:17 -07:00
pnx833x A batch of MIPS fixes: 2019-06-08 13:09:31 -07:00
power mips: check for dsp presence only once before save/restore 2019-10-07 10:58:53 -07:00
ralink MIPS: ralink: enable PCI support only if driver for mt7621 SoC is selected 2019-11-14 13:09:37 +08:00
rb532 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 182 2019-05-30 11:29:20 -07:00
sgi-ip22 MIPS: SGI-IP22/28: Use PROM for memory detection 2019-10-09 14:55:57 -07:00
sgi-ip27 The main MIPS changes for 5.5: 2019-11-25 17:42:56 -08:00
sgi-ip30 MIPS: add support for SGI Octane (IP30) 2019-11-01 14:58:56 -07:00
sgi-ip32 rtc: ds1685: add indirect access method and remove plat_read/plat_write 2019-10-16 10:39:00 +02:00
sibyte treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
sni treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 210 2019-05-30 11:29:53 -07:00
tools MIPS: Check Loongson3 LL/SC errata workaround correctness 2019-10-07 09:43:13 -07:00
txx9 A batch of MIPS fixes: 2019-06-08 13:09:31 -07:00
vdso MIPS: allow building with kcov coverage 2019-11-11 10:46:53 -08:00
vr41xx treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
Kbuild treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
Kbuild.platforms MIPS: add support for SGI Octane (IP30) 2019-11-01 14:58:56 -07:00
Kconfig dma-mapping updates for 5.5-rc1 2019-11-28 11:16:43 -08:00
Kconfig.debug MIPS: cmdline: Remove redundant Kconfig defaults 2019-10-09 15:53:16 -07:00
Makefile Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2019-11-25 19:49:58 -08:00
Makefile.postlink MIPS: Check Loongson3 LL/SC errata workaround correctness 2019-10-07 09:43:13 -07:00