1. 25 1月, 2016 1 次提交
  2. 10 12月, 2015 1 次提交
  3. 11 6月, 2015 1 次提交
  4. 10 6月, 2015 2 次提交
    • S
      crypto: drbg - reseed often if seedsource is degraded · 42ea507f
      Stephan Mueller 提交于
      As required by SP800-90A, the DRBG implements are reseeding threshold.
      This threshold is at 2**48 (64 bit) and 2**32 bit (32 bit) as
      implemented in drbg_max_requests.
      
      With the recently introduced changes, the DRBG is now always used as a
      stdrng which is initialized very early in the boot cycle. To ensure that
      sufficient entropy is present, the Jitter RNG is added to even provide
      entropy at early boot time.
      
      However, the 2nd seed source, the nonblocking pool, is usually
      degraded at that time. Therefore, the DRBG is seeded with the Jitter RNG
      (which I believe contains good entropy, which however is questioned by
      others) and is seeded with a degradded nonblocking pool. This seed is
      now used for quasi the lifetime of the system (2**48 requests is a lot).
      
      The patch now changes the reseed threshold as follows: up until the time
      the DRBG obtains a seed from a fully iniitialized nonblocking pool, the
      reseeding threshold is lowered such that the DRBG is forced to reseed
      itself resonably often. Once it obtains the seed from a fully
      initialized nonblocking pool, the reseed threshold is set to the value
      required by SP800-90A.
      Signed-off-by: NStephan Mueller <smueller@chronox.de>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      42ea507f
    • S
      crypto: drbg - Use callback API for random readiness · 57225e67
      Stephan Mueller 提交于
      The get_blocking_random_bytes API is broken because the wait can
      be arbitrarily long (potentially forever) so there is no safe way
      of calling it from within the kernel.
      
      This patch replaces it with the new callback API which does not
      have this problem.
      
      The patch also removes the entropy buffer registered with the DRBG
      handle in favor of stack variables to hold the seed data.
      Signed-off-by: NStephan Mueller <smueller@chronox.de>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      57225e67
  5. 04 6月, 2015 1 次提交
  6. 27 5月, 2015 3 次提交
    • S
      crypto: drbg - use Jitter RNG to obtain seed · b8ec5ba4
      Stephan Mueller 提交于
      During initialization, the DRBG now tries to allocate a handle of the
      Jitter RNG. If such a Jitter RNG is available during seeding, the DRBG
      pulls the required entropy/nonce string from get_random_bytes and
      concatenates it with a string of equal size from the Jitter RNG. That
      combined string is now the seed for the DRBG.
      
      Written differently, the initial seed of the DRBG is now:
      
      get_random_bytes(entropy/nonce) || jitterentropy (entropy/nonce)
      
      If the Jitter RNG is not available, the DRBG only seeds from
      get_random_bytes.
      
      CC: Andreas Steffen <andreas.steffen@strongswan.org>
      CC: Theodore Ts'o <tytso@mit.edu>
      CC: Sandy Harris <sandyinchina@gmail.com>
      Signed-off-by: NStephan Mueller <smueller@chronox.de>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      b8ec5ba4
    • S
      crypto: drbg - add async seeding operation · 4c787990
      Stephan Mueller 提交于
      The async seeding operation is triggered during initalization right
      after the first non-blocking seeding is completed. As required by the
      asynchronous operation of random.c, a callback function is provided that
      is triggered by random.c once entropy is available. That callback
      function performs the actual seeding of the DRBG.
      
      CC: Andreas Steffen <andreas.steffen@strongswan.org>
      CC: Theodore Ts'o <tytso@mit.edu>
      CC: Sandy Harris <sandyinchina@gmail.com>
      Signed-off-by: NStephan Mueller <smueller@chronox.de>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      4c787990
    • S
      crypto: drbg - prepare for async seeding · 3d6a5f75
      Stephan Mueller 提交于
      In order to prepare for the addition of the asynchronous seeding call,
      the invocation of seeding the DRBG is moved out into a helper function.
      
      In addition, a block of memory is allocated during initialization time
      that will be used as a scratchpad for obtaining entropy. That scratchpad
      is used for the initial seeding operation as well as by the
      asynchronous seeding call. The memory must be zeroized every time the
      DRBG seeding call succeeds to avoid entropy data lingering in memory.
      
      CC: Andreas Steffen <andreas.steffen@strongswan.org>
      CC: Theodore Ts'o <tytso@mit.edu>
      CC: Sandy Harris <sandyinchina@gmail.com>
      Signed-off-by: NStephan Mueller <smueller@chronox.de>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      3d6a5f75
  7. 23 4月, 2015 1 次提交
  8. 22 4月, 2015 1 次提交
  9. 21 4月, 2015 6 次提交
  10. 09 3月, 2015 1 次提交
  11. 04 3月, 2015 2 次提交
  12. 05 1月, 2015 1 次提交
  13. 22 12月, 2014 1 次提交
    • S
      crypto: drbg - panic on continuous self test error · 905b42e5
      Stephan Mueller 提交于
      This patch adds a panic if the FIPS 140-2 self test error failed.
      Note, that entire code is only executed with fips_enabled (i.e. when the
      kernel is booted with fips=1. It is therefore not executed for 99.9% of
      all user base.
      
      As mathematically such failure cannot occur, this panic should never be
      triggered. But to comply with NISTs current requirements, an endless
      loop must be replaced with the panic.
      
      When the new version of FIPS 140 will be released, this entire
      continuous self test function will be ripped out as it will not be
      needed any more.
      
      This patch is functionally equivalent as implemented in ansi_cprng.c and drivers/char/random.c.
      Signed-off-by: NStephan Mueller <smueller@chronox.de>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      905b42e5
  14. 27 11月, 2014 1 次提交
  15. 26 11月, 2014 1 次提交
  16. 10 11月, 2014 1 次提交
  17. 24 10月, 2014 1 次提交
  18. 05 9月, 2014 1 次提交
  19. 26 8月, 2014 1 次提交
  20. 25 8月, 2014 8 次提交
  21. 01 8月, 2014 1 次提交
  22. 10 7月, 2014 1 次提交
  23. 08 7月, 2014 2 次提交
    • S
      crypto: drbg - HMAC-SHA1 DRBG has crypto strength of 128 bits · 5b635e28
      Stephan Mueller 提交于
      The patch corrects the security strength of the HMAC-SHA1 DRBG to 128
      bits. This strength defines the size of the seed required for the DRBG.
      Thus, the patch lowers the seeding requirement from 256 bits to 128 bits
      for HMAC-SHA1.
      Signed-off-by: NStephan Mueller <smueller@chronox.de>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      5b635e28
    • S
      crypto: drbg - Mix a time stamp into DRBG state · 27e4de2b
      Stephan Mueller 提交于
      The current locking approach of the DRBG tries to keep the protected
      code paths very minimal. It is therefore possible that two threads query
      one DRBG instance at the same time. When thread A requests random
      numbers, a shadow copy of the DRBG state is created upon which the
      request for A is processed. After finishing the state for A's request is
      merged back into the DRBG state. If now thread B requests random numbers
      from the same DRBG after the request for thread A is received, but
      before A's shadow state is merged back, the random numbers for B will be
      identical to the ones for A. Please note that the time window is very
      small for this scenario.
      
      To prevent that there is even a theoretical chance for thread A and B
      having the same DRBG state, the current time stamp is provided as
      additional information string for each new request.
      
      The addition of the time stamp as additional information string implies
      that now all generate functions must be capable to process a linked
      list with additional information strings instead of a scalar.
      
      CC: Rafael Aquini <aquini@redhat.com>
      Signed-off-by: NStephan Mueller <smueller@chronox.de>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      27e4de2b