]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[IPSEC] ah: Remove keys from ah_data structure
authorHerbert Xu <herbert@gondor.apana.org.au>
Tue, 9 Oct 2007 00:14:34 +0000 (17:14 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 10 Oct 2007 23:54:53 +0000 (16:54 -0700)
The keys are only used during initialisation so we don't need to carry them
in esp_data.  Since we don't have to allocate them again, there is no need
to place a limit on the authentication key length anymore.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/ah.h
net/ipv4/ah4.c
net/ipv6/ah6.c

index 8f257c1599028e94128e2734f3ad2caa2082dd57..5e758c2b5dd5f4954c8b85dcc7d2d6d3a6f5c525 100644 (file)
@@ -9,8 +9,6 @@
 
 struct ah_data
 {
-       u8                      *key;
-       int                     key_len;
        u8                      *work_icv;
        int                     icv_full_len;
        int                     icv_trunc_len;
index 39f6211f1496050957ba6082d36a01799822c21b..dc1d8e871b24c621fc29de48fa053f9bc7a96383 100644 (file)
@@ -219,10 +219,6 @@ static int ah_init_state(struct xfrm_state *x)
        if (!x->aalg)
                goto error;
 
-       /* null auth can use a zero length key */
-       if (x->aalg->alg_key_len > 512)
-               goto error;
-
        if (x->encap)
                goto error;
 
@@ -230,14 +226,13 @@ static int ah_init_state(struct xfrm_state *x)
        if (ahp == NULL)
                return -ENOMEM;
 
-       ahp->key = x->aalg->alg_key;
-       ahp->key_len = (x->aalg->alg_key_len+7)/8;
        tfm = crypto_alloc_hash(x->aalg->alg_name, 0, CRYPTO_ALG_ASYNC);
        if (IS_ERR(tfm))
                goto error;
 
        ahp->tfm = tfm;
-       if (crypto_hash_setkey(tfm, ahp->key, ahp->key_len))
+       if (crypto_hash_setkey(tfm, x->aalg->alg_key,
+                              (x->aalg->alg_key_len + 7) / 8))
                goto error;
 
        /*
index 53f46ab6af7062528e907cf3a2e4676f2fd12afe..69a2030407b8bb2a098692ab44db0f35dc6cddea 100644 (file)
@@ -429,10 +429,6 @@ static int ah6_init_state(struct xfrm_state *x)
        if (!x->aalg)
                goto error;
 
-       /* null auth can use a zero length key */
-       if (x->aalg->alg_key_len > 512)
-               goto error;
-
        if (x->encap)
                goto error;
 
@@ -440,14 +436,13 @@ static int ah6_init_state(struct xfrm_state *x)
        if (ahp == NULL)
                return -ENOMEM;
 
-       ahp->key = x->aalg->alg_key;
-       ahp->key_len = (x->aalg->alg_key_len+7)/8;
        tfm = crypto_alloc_hash(x->aalg->alg_name, 0, CRYPTO_ALG_ASYNC);
        if (IS_ERR(tfm))
                goto error;
 
        ahp->tfm = tfm;
-       if (crypto_hash_setkey(tfm, ahp->key, ahp->key_len))
+       if (crypto_hash_setkey(tfm, x->aalg->alg_key,
+                              (x->aalg->alg_key_len + 7) / 8))
                goto error;
 
        /*