Re: [PATCH] crypto: AEAD: add check for presence of auth tag

From: Herbert Xu
Date: Mon Jan 05 2015 - 05:19:15 EST


On Tue, Dec 30, 2014 at 10:16:03PM +0100, Stephan Mueller wrote:
> The AEAD decryption operation requires the authentication tag to be
> present as part of the cipher text buffer. The added check verifies that
> the caller provides a cipher text buffer with at least the
> authentication tag.
>
> As the cipher text is provided as a scatterlist, loop through the
> scatterlist until we know we have sufficient cipher text bytes to invoke
> the AEAD decryption operation.

There is no need to vet the scatterlist. For kernel users it's
up to them to ensure that the length is valid with respect to the
sg list.

For the user-space interface obviously you should ensure that a
valid length is supplied.

Cheers,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/