crypto: AEAD: add check for presence of auth tag
PATCH v2 1/1 crypto: AEAD: add check for presence of auth tag
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 with at least the authentication tag.
Signed-off-by Stephan Mueller <[email protected]>
--- include/linux/crypto.h | 3 +++ 1 file changed, 3 insertions(+)
include/linux/crypto.h +3 -0
@@ -1412,6 +1412,9 @@ static inline int crypto_aead_encrypt(struct aead_request *req)*/ static inline int crypto_aead_decrypt (struct aead_request *req) { +if (req->cryptlen <crypto_aead_authsize (crypto_aead_reqtfm (req))) +return -EINVAL ; +return crypto_aead_crt (crypto_aead_reqtfm (req))->decrypt (req); }
Signature · 1 line
2.1.0
Quoted 5 lines · Stephan Mueller
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 with at least the authentication tag.
Signed-off-by Stephan Mueller <[email protected]>
Applied.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt