16 Jul, 2020

1 commit

  • Even though the omap-aes driver implements asynchronous versions of
    ecb(aes), cbc(aes) and ctr(aes), the fallbacks it allocates are required
    to be synchronous. Given that SIMD based software implementations are
    usually asynchronous as well, even though they rarely complete
    asynchronously (this typically only happens in cases where the request was
    made from softirq context, while SIMD was already in use in the task
    context that it interrupted), these implementations are disregarded, and
    either the generic C version or another table based version implemented in
    assembler is selected instead.

    Since falling back to synchronous AES is not only a performance issue, but
    potentially a security issue as well (due to the fact that table based AES
    is not time invariant), let's fix this, by allocating an ordinary skcipher
    as the fallback, and invoke it with the completion routine that was given
    to the outer request.

    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Herbert Xu

    Ard Biesheuvel
     

11 Dec, 2019

3 commits

  • Currently omap-aes-gcm algorithms are using local implementation for
    crypto request queuing logic. Instead, implement this via usage of
    crypto engine which is used already for rest of the omap aes algorithms.
    This avoids some random conflicts / crashes also which can happen if
    both aes and aes-gcm are attempted to be used simultaneously.

    Signed-off-by: Tero Kristo
    Signed-off-by: Herbert Xu

    Tero Kristo
     
  • The OMAP AES-GCM implementation uses a fallback ecb(aes) skcipher to
    produce the keystream to encrypt the output tag. Let's use the new
    AES library instead - this is much simpler, and shouldn't affect
    performance given that it only involves a single block.

    Signed-off-by: Ard Biesheuvel
    Reviewed-by: Tero Kristo
    Tested-by: Tero Kristo
    Signed-off-by: Herbert Xu

    Ard Biesheuvel
     
  • GCM only permits certain tag lengths, so populate the .setauthsize
    hooks which ensure that only permitted sizes are accepted by the
    implementation.

    Signed-off-by: Ard Biesheuvel
    Reviewed-by: Tero Kristo
    Tested-by: Tero Kristo
    Signed-off-by: Herbert Xu

    Ard Biesheuvel
     

17 Nov, 2019

1 commit

  • Commit 7a7ffe65c8c5 ("crypto: skcipher - Add top-level skcipher interface")
    dated 20 august 2015 introduced the new skcipher API which is supposed to
    replace both blkcipher and ablkcipher. While all consumers of the API have
    been converted long ago, some producers of the ablkcipher remain, forcing
    us to keep the ablkcipher support routines alive, along with the matching
    code to expose [a]blkciphers via the skcipher API.

    So switch this driver to the skcipher API, allowing us to finally drop the
    ablkcipher code in the near future.

    Cc: Tony Lindgren
    Cc: linux-omap@vger.kernel.org
    Reviewed-by: Tero Kristo
    Tested-by: Tero Kristo
    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Herbert Xu

    Ard Biesheuvel
     

19 Jun, 2019

1 commit

  • Based on 2 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation #

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 4122 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Enrico Weigelt
    Reviewed-by: Kate Stewart
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

28 Sep, 2018

1 commit

  • In the quest to remove all stack VLA usage from the kernel[1], this
    replaces struct crypto_skcipher and SKCIPHER_REQUEST_ON_STACK() usage
    with struct crypto_sync_skcipher and SYNC_SKCIPHER_REQUEST_ON_STACK(),
    which uses a fixed stack size.

    [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com

    Signed-off-by: Kees Cook
    Signed-off-by: Herbert Xu

    Kees Cook
     

15 Feb, 2018

1 commit


10 Jun, 2017

3 commits