Skip to content

Commit

Permalink
[CRYPTO] authenc: Use RTA_OK to check length
Browse files Browse the repository at this point in the history
This patch changes setkey to use RTA_OK to check the validity of the
setkey request.

Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
herbertx committed Jan 10, 2008
1 parent c2c61f5 commit 12dc5e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/authenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 12dc5e6

Please sign in to comment.