1
0
Fork 0
remarkable-linux/drivers/crypto
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
..
amcc crypto: crypto4xx - increase context and scatter ring buffer elements 2017-12-25 14:26:25 +01:00
axis crypto: axis - hide an unused variable 2017-09-22 17:38:19 +08:00
bcm crypto: brcm - Explicity ACK mailbox message 2017-11-21 09:49:21 +01:00
caam License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cavium License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ccp License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
chelsio crypto: chelsio - select CRYPTO_GF128MUL 2018-01-10 09:31:18 +01:00
inside-secure crypto: inside-secure - avoid unmapping DMA memory that was not mapped 2018-02-03 17:38:50 +01:00
marvell License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mediatek crypto: mediatek - fix error return code in mtk_crypto_probe() 2017-07-18 17:50:54 +08:00
nx License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
qat License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
qce License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rockchip License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
stm32 crypto: hash - annotate algorithms taking optional key 2018-02-16 20:23:00 +01:00
sunxi-ss crypto: sun4i-ss - support the Security System PRNG 2017-07-18 17:50:55 +08:00
ux500 scripts/spelling.txt: add "disble(d)" pattern and fix typo instances 2017-03-09 17:01:09 -08:00
virtio License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vmx License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig crypto: axis - add ARTPEC-6/7 crypto accelerator driver 2017-08-22 14:54:52 +08:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
atmel-aes-regs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
atmel-aes.c crypto: atmel-authenc - add support to authenc(hmac(shaX), Y(aes)) modes 2017-02-03 18:16:14 +08:00
atmel-authenc.h crypto: atmel-authenc - add support to authenc(hmac(shaX), Y(aes)) modes 2017-02-03 18:16:14 +08:00
atmel-ecc.c crypto: atmel-ecc - fix signed integer to u8 assignment 2017-08-03 13:47:23 +08:00
atmel-ecc.h crypto: atmel-ecc - introduce Microchip / Atmel ECC driver 2017-07-18 17:50:58 +08:00
atmel-sha-regs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
atmel-sha.c crypto: atmel-sha - remove unnecessary static in atmel_sha_remove() 2017-08-03 13:47:16 +08:00
atmel-tdes-regs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
atmel-tdes.c crypto: atmel-tdes - remove unnecessary static in atmel_tdes_remove() 2017-08-03 13:47:18 +08:00
bfin_crc.c crypto: hash - annotate algorithms taking optional key 2018-02-16 20:23:00 +01:00
bfin_crc.h crypto: bfin_crc - Remove unneeded linux/miscdevice.h include 2016-12-27 17:50:51 +08:00
exynos-rng.c crypto: exynos - Add new Exynos RNG driver 2017-04-21 20:30:46 +08:00
geode-aes.c crypto: geode-aes - fixed coding style warnings and error 2017-07-18 18:15:57 +08:00
geode-aes.h crypto: geode - Consistently use AES_KEYSIZE_128 2014-05-22 21:03:12 +08:00
hifn_795x.c crypto: squash lines for simple wrapper functions 2016-09-13 20:27:26 +08:00
img-hash.c crypto: img-hash - remove unnecessary static in img_hash_remove() 2017-08-03 13:47:18 +08:00
ixp4xx_crypto.c crypto: ixp4xx - Fix error handling path in 'aead_perform()' 2017-08-09 20:01:33 +08:00
mv_cesa.c crypto: mv_cesa - Use IPAD/OPAD constant 2017-05-23 12:52:08 +08:00
mv_cesa.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mxc-scc.c crypto: mxc-scc - fix error code in mxc_scc_probe() 2017-07-18 17:50:54 +08:00
mxs-dcp.c crypto: mxs-dcp - print error message on platform_get_irq failure 2017-07-18 17:50:54 +08:00
n2_asm.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
n2_core.c crypto: n2 - cure use after free 2018-01-10 09:31:18 +01:00
n2_core.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
omap-aes-gcm.c crypto: omap-aes - fix spelling mistake "Encryptio" -> "Encryption" 2017-06-20 11:21:29 +08:00
omap-aes.c crypto: omap-aes - fix error return code in omap_aes_probe() 2017-07-18 17:50:55 +08:00
omap-aes.h crypto: omap-aes - Add support for GCM mode 2017-06-10 12:04:19 +08:00
omap-crypto.c crypto: omap - add base support library for common routines 2017-06-10 12:04:15 +08:00
omap-crypto.h crypto: omap - add base support library for common routines 2017-06-10 12:04:15 +08:00
omap-des.c crypto: omap-des - fix error return code in omap_des_probe() 2017-07-18 17:50:55 +08:00
omap-sham.c crypto: omap-sham - remove unnecessary static in omap_sham_remove() 2017-08-03 13:47:15 +08:00
padlock-aes.c x86/fpu: Remove irq_ts_save() and irq_ts_restore() 2016-11-01 07:47:54 +01:00
padlock-sha.c x86/fpu: Remove irq_ts_save() and irq_ts_restore() 2016-11-01 07:47:54 +01:00
picoxcell_crypto.c crypto: picoxcell - Remove spacc_is_compatible() wrapper function 2017-01-13 00:24:41 +08:00
picoxcell_crypto_regs.h crypto: picoxcell - add support for the picoxcell crypto engines 2011-02-21 22:42:40 +11:00
s5p-sss.c crypto: s5p-sss - Document the struct s5p_aes_dev 2017-03-24 22:03:00 +08:00
sahara.c crypto: sahara - constify platform_device_id 2017-08-22 14:54:53 +08:00
talitos.c crypto: talitos - fix ctr-aes-talitos 2017-12-14 09:53:05 +01:00
talitos.h crypto: talitos - add new crypto modes 2015-12-04 22:29:56 +08:00