From: Herbert Xu Date: Mon, 10 Dec 2007 02:55:21 +0000 (+0800) Subject: [CRYPTO] authenc: Use RTA_OK to check length X-Git-Tag: v2.6.25-rc1~1242^2~54 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12dc5e62b4f93f1d399fd81e35be3f9ea0027712;p=linux-2.6 [CRYPTO] authenc: Use RTA_OK to check length This patch changes setkey to use RTA_OK to check the validity of the setkey request. Signed-off-by: Herbert Xu --- diff --git a/crypto/authenc.c b/crypto/authenc.c index 80d9d0b18c..aa442dea5c 100644 --- a/crypto/authenc.c +++ b/crypto/authenc.c @@ -44,7 +44,7 @@ static int crypto_authenc_setkey(struct crypto_aead *authenc, const u8 *key, struct crypto_authenc_key_param *param; int err = -EINVAL; - if (keylen < sizeof(*rta)) + if (!RTA_OK(rta, keylen)) goto badkey; if (rta->rta_type != CRYPTO_AUTHENC_KEYA_PARAM) goto badkey;