1
0
Fork 0
remarkable-linux/arch/powerpc
Eric Biggers 8d906d183b crypto: hash - annotate algorithms taking optional key
commit a208fa8f33 upstream.

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.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-16 20:23:00 +01:00
..
boot .gitignore: move *.dtb and *.dtb.S patterns to the top-level .gitignore 2018-02-13 10:19:46 +01:00
configs powerpc/configs: Update for CONFIG_SND changes 2017-09-20 13:30:09 +10:00
crypto crypto: hash - annotate algorithms taking optional key 2018-02-16 20:23:00 +01:00
include powerpc/pseries: include linux/types.h in asm/hvcall.h 2018-02-16 20:22:42 +01:00
kernel powerpc/64s: Allow control of RFI flush via debugfs 2018-02-07 11:12:17 -08:00
kvm KVM: Let KVM_SET_SIGNAL_MASK work as advertised 2018-02-03 17:39:06 +01:00
lib powerpc/64s: Add support for RFI flush of L1-D cache 2018-01-23 19:58:10 +01: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/mm: Fix SEGV on mapped region to return SEGV_ACCERR 2018-01-10 09:31:21 +01:00
net bpf, ppc64: do not reload skb pointers in non-skb context 2017-12-25 14:26:32 +01:00
oprofile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
perf powerpc/perf: Dereference BHRB entries safely 2017-12-29 17:53:49 +01:00
platforms powerpc/powernv: Check device-tree for RFI flush settings 2018-01-23 19:58:11 +01: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/ipic: Fix status get and status clear 2017-12-20 10:10:25 +01: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: Avoid tripping SMP hardlockup watchdog 2017-12-25 14:26:28 +01:00
Kconfig powerpc/64s: Wire up cpu_show_meltdown() 2018-02-07 11:12:17 -08:00
Kconfig.debug License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01: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