]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: remove propagation of CRYPTO_TFM_RES_* flags
authorEric Biggers <ebiggers@google.com>
Tue, 31 Dec 2019 03:19:38 +0000 (21:19 -0600)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 9 Jan 2020 03:30:53 +0000 (11:30 +0800)
commit79ce5dbbe457a8798924be541335ab26ed4da472
treef561a8db9f88931072210330128fed231e3b8b0b
parent92f449667ce3f1ca24cca7071ed34cb53bdf8f20
crypto: remove propagation of CRYPTO_TFM_RES_* flags

The CRYPTO_TFM_RES_* flags were apparently meant as a way to make the
->setkey() functions provide more information about errors.  But these
flags weren't actually being used or tested, and in many cases they
weren't being set correctly anyway.  So they've now been removed.

Also, if someone ever actually needs to start better distinguishing
->setkey() errors (which is somewhat unlikely, as this has been unneeded
for a long time), we'd be much better off just defining different return
values, like -EINVAL if the key is invalid for the algorithm vs.
-EKEYREJECTED if the key was rejected by a policy like "no weak keys".
That would be much simpler, less error-prone, and easier to test.

So just remove CRYPTO_TFM_RES_MASK and all the unneeded logic that
propagates these flags around.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
32 files changed:
arch/arm/crypto/ghash-ce-glue.c
arch/s390/crypto/aes_s390.c
arch/x86/crypto/ghash-clmulni-intel_glue.c
crypto/adiantum.c
crypto/authenc.c
crypto/authencesn.c
crypto/ccm.c
crypto/chacha20poly1305.c
crypto/cipher.c
crypto/cryptd.c
crypto/ctr.c
crypto/cts.c
crypto/essiv.c
crypto/gcm.c
crypto/lrw.c
crypto/simd.c
crypto/skcipher.c
crypto/xts.c
drivers/crypto/amcc/crypto4xx_alg.c
drivers/crypto/atmel-aes.c
drivers/crypto/atmel-authenc.h
drivers/crypto/atmel-sha.c
drivers/crypto/bcm/cipher.c
drivers/crypto/chelsio/chcr_algo.c
drivers/crypto/geode-aes.c
drivers/crypto/inside-secure/safexcel_cipher.c
drivers/crypto/inside-secure/safexcel_hash.c
drivers/crypto/mediatek/mtk-aes.c
drivers/crypto/mxs-dcp.c
drivers/crypto/picoxcell_crypto.c
drivers/crypto/sahara.c
include/linux/crypto.h