diff options
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/ah4.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c index 39f6211f1496..dc1d8e871b24 100644 --- a/net/ipv4/ah4.c +++ b/net/ipv4/ah4.c | |||
@@ -219,10 +219,6 @@ static int ah_init_state(struct xfrm_state *x) | |||
219 | if (!x->aalg) | 219 | if (!x->aalg) |
220 | goto error; | 220 | goto error; |
221 | 221 | ||
222 | /* null auth can use a zero length key */ | ||
223 | if (x->aalg->alg_key_len > 512) | ||
224 | goto error; | ||
225 | |||
226 | if (x->encap) | 222 | if (x->encap) |
227 | goto error; | 223 | goto error; |
228 | 224 | ||
@@ -230,14 +226,13 @@ static int ah_init_state(struct xfrm_state *x) | |||
230 | if (ahp == NULL) | 226 | if (ahp == NULL) |
231 | return -ENOMEM; | 227 | return -ENOMEM; |
232 | 228 | ||
233 | ahp->key = x->aalg->alg_key; | ||
234 | ahp->key_len = (x->aalg->alg_key_len+7)/8; | ||
235 | tfm = crypto_alloc_hash(x->aalg->alg_name, 0, CRYPTO_ALG_ASYNC); | 229 | tfm = crypto_alloc_hash(x->aalg->alg_name, 0, CRYPTO_ALG_ASYNC); |
236 | if (IS_ERR(tfm)) | 230 | if (IS_ERR(tfm)) |
237 | goto error; | 231 | goto error; |
238 | 232 | ||
239 | ahp->tfm = tfm; | 233 | ahp->tfm = tfm; |
240 | if (crypto_hash_setkey(tfm, ahp->key, ahp->key_len)) | 234 | if (crypto_hash_setkey(tfm, x->aalg->alg_key, |
235 | (x->aalg->alg_key_len + 7) / 8)) | ||
241 | goto error; | 236 | goto error; |
242 | 237 | ||
243 | /* | 238 | /* |