Skip to content

crypto: set CRYPTO_TFM_NEED_KEY if ->setkey() fails

Eric Biggers linux-crypto 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3crypto: hash - set CRYPTO_TFM_NEED_KEY if ->setkey() failscrypto/ahash.c crypto/shash.c+32 -140 replies
2/3crypto: skcipher - set CRYPTO_TFM_NEED_KEY if ->setkey() failscrypto/skcipher.c+18 -90 replies
3/3crypto: aead - set CRYPTO_TFM_NEED_KEY if ->setkey() failscrypto/aead.c+3 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] crypto: set CRYPTO_TFM_NEED_KEY if ->setkey() fails

This series makes the crypto API mark shash, ahash, skcipher, and aead tfms as needing a key again if setting a key fails, since on failure many algorithms can leave the tfm in an intermediate state that is neither the old key nor the new key -- and use of such tfms for hashing, encryption, or decryption will produce bogus results or crashes.

Eric Biggers (3):
crypto: hash - set CRYPTO_TFM_NEED_KEY if ->setkey() fails
crypto: skcipher - set CRYPTO_TFM_NEED_KEY if ->setkey() fails
crypto: aead - set CRYPTO_TFM_NEED_KEY if ->setkey() fails

 crypto/aead.c     |  4 +++-
 crypto/ahash.c    | 28 +++++++++++++++++++---------
 crypto/shash.c    | 18 +++++++++++++-----
 crypto/skcipher.c | 27 ++++++++++++++++++---------
 4 files changed, 53 insertions(+), 24 deletions(-)
Signature · 1 line
2.20.1