1
0
Fork 0
remarkable-linux/arch/sparc
Eric Biggers b392a53b11 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.

Cc: stable@vger.kernel.org
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-25 11:05:43 +01:00
..
boot sparc: Add "install" target 2014-08-04 20:45:59 -07:00
configs sparc/defconfigs: Remove CONFIG_IPV6_PRIVACY 2016-04-21 16:43:44 -04:00
crypto crypto: hash - annotate algorithms taking optional key 2018-02-25 11:05:43 +01:00
include sparc64: Migrate hvcons irq to panicked cpu 2017-10-21 17:21:35 +02:00
kernel sparc64: Migrate hvcons irq to panicked cpu 2017-10-21 17:21:35 +02:00
lib sparc64: Fix exception handling in UltraSPARC-III memcpy. 2017-08-11 08:49:34 -07:00
math-emu arch/sparc/math-emu/math_32.c: drop stray break operator 2014-08-04 20:29:06 -07:00
mm sparc32: Export vac_cache_size to fix build error 2017-12-25 14:23:47 +01:00
net sparc: Fix misspellings in comments. 2016-03-20 21:28:58 -07:00
oprofile sparc: using HZ needs an include of linux/param.h 2009-10-05 00:46:08 -07:00
power sparc64: Prevent perf from running during super critical sections 2017-08-12 19:31:23 -07:00
prom sparc: fixing ident and beautifying code 2016-10-06 01:46:40 -04:00
Kbuild sparc64: Add SHA1 driver making use of the 'sha1' instruction. 2012-08-20 15:08:49 -07:00
Kconfig security/keys: add CONFIG_KEYS_COMPAT to Kconfig 2017-11-18 11:22:24 +01:00
Kconfig.debug lib: consolidate DEBUG_STACK_USAGE option 2011-05-25 08:39:54 -07:00
Makefile sparc32: Add -Wa,-Av8 to KBUILD_CFLAGS. 2016-03-01 00:24:04 -05:00