1. 19 2月, 2013 1 次提交
    • M
      crypto: user - fix info leaks in report API · 9a5467bf
      Mathias Krause 提交于
      Three errors resulting in kernel memory disclosure:
      
      1/ The structures used for the netlink based crypto algorithm report API
      are located on the stack. As snprintf() does not fill the remainder of
      the buffer with null bytes, those stack bytes will be disclosed to users
      of the API. Switch to strncpy() to fix this.
      
      2/ crypto_report_one() does not initialize all field of struct
      crypto_user_alg. Fix this to fix the heap info leak.
      
      3/ For the module name we should copy only as many bytes as
      module_name() returns -- not as much as the destination buffer could
      hold. But the current code does not and therefore copies random data
      from behind the end of the module name, as the module name is always
      shorter than CRYPTO_MAX_ALG_NAME.
      
      Also switch to use strncpy() to copy the algorithm's name and
      driver_name. They are strings, after all.
      Signed-off-by: NMathias Krause <minipli@googlemail.com>
      Cc: Steffen Klassert <steffen.klassert@secunet.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      9a5467bf
  2. 01 8月, 2012 1 次提交
  3. 02 4月, 2012 1 次提交
  4. 20 3月, 2012 1 次提交
  5. 11 11月, 2011 1 次提交
  6. 21 10月, 2011 1 次提交
  7. 05 11月, 2010 1 次提交
  8. 19 5月, 2010 1 次提交
  9. 24 7月, 2009 1 次提交
  10. 22 7月, 2009 1 次提交
    • H
      crypto: shash - Require all algorithms to support export/import · f592682f
      Herbert Xu 提交于
      This patch provides a default export/import function for all
      shash algorithms.  It simply copies the descriptor context as
      is done by sha1_generic.
      
      This in essence means that all existing shash algorithms now
      support export/import.  This is something that will be depended
      upon in implementations such as hmac.  Therefore all new shash
      and ahash implementations must support export/import.
      
      For those that cannot obtain a partial result, padlock-sha's
      fallback model should be used so that a partial result is always
      available.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      f592682f
  11. 15 7月, 2009 2 次提交
  12. 14 7月, 2009 7 次提交
  13. 12 7月, 2009 1 次提交
  14. 11 7月, 2009 2 次提交
  15. 08 7月, 2009 6 次提交
  16. 27 3月, 2009 1 次提交
  17. 18 2月, 2009 2 次提交
    • H
      crypto: api - Fix crypto_alloc_tfm/create_create_tfm return convention · 3f683d61
      Herbert Xu 提交于
      This is based on a report and patch by Geert Uytterhoeven.
      
      The functions crypto_alloc_tfm and create_create_tfm return a
      pointer that needs to be adjusted by the caller when successful
      and otherwise an error value.  This means that the caller has
      to check for the error and only perform the adjustment if the
      pointer returned is valid.
      
      Since all callers want to make the adjustment and we know how
      to adjust it ourselves, it's much easier to just return adjusted
      pointer directly.
      
      The only caveat is that we have to return a void * instead of
      struct crypto_tfm *.  However, this isn't that bad because both
      of these functions are for internal use only (by types code like
      shash.c, not even algorithms code).
      
      This patch also moves crypto_alloc_tfm into crypto/internal.h
      (crypto_create_tfm is already there) to reflect this.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      3f683d61
    • H
      crypto: shash - Remove superfluous check in init_tfm · 1693531e
      Herbert Xu 提交于
      We're currently checking the frontend type in init_tfm.  This is
      completely pointless because the fact that we're called at all
      means that the frontend is ours so the type must match as well.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      1693531e
  18. 05 2月, 2009 1 次提交
  19. 25 12月, 2008 5 次提交
    • H
      crypto: hash - Make setkey optional · 3751f402
      Herbert Xu 提交于
      Since most cryptographic hash algorithms have no keys, this patch
      makes the setkey function optional for ahash and shash.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      3751f402
    • H
      crypto: hash - Export shash through hash · 5f7082ed
      Herbert Xu 提交于
      This patch allows shash algorithms to be used through the old hash
      interface.  This is a transitional measure so we can convert the
      underlying algorithms to shash before converting the users across.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      5f7082ed
    • H
      crypto: hash - Add import/export interface · dec8b786
      Herbert Xu 提交于
      It is often useful to save the partial state of a hash function
      so that it can be used as a base for two or more computations.
      
      The most prominent example is HMAC where all hashes start from
      a base determined by the key.  Having an import/export interface
      means that we only have to compute that base once rather than
      for each message.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      dec8b786
    • H
      crypto: hash - Export shash through ahash · 3b2f6df0
      Herbert Xu 提交于
      This patch allows shash algorithms to be used through the ahash
      interface.  This is required before we can convert digest algorithms
      over to shash.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      3b2f6df0
    • H
      crypto: hash - Add shash interface · 7b5a080b
      Herbert Xu 提交于
      The shash interface replaces the current synchronous hash interface.
      It improves over hash in two ways.  Firstly shash is reentrant,
      meaning that the same tfm may be used by two threads simultaneously
      as all hashing state is stored in a local descriptor.
      
      The other enhancement is that shash no longer takes scatter list
      entries.  This is because shash is specifically designed for
      synchronous algorithms and as such scatter lists are unnecessary.
      
      All existing hash users will be converted to shash once the
      algorithms have been completely converted.
      
      There is also a new finup function that combines update with final.
      This will be extended to ahash once the algorithm conversion is
      done.
      
      This is also the first time that an algorithm type has their own
      registration function.  Existing algorithm types will be converted
      to this way in due course.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      7b5a080b