1. 12 1月, 2018 1 次提交
    • E
      crypto: hash - annotate algorithms taking optional key · a208fa8f
      Eric Biggers 提交于
      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: NEric Biggers <ebiggers@google.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      a208fa8f
  2. 05 1月, 2018 1 次提交
  3. 03 11月, 2017 1 次提交
  4. 10 4月, 2017 1 次提交
  5. 14 12月, 2016 1 次提交
  6. 01 12月, 2016 1 次提交
  7. 25 10月, 2016 2 次提交
  8. 18 7月, 2016 2 次提交
    • H
      crypto: skcipher - Remove top-level givcipher interface · 3a01d0ee
      Herbert Xu 提交于
      This patch removes the old crypto_grab_skcipher helper and replaces
      it with crypto_grab_skcipher2.
      
      As this is the final entry point into givcipher this patch also
      removes all traces of the top-level givcipher interface, including
      all implicit IV generators such as chainiv.
      
      The bottom-level givcipher interface remains until the drivers
      using it are converted.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      3a01d0ee
    • H
      crypto: skcipher - Add low-level skcipher interface · 4e6c3df4
      Herbert Xu 提交于
      This patch allows skcipher algorithms and instances to be created
      and registered with the crypto API.  They are accessible through
      the top-level skcipher interface, along with ablkcipher/blkcipher
      algorithms and instances.
      
      This patch also introduces a new parameter called chunk size
      which is meant for ciphers such as CTR and CTS which ostensibly
      can handle arbitrary lengths, but still behave like block ciphers
      in that you can only process a partial block at the very end.
      
      For these ciphers the block size will continue to be set to 1
      as it is now while the chunk size will be set to the underlying
      block size.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      4e6c3df4
  9. 23 6月, 2016 1 次提交
    • S
      crypto: kpp - Key-agreement Protocol Primitives API (KPP) · 4e5f2c40
      Salvatore Benedetto 提交于
      Add key-agreement protocol primitives (kpp) API which allows to
      implement primitives required by protocols such as DH and ECDH.
      The API is composed mainly by the following functions
       * set_secret() - It allows the user to set his secret, also
         referred to as his private key, along with the parameters
         known to both parties involved in the key-agreement session.
       * generate_public_key() - It generates the public key to be sent to
         the other counterpart involved in the key-agreement session. The
         function has to be called after set_params() and set_secret()
       * generate_secret() - It generates the shared secret for the session
      
      Other functions such as init() and exit() are provided for allowing
      cryptographic hardware to be inizialized properly before use
      Signed-off-by: NSalvatore Benedetto <salvatore.benedetto@intel.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      4e5f2c40
  10. 07 6月, 2016 1 次提交
  11. 15 4月, 2016 1 次提交
  12. 06 2月, 2016 1 次提交
  13. 27 1月, 2016 1 次提交
  14. 17 8月, 2015 2 次提交
  15. 22 6月, 2015 1 次提交
  16. 19 6月, 2015 1 次提交
    • H
      crypto: api - Add CRYPTO_MINALIGN_ATTR to struct crypto_alg · edf18b91
      Herbert Xu 提交于
      The struct crypto_alg is embedded into various type-specific structs
      such as aead_alg.  This is then used as part of instances such as
      struct aead_instance.  It is also embedded into the generic struct
      crypto_instance.  In order to ensure that struct aead_instance can
      be converted to struct crypto_instance when necessary, we need to
      ensure that crypto_alg is aligned properly.
      
      This patch adds an alignment attribute to struct crypto_alg to
      ensure this.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      edf18b91
  17. 17 6月, 2015 1 次提交
  18. 04 6月, 2015 1 次提交
  19. 22 5月, 2015 1 次提交
  20. 13 5月, 2015 1 次提交
    • H
      crypto: aead - Convert top level interface to new style · 5d1d65f8
      Herbert Xu 提交于
      This patch converts the top-level aead interface to the new style.
      All user-level AEAD interface code have been moved into crypto/aead.h.
      
      The allocation/free functions have switched over to the new way of
      allocating tfms.
      
      This patch also removes the double indrection on setkey so the
      indirection now exists only at the alg level.
      
      Apart from these there are no user-visible changes.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      5d1d65f8
  21. 22 4月, 2015 2 次提交
  22. 21 4月, 2015 1 次提交
  23. 31 3月, 2015 1 次提交
    • S
      crypto: api - prevent helper ciphers from being used · 06ca7f68
      Stephan Mueller 提交于
      Several hardware related cipher implementations are implemented as
      follows: a "helper" cipher implementation is registered with the
      kernel crypto API.
      
      Such helper ciphers are never intended to be called by normal users. In
      some cases, calling them via the normal crypto API may even cause
      failures including kernel crashes. In a normal case, the "wrapping"
      ciphers that use the helpers ensure that these helpers are invoked
      such that they cannot cause any calamity.
      
      Considering the AF_ALG user space interface, unprivileged users can
      call all ciphers registered with the crypto API, including these
      helper ciphers that are not intended to be called directly. That
      means, with AF_ALG user space may invoke these helper ciphers
      and may cause undefined states or side effects.
      
      To avoid any potential side effects with such helpers, the patch
      prevents the helpers to be called directly. A new cipher type
      flag is added: CRYPTO_ALG_INTERNAL. This flag shall be used
      to mark helper ciphers. These ciphers can only be used if the
      caller invoke the cipher with CRYPTO_ALG_INTERNAL in the type and
      mask field.
      Signed-off-by: NStephan Mueller <smueller@chronox.de>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      06ca7f68
  24. 20 1月, 2015 1 次提交
  25. 08 1月, 2015 1 次提交
  26. 24 11月, 2014 1 次提交
  27. 13 11月, 2014 6 次提交
  28. 01 8月, 2014 1 次提交
  29. 05 3月, 2012 1 次提交
    • P
      BUG: headers with BUG/BUG_ON etc. need linux/bug.h · 187f1882
      Paul Gortmaker 提交于
      If a header file is making use of BUG, BUG_ON, BUILD_BUG_ON, or any
      other BUG variant in a static inline (i.e. not in a #define) then
      that header really should be including <linux/bug.h> and not just
      expecting it to be implicitly present.
      
      We can make this change risk-free, since if the files using these
      headers didn't have exposure to linux/bug.h already, they would have
      been causing compile failures/warnings.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      187f1882
  30. 26 1月, 2012 1 次提交
  31. 13 1月, 2012 1 次提交