diff options
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/ah6.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c index 53f46ab6af7..69a2030407b 100644 --- a/net/ipv6/ah6.c +++ b/net/ipv6/ah6.c | |||
@@ -429,10 +429,6 @@ static int ah6_init_state(struct xfrm_state *x) | |||
429 | if (!x->aalg) | 429 | if (!x->aalg) |
430 | goto error; | 430 | goto error; |
431 | 431 | ||
432 | /* null auth can use a zero length key */ | ||
433 | if (x->aalg->alg_key_len > 512) | ||
434 | goto error; | ||
435 | |||
436 | if (x->encap) | 432 | if (x->encap) |
437 | goto error; | 433 | goto error; |
438 | 434 | ||
@@ -440,14 +436,13 @@ static int ah6_init_state(struct xfrm_state *x) | |||
440 | if (ahp == NULL) | 436 | if (ahp == NULL) |
441 | return -ENOMEM; | 437 | return -ENOMEM; |
442 | 438 | ||
443 | ahp->key = x->aalg->alg_key; | ||
444 | ahp->key_len = (x->aalg->alg_key_len+7)/8; | ||
445 | tfm = crypto_alloc_hash(x->aalg->alg_name, 0, CRYPTO_ALG_ASYNC); | 439 | tfm = crypto_alloc_hash(x->aalg->alg_name, 0, CRYPTO_ALG_ASYNC); |
446 | if (IS_ERR(tfm)) | 440 | if (IS_ERR(tfm)) |
447 | goto error; | 441 | goto error; |
448 | 442 | ||
449 | ahp->tfm = tfm; | 443 | ahp->tfm = tfm; |
450 | if (crypto_hash_setkey(tfm, ahp->key, ahp->key_len)) | 444 | if (crypto_hash_setkey(tfm, x->aalg->alg_key, |
445 | (x->aalg->alg_key_len + 7) / 8)) | ||
451 | goto error; | 446 | goto error; |
452 | 447 | ||
453 | /* | 448 | /* |