1
0
Fork 0
alistair23-linux/arch/powerpc
Eric Biggers a208fa8f33 crypto: hash - annotate algorithms taking optional key
We need to consistently enforce that keyed hashes cannot be used without
setting the key.  To do this we need a reliable way to determine whether
a given hash algorithm is keyed or not.  AF_ALG currently does this by
checking for the presence of a ->setkey() method.  However, this is
actually slightly broken because the CRC-32 algorithms implement
->setkey() but can also be used without a key.  (The CRC-32 "key" is not
actually a cryptographic key but rather represents the initial state.
If not overridden, then a default initial state is used.)

Prepare to fix this by introducing a flag CRYPTO_ALG_OPTIONAL_KEY which
indicates that the algorithm has a ->setkey() method, but it is not
required to be called.  Then set it on all the CRC-32 algorithms.

The same also applies to the Adler-32 implementation in Lustre.

Also, the cryptd and mcryptd templates have to pass through the flag
from their underlying algorithm.

Cc: stable@vger.kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2018-01-12 23:03:35 +11:00
..
boot powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
configs powerpc/configs: Enable I2C_CHARDEV for pseries and powernv 2017-10-22 12:08:31 +02:00
crypto crypto: hash - annotate algorithms taking optional key 2018-01-12 23:03:35 +11:00
include Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-12-08 13:32:44 -08:00
kernel powerpc/64s: Initialize ISAv3 MMU registers before setting partition table 2017-12-06 23:32:43 +11:00
kvm * x86 bugfixes: APIC, nested virtualization, IOAPIC 2017-11-30 08:15:19 -08:00
lib powerpc fixes for 4.15 #2 2017-11-24 19:40:12 -10:00
math-emu License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mm powerpc fixes for 4.15 #3 2017-12-01 08:40:17 -05:00
net powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
oprofile treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
perf powerpc/perf: Fix oops when grouping different pmu events 2017-12-04 16:03:19 +11:00
platforms Revert "powerpc: Do not call ppc_md.panic in fadump panic notifier" 2017-12-05 23:21:46 +11:00
purgatory License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sysdev powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
tools License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xmon powerpc/xmon: Don't print hashed pointers in xmon 2017-12-07 00:27:01 +11:00
Kconfig powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
Kconfig.debug powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
Makefile Merge branch 'fixes' into next 2017-08-23 22:20:10 +10:00
Makefile.postlink License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00