1. 07 12月, 2016 1 次提交
    • S
      crypto: algif_aead - fix AEAD tag memory handling · 0c1e16cd
      Stephan Mueller 提交于
      For encryption, the AEAD ciphers require AAD || PT as input and generate
      AAD || CT || Tag as output and vice versa for decryption. Prior to this
      patch, the AF_ALG interface for AEAD ciphers requires the buffer to be
      present as input for encryption. Similarly, the output buffer for
      decryption required the presence of the tag buffer too. This implies
      that the kernel reads / writes data buffers from/to kernel space
      even though this operation is not required.
      
      This patch changes the AF_ALG AEAD interface to be consistent with the
      in-kernel AEAD cipher requirements.
      
      Due to this handling, he changes are transparent to user space with one
      exception: the return code of recv indicates the mount of output buffer.
      That output buffer has a different size compared to before the patch
      which implies that the return code of recv will also be different.
      For example, a decryption operation uses 16 bytes AAD, 16 bytes CT and
      16 bytes tag, the AF_ALG AEAD interface before showed a recv return
      code of 48 (bytes) whereas after this patch, the return code is 32
      since the tag is not returned any more.
      Reported-by: NMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: NStephan Mueller <smueller@chronox.de>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      0c1e16cd
  2. 05 4月, 2016 1 次提交
    • T
      crypto: af_alg - add async support to algif_aead · 83094e5e
      Tadeusz Struk 提交于
      Following the async change for algif_skcipher
      this patch adds similar async read to algif_aead.
      
      changes in v3:
      - add call to aead_reset_ctx directly from aead_put_sgl instead of calling
        them separatelly one after the other
      - remove wait from aead_sock_destruct function as it is not needed
        when sock_hold is used
      
      changes in v2:
      - change internal data structures from fixed size arrays, limited to
        RSGL_MAX_ENTRIES, to linked list model with no artificial limitation.
      - use sock_kmalloc instead of kmalloc for memory allocation
      - use sock_hold instead of separate atomic ctr to wait for outstanding
        request
      Signed-off-by: NTadeusz Struk <tadeusz.struk@intel.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      83094e5e
  3. 02 12月, 2015 1 次提交
    • E
      net: rename SOCK_ASYNC_NOSPACE and SOCK_ASYNC_WAITDATA · 9cd3e072
      Eric Dumazet 提交于
      This patch is a cleanup to make following patch easier to
      review.
      
      Goal is to move SOCK_ASYNC_NOSPACE and SOCK_ASYNC_WAITDATA
      from (struct socket)->flags to a (struct socket_wq)->flags
      to benefit from RCU protection in sock_wake_async()
      
      To ease backports, we rename both constants.
      
      Two new helpers, sk_set_bit(int nr, struct sock *sk)
      and sk_clear_bit(int net, struct sock *sk) are added so that
      following patch can change their implementation.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9cd3e072
  4. 01 12月, 2015 1 次提交
  5. 17 11月, 2015 1 次提交
  6. 25 8月, 2015 1 次提交
  7. 17 8月, 2015 1 次提交
  8. 22 6月, 2015 1 次提交
  9. 28 5月, 2015 1 次提交
  10. 18 5月, 2015 1 次提交
  11. 23 4月, 2015 1 次提交
  12. 16 4月, 2015 1 次提交
    • L
      crypto: fix mis-merge with the networking merge · eccd02f3
      Linus Torvalds 提交于
      The networking updates from David Miller removed the iocb argument from
      sendmsg and recvmsg (in commit 1b784140: "net: Remove iocb argument
      from sendmsg and recvmsg"), but the crypto code had added new instances
      of them.
      
      When I pulled the crypto update, it was a silent semantic mis-merge, and
      I overlooked the new warning messages in my test-build.  I try to fix
      those in the merge itself, but that relies on me noticing. Oh well.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      eccd02f3
  13. 04 3月, 2015 1 次提交
    • S
      crypto: algif - add AEAD support · 400c40cf
      Stephan Mueller 提交于
      This patch adds the AEAD support for AF_ALG.
      
      The implementation is based on algif_skcipher, but contains heavy
      modifications to streamline the interface for AEAD uses.
      
      To use AEAD, the user space consumer has to use the salg_type named
      "aead".
      
      The AEAD implementation includes some overhead to calculate the size of
      the ciphertext, because the AEAD implementation of the kernel crypto API
      makes implied assumption on the location of the authentication tag. When
      performing an encryption, the tag will be added to the created
      ciphertext (note, the tag is placed adjacent to the ciphertext). For
      decryption, the caller must hand in the ciphertext with the tag appended
      to the ciphertext. Therefore, the selection of the used memory
      needs to add/subtract the tag size from the source/destination buffers
      depending on the encryption type. The code is provided with comments
      explaining when and how that operation is performed.
      
      A fully working example using all aspects of AEAD is provided at
      http://www.chronox.de/libkcapi.htmlSigned-off-by: NStephan Mueller <smueller@chronox.de>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      400c40cf