1. 09 8月, 2016 37 次提交
  2. 08 8月, 2016 3 次提交
    • H
      crypto: caam - defer aead_set_sh_desc in case of zero authsize · 2fdea258
      Horia Geantă 提交于
      To be able to generate shared descriptors for AEAD, the authentication size
      needs to be known. However, there is no imposed order of calling .setkey,
      .setauthsize callbacks.
      
      Thus, in case authentication size is not known at .setkey time, defer it
      until .setauthsize is called.
      
      The authsize != 0 check was incorrectly removed when converting the driver
      to the new AEAD interface.
      
      Cc: <stable@vger.kernel.org> # 4.3+
      Fixes: 479bcc7c ("crypto: caam - Convert authenc to new AEAD interface")
      Signed-off-by: NHoria Geantă <horia.geanta@nxp.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      2fdea258
    • H
      crypto: caam - fix echainiv(authenc) encrypt shared descriptor · 1d2d87e8
      Horia Geantă 提交于
      There are a few things missed by the conversion to the
      new AEAD interface:
      
      1 - echainiv(authenc) encrypt shared descriptor
      
      The shared descriptor is incorrect: due to the order of operations,
      at some point in time MATH3 register is being overwritten.
      
      2 - buffer used for echainiv(authenc) encrypt shared descriptor
      
      Encrypt and givencrypt shared descriptors (for AEAD ops) are mutually
      exclusive and thus use the same buffer in context state: sh_desc_enc.
      
      However, there's one place missed by s/sh_desc_givenc/sh_desc_enc,
      leading to errors when echainiv(authenc(...)) algorithms are used:
      DECO: desc idx 14: Header Error. Invalid length or parity, or
      certain other problems.
      
      While here, also fix a typo: dma_mapping_error() is checking
      for validity of sh_desc_givenc_dma instead of sh_desc_enc_dma.
      
      Cc: <stable@vger.kernel.org> # 4.3+
      Fixes: 479bcc7c ("crypto: caam - Convert authenc to new AEAD interface")
      Signed-off-by: NHoria Geantă <horia.geanta@nxp.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      1d2d87e8
    • G
      crypto: sha3 - Add missing ULL suffixes for 64-bit constants · f743e70e
      Geert Uytterhoeven 提交于
      On 32-bit (e.g. with m68k-linux-gnu-gcc-4.1):
      
          crypto/sha3_generic.c:27: warning: integer constant is too large for ‘long’ type
          crypto/sha3_generic.c:28: warning: integer constant is too large for ‘long’ type
          crypto/sha3_generic.c:29: warning: integer constant is too large for ‘long’ type
          crypto/sha3_generic.c:29: warning: integer constant is too large for ‘long’ type
          crypto/sha3_generic.c:31: warning: integer constant is too large for ‘long’ type
          crypto/sha3_generic.c:31: warning: integer constant is too large for ‘long’ type
          crypto/sha3_generic.c:32: warning: integer constant is too large for ‘long’ type
          crypto/sha3_generic.c:32: warning: integer constant is too large for ‘long’ type
          crypto/sha3_generic.c:32: warning: integer constant is too large for ‘long’ type
          crypto/sha3_generic.c:33: warning: integer constant is too large for ‘long’ type
          crypto/sha3_generic.c:33: warning: integer constant is too large for ‘long’ type
          crypto/sha3_generic.c:34: warning: integer constant is too large for ‘long’ type
          crypto/sha3_generic.c:34: warning: integer constant is too large for ‘long’ type
      
      Fixes: 53964b9e ("crypto: sha3 - Add SHA-3 hash algorithm")
      Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      f743e70e