Commit 633439f5 authored by Herbert Xu's avatar Herbert Xu

xfrm: Prepare for CRYPTO_MAX_ALG_NAME expansion

This patch fixes the xfrm_user code to use the actual array size
rather than the hard-coded CRYPTO_MAX_ALG_NAME length.  This is
because the array size is fixed at 64 bytes while we want to increase
the in-kernel CRYPTO_MAX_ALG_NAME value.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Acked-by: default avatarAlexander Sverdlin <alexander.sverdlin@nokia.com>
Tested-by: default avatarAlexander Sverdlin <alexander.sverdlin@nokia.com>
Acked-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
parent 3f69cc60
...@@ -55,7 +55,7 @@ static int verify_one_alg(struct nlattr **attrs, enum xfrm_attr_type_t type) ...@@ -55,7 +55,7 @@ static int verify_one_alg(struct nlattr **attrs, enum xfrm_attr_type_t type)
return -EINVAL; return -EINVAL;
} }
algp->alg_name[CRYPTO_MAX_ALG_NAME - 1] = '\0'; algp->alg_name[sizeof(algp->alg_name) - 1] = '\0';
return 0; return 0;
} }
...@@ -71,7 +71,7 @@ static int verify_auth_trunc(struct nlattr **attrs) ...@@ -71,7 +71,7 @@ static int verify_auth_trunc(struct nlattr **attrs)
if (nla_len(rt) < xfrm_alg_auth_len(algp)) if (nla_len(rt) < xfrm_alg_auth_len(algp))
return -EINVAL; return -EINVAL;
algp->alg_name[CRYPTO_MAX_ALG_NAME - 1] = '\0'; algp->alg_name[sizeof(algp->alg_name) - 1] = '\0';
return 0; return 0;
} }
...@@ -87,7 +87,7 @@ static int verify_aead(struct nlattr **attrs) ...@@ -87,7 +87,7 @@ static int verify_aead(struct nlattr **attrs)
if (nla_len(rt) < aead_len(algp)) if (nla_len(rt) < aead_len(algp))
return -EINVAL; return -EINVAL;
algp->alg_name[CRYPTO_MAX_ALG_NAME - 1] = '\0'; algp->alg_name[sizeof(algp->alg_name) - 1] = '\0';
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment