linux/arch/arm/crypto
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
..
.gitignore
Kconfig
Makefile
aes-ce-core.S
aes-ce-glue.c
aes-cipher-core.S
aes-cipher-glue.c
aes-neonbs-core.S
aes-neonbs-glue.c crypto: arm/aes-neonbs - Use PTR_ERR_OR_ZERO() 2017-12-11 22:36:56 +11:00
chacha20-neon-core.S
chacha20-neon-glue.c
crc32-ce-core.S
crc32-ce-glue.c crypto: hash - annotate algorithms taking optional key 2018-01-12 23:03:35 +11:00
crct10dif-ce-core.S
crct10dif-ce-glue.c
ghash-ce-core.S
ghash-ce-glue.c
sha1-armv4-large.S
sha1-armv7-neon.S
sha1-ce-core.S
sha1-ce-glue.c
sha1.h
sha1_glue.c
sha1_neon_glue.c
sha2-ce-core.S
sha2-ce-glue.c
sha256-armv4.pl
sha256-core.S_shipped
sha256_glue.c
sha256_glue.h
sha256_neon_glue.c
sha512-armv4.pl
sha512-core.S_shipped
sha512-glue.c
sha512-neon-glue.c
sha512.h