1
0
Fork 0

[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 <herbert@gondor.apana.org.au>
hifive-unleashed-5.1
Herbert Xu 2007-12-10 10:55:21 +08:00
parent c2c61f513d
commit 12dc5e62b4
1 changed files with 1 additions and 1 deletions

View File

@ -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;