11 Feb, 2017

1 commit


08 Feb, 2017

1 commit

  • Switch the FILS AEAD code to use a cmac(aes) shash instantiated by the
    crypto API rather than reusing the open coded implementation in
    aes_cmac_vector(). This makes the code more understandable, and allows
    platforms to implement cmac(aes) in a more secure (*) and efficient way
    than is typically possible when using the AES cipher directly.

    So replace the crypto_cipher by a crypto_shash, and update the aes_s2v()
    routine to call the shash interface directly.

    * In particular, the generic table based AES implementation is sensitive
    to known-plaintext timing attacks on the key, to which AES based MAC
    algorithms are especially vulnerable, given that their plaintext is not
    usually secret. Time invariant alternatives are available (e.g., based
    on SIMD algorithms), but may incur a setup cost that is prohibitive when
    operating on a single block at a time, which is why they don't usually
    expose the cipher API.

    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Johannes Berg

    Ard Biesheuvel
     

06 Feb, 2017

2 commits

  • The skcipher could have been of the async variant which may return from
    skcipher_encrypt() with -EINPROGRESS after having queued the request.
    The FILS AEAD implementation here does not have code for dealing with
    that possibility, so allocate a sync cipher explicitly to avoid
    potential issues with hardware accelerators.

    This is based on the patch sent out by Ard.

    Fixes: 39404feee691 ("mac80211: FILS AEAD protection for station mode association frames")
    Reported-by: Ard Biesheuvel
    Signed-off-by: Jouni Malinen
    Signed-off-by: Johannes Berg

    Jouni Malinen
     
  • Incorrect num_elem parameter value (1 vs. 5) was used in the
    aes_siv_encrypt() call. This resulted in only the first one of the five
    AAD vectors to SIV getting included in calculation. This does not
    protect all the contents correctly and would not interoperate with a
    standard compliant implementation.

    Fix this by using the correct number. A matching fix is needed in the AP
    side (hostapd) to get FILS authentication working properly.

    Fixes: 39404feee691 ("mac80211: FILS AEAD protection for station mode association frames")
    Reported-by: Ard Biesheuvel
    Signed-off-by: Jouni Malinen
    Signed-off-by: Johannes Berg

    Jouni Malinen
     

28 Oct, 2016

1 commit

  • gcc -Wmaybe-uninitialized reports a bug in aes_siv_encryp:

    net/mac80211/fils_aead.c: In function ‘aes_siv_encrypt.constprop’:
    net/mac80211/fils_aead.c:84:26: error: ‘tfm2’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

    At the time that the memory allocation fails, 'tfm2' has not been
    allocated, so we should not attempt to free it later, and we can
    simply return an error.

    Fixes: 39404feee691 ("mac80211: FILS AEAD protection for station mode association frames")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Johannes Berg

    Arnd Bergmann
     

27 Oct, 2016

1 commit