07 Oct, 2017

1 commit


03 May, 2017

1 commit

  • Pull crypto updates from Herbert Xu:
    "Here is the crypto update for 4.12:

    API:
    - Add batch registration for acomp/scomp
    - Change acomp testing to non-unique compressed result
    - Extend algorithm name limit to 128 bytes
    - Require setkey before accept(2) in algif_aead

    Algorithms:
    - Add support for deflate rfc1950 (zlib)

    Drivers:
    - Add accelerated crct10dif for powerpc
    - Add crc32 in stm32
    - Add sha384/sha512 in ccp
    - Add 3des/gcm(aes) for v5 devices in ccp
    - Add Queue Interface (QI) backend support in caam
    - Add new Exynos RNG driver
    - Add ThunderX ZIP driver
    - Add driver for hardware random generator on MT7623 SoC"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (101 commits)
    crypto: stm32 - Fix OF module alias information
    crypto: algif_aead - Require setkey before accept(2)
    crypto: scomp - add support for deflate rfc1950 (zlib)
    crypto: scomp - allow registration of multiple scomps
    crypto: ccp - Change ISR handler method for a v5 CCP
    crypto: ccp - Change ISR handler method for a v3 CCP
    crypto: crypto4xx - rename ce_ring_contol to ce_ring_control
    crypto: testmgr - Allow ecb(cipher_null) in FIPS mode
    Revert "crypto: arm64/sha - Add constant operand modifier to ASM_EXPORT"
    crypto: ccp - Disable interrupts early on unload
    crypto: ccp - Use only the relevant interrupt bits
    hwrng: mtk - Add driver for hardware random generator on MT7623 SoC
    dt-bindings: hwrng: Add Mediatek hardware random generator bindings
    crypto: crct10dif-vpmsum - Fix missing preempt_disable()
    crypto: testmgr - replace compression known answer test
    crypto: acomp - allow registration of multiple acomps
    hwrng: n2 - Use devm_kcalloc() in n2rng_probe()
    crypto: chcr - Fix error handling related to 'chcr_alloc_shash'
    padata: get_next is never NULL
    crypto: exynos - Add new Exynos RNG driver
    ...

    Linus Torvalds
     

10 Apr, 2017

1 commit

  • When we get an EINPROGRESS completion in xts, we will end up marking
    the request as done and freeing it. This then blows up when the
    request is really completed as we've already freed the memory.

    Fixes: f1c131b45410 ("crypto: xts - Convert to skcipher")
    Cc:
    Reported-by: Nathan Royce
    Reported-by: Krzysztof Kozlowski
    Signed-off-by: Herbert Xu
    Tested-by: Krzysztof Kozlowski

    Herbert Xu
     

05 Apr, 2017

1 commit

  • Currently, gf128mul_x_ble works with pointers to be128, even though it
    actually interprets the words as little-endian. Consequently, it uses
    cpu_to_le64/le64_to_cpu on fields of type __be64, which is incorrect.

    This patch fixes that by changing the function to accept pointers to
    le128 and updating all users accordingly.

    Signed-off-by: Ondrej Mosnacek
    Reviewd-by: Eric Biggers
    Signed-off-by: Herbert Xu

    Ondrej Mosnáček
     

24 Mar, 2017

1 commit

  • In the generic XTS and LRW algorithms, for input data > 128 bytes, a
    temporary buffer is allocated to hold the values to be XOR'ed with the
    data before and after encryption or decryption. If the allocation
    fails, the fixed-size buffer embedded in the request buffer is meant to
    be used as a fallback --- resulting in more calls to the ECB algorithm,
    but still producing the correct result. However, we weren't correctly
    limiting subreq->cryptlen in this case, resulting in pre_crypt()
    overrunning the embedded buffer. Fix this by setting subreq->cryptlen
    correctly.

    Fixes: f1c131b45410 ("crypto: xts - Convert to skcipher")
    Fixes: 700cb3f5fe75 ("crypto: lrw - Convert to skcipher")
    Cc: stable@vger.kernel.org # v4.10+
    Reported-by: Dmitry Vyukov
    Signed-off-by: Eric Biggers
    Acked-by: David S. Miller
    Signed-off-by: Herbert Xu

    Eric Biggers
     

