1. 22 2月, 2020 13 次提交
  2. 13 2月, 2020 6 次提交
  3. 22 1月, 2020 11 次提交
  4. 09 1月, 2020 2 次提交
    • E
      crypto: remove CRYPTO_TFM_RES_BAD_KEY_LEN · 674f368a
      Eric Biggers 提交于
      The CRYPTO_TFM_RES_BAD_KEY_LEN flag was apparently meant as a way to
      make the ->setkey() functions provide more information about errors.
      
      However, no one actually checks for this flag, which makes it pointless.
      
      Also, many algorithms fail to set this flag when given a bad length key.
      Reviewing just the generic implementations, this is the case for
      aes-fixed-time, cbcmac, echainiv, nhpoly1305, pcrypt, rfc3686, rfc4309,
      rfc7539, rfc7539esp, salsa20, seqiv, and xcbc.  But there are probably
      many more in arch/*/crypto/ and drivers/crypto/.
      
      Some algorithms can even set this flag when the key is the correct
      length.  For example, authenc and authencesn set it when the key payload
      is malformed in any way (not just a bad length), the atmel-sha and ccree
      drivers can set it if a memory allocation fails, and the chelsio driver
      sets it for bad auth tag lengths, not just bad key lengths.
      
      So even if someone actually wanted to start checking this flag (which
      seems unlikely, since it's been unused for a long time), there would be
      a lot of work needed to get it working correctly.  But it would probably
      be much better to go back to the drawing board and just define 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 this flag.
      Signed-off-by: NEric Biggers <ebiggers@google.com>
      Reviewed-by: NHoria Geantă <horia.geanta@nxp.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      674f368a
    • E
      crypto: remove CRYPTO_TFM_RES_BAD_BLOCK_LEN · 5c925e8b
      Eric Biggers 提交于
      The flag CRYPTO_TFM_RES_BAD_BLOCK_LEN is never checked for, and it's
      only set by one driver.  And even that single driver's use is wrong
      because the driver is setting the flag from ->encrypt() and ->decrypt()
      with no locking, which is unsafe because ->encrypt() and ->decrypt() can
      be executed by many threads in parallel on the same tfm.
      
      Just remove this flag.
      Signed-off-by: NEric Biggers <ebiggers@google.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      5c925e8b
  5. 11 12月, 2019 4 次提交
  6. 17 11月, 2019 1 次提交
  7. 25 10月, 2019 1 次提交
  8. 13 9月, 2019 1 次提交
  9. 05 9月, 2019 1 次提交