]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
crypto: ccp - invoke fallback for XTS ciphertext stealing
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 22 Aug 2019 15:47:31 +0000 (18:47 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 30 Aug 2019 08:05:31 +0000 (18:05 +1000)
For correctness and compliance with the XTS-AES specification, we are
adding support for ciphertext stealing to XTS implementations, even
though no use cases are known that will be enabled by this.

Since the ccp driver already has a fallback skcipher standby for
dealing with input sizes other than [16, 512, 1024, 2048, 4096],
just drop the check against the block size.

Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Gary Hook <gary.hook@amd.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccp/ccp-crypto-aes-xts.c

index 783ba75e06187273aaaa02f0c068f9841662fc0a..8e4a531f4f707896657d67b3bb10b1a5c8b8cd0f 100644 (file)
@@ -116,9 +116,6 @@ static int ccp_aes_xts_crypt(struct ablkcipher_request *req,
        if (!ctx->u.aes.key_len)
                return -EINVAL;
 
-       if (req->nbytes & (AES_BLOCK_SIZE - 1))
-               return -EINVAL;
-
        if (!req->info)
                return -EINVAL;