27 Feb, 2017

1 commit

  • When we're used as a fallback algorithm, we should propagate
    the NEED_FALLBACK bit when searching for the underlying ECB mode.

    This just happens to fix a hang too because otherwise the search
    may end up loading the same module that triggered this XTS creation.

    Cc: stable@vger.kernel.org #4.10
    Fixes: f1c131b45410 ("crypto: xts - Convert to skcipher")
    Reported-by: Harald Freudenberger
    Signed-off-by: Herbert Xu

    Herbert Xu
     

28 Nov, 2016

1 commit

  • This patch converts xts over to the skcipher interface. It also
    optimises the implementation to be based on ECB instead of the
    underlying cipher. For compatibility the existing naming scheme
    of xts(aes) is maintained as opposed to the more obvious one of
    xts(ecb(aes)).

    Signed-off-by: Herbert Xu

    Herbert Xu
     

16 Aug, 2016

1 commit


17 Feb, 2016

1 commit

  • The patch centralizes the XTS key check logic into the service function
    xts_check_key which is invoked from the different XTS implementations.
    With this, the XTS implementations in ARM, ARM64, PPC and S390 have now
    a sanity check for the XTS keys similar to the other arches.

    In addition, this service function received a check to ensure that the
    key != the tweak key which is mandated by FIPS 140-2 IG A.9. As the
    check is not present in the standards defining XTS, it is only enforced
    in FIPS mode of the kernel.

    Signed-off-by: Stephan Mueller
    Signed-off-by: Herbert Xu

    Stephan Mueller
     

26 Nov, 2014

1 commit

  • This adds the module loading prefix "crypto-" to the template lookup
    as well.

    For example, attempting to load 'vfat(blowfish)' via AF_ALG now correctly
    includes the "crypto-" prefix at every level, correctly rejecting "vfat":

    net-pf-38
    algif-hash
    crypto-vfat(blowfish)
    crypto-vfat(blowfish)-all
    crypto-vfat

    Reported-by: Mathias Krause
    Signed-off-by: Kees Cook
    Acked-by: Mathias Krause
    Signed-off-by: Herbert Xu

    Kees Cook
     

09 Nov, 2011

2 commits


31 Mar, 2011

1 commit


26 May, 2010

1 commit

  • Use ERR_CAST(x) rather than ERR_PTR(PTR_ERR(x)). The former makes more
    clear what is the purpose of the operation, which otherwise looks like a
    no-op.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    type T;
    T x;
    identifier f;
    @@

    T f (...) { }

    @@
    expression x;
    @@

    - ERR_PTR(PTR_ERR(x))
    + ERR_CAST(x)
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Herbert Xu

    Julia Lawall
     

06 Mar, 2008

1 commit

  • The XTS blockmode uses a copy of the IV which is saved on the stack
    and may or may not be properly aligned. If it is not, it will break
    hardware cipher like the geode or padlock.
    This patch encrypts the IV in place so we don't have to worry about
    alignment.

    Signed-off-by: Sebastian Siewior
    Tested-by: Stefan Hellermann
    Signed-off-by: Herbert Xu

    Sebastian Siewior
     

11 Oct, 2007

1 commit

  • XTS currently considered to be the successor of the LRW mode by the IEEE1619
    workgroup. LRW was discarded, because it was not secure if the encyption key
    itself is encrypted with LRW.

    XTS does not have this problem. The implementation is pretty straightforward,
    a new function was added to gf128mul to handle GF(128) elements in ble format.
    Four testvectors from the specification
    http://grouper.ieee.org/groups/1619/email/pdf00086.pdf
    were added, and they verify on my system.

    Signed-off-by: Rik Snel
    Signed-off-by: Herbert Xu

    Rik Snel