1. 26 Jan, 2015 2 commits
  2. 20 Jan, 2015 5 commits
  3. 15 Jan, 2015 1 commit
  4. 14 Jan, 2015 3 commits
  5. 13 Jan, 2015 11 commits
  6. 08 Jan, 2015 4 commits
  7. 05 Jan, 2015 2 commits
  8. 04 Jan, 2015 1 commit
  9. 29 Dec, 2014 2 commits
    • Stephan Mueller's avatar
      crypto: algif_rng - enable RNG interface compilation · 2f375538
      Stephan Mueller authored
      Enable compilation of the RNG AF_ALG support and provide a Kconfig
      option to compile the RNG AF_ALG support.
      Signed-off-by: default avatarStephan Mueller <smueller@chronox.de>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      2f375538
    • Stephan Mueller's avatar
      crypto: algif_rng - add random number generator support · 5afdfd22
      Stephan Mueller authored
      This patch adds the random number generator support for AF_ALG.
      
      A random number generator's purpose is to generate data without
      requiring the caller to provide any data. Therefore, the AF_ALG
      interface handler for RNGs only implements a callback handler for
      recvmsg.
      
      The following parameters provided with a recvmsg are processed by the
      RNG callback handler:
      
      	* sock - to resolve the RNG context data structure accessing the
      	  RNG instance private to the socket
      
      	* len - this parameter allows userspace callers to specify how
      	  many random bytes the RNG shall produce and return. As the
      	  kernel context for the RNG allocates a buffer of 128 bytes to
      	  store random numbers before copying them to userspace, the len
      	  parameter is checked that it is not larger than 128. If a
      	  caller wants more random numbers, a new request for recvmsg
      	  shall be made.
      
      The size of 128 bytes is chose because of the following considerations:
      
      	* to increase the memory footprint of the kernel too much (note,
      	  that would be 128 bytes per open socket)
      
      	* 128 is divisible by any typical cryptographic block size an
      	  RNG may have
      
      	* A request for random numbers typically only shall supply small
      	  amount of data like for keys or IVs that should only require
      	  one invocation of the recvmsg function.
      
      Note, during instantiation of the RNG, the code checks whether the RNG
      implementation requires seeding. If so, the RNG is seeded with output
      from get_random_bytes.
      
      A fully working example using all aspects of the RNG interface is
      provided at http://www.chronox.de/libkcapi.htmlSigned-off-by: default avatarStephan Mueller <smueller@chronox.de>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      5afdfd22
  10. 25 Dec, 2014 6 commits
  11. 23 Dec, 2014 3 commits