]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: ccm - honour alignmask of subordinate MAC cipher
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Sat, 11 Feb 2017 19:25:21 +0000 (19:25 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 15 Feb 2017 05:23:45 +0000 (13:23 +0800)
commit900ba64542e3a511d43dab9a1700fe6d77e33bd7
treecb27a7354999fe514c521ff01bdd34ef75cae95c
parent43cb16a19240dec3f7929966d51bf059f7fd7273
crypto: ccm - honour alignmask of subordinate MAC cipher

The CCM driver was recently updated to defer the MAC part of the algorithm
to a dedicated crypto transform, and a template for instantiating such
transforms was added at the same time.

However, this new cbcmac template fails to take the alignmask of the
encapsulated cipher into account, which may result in buffer addresses
being passed down that are not sufficiently aligned.

So update the code to ensure that the digest buffer in the desc ctx
appears at a sufficiently aligned offset, and tweak the code so that all
calls to crypto_cipher_encrypt_one() operate on this buffer exclusively.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/ccm.c