Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bc31d3b2c7d7f2a03721a05cb3c9a3ce8b1e2e5a
Commit:     bc31d3b2c7d7f2a03721a05cb3c9a3ce8b1e2e5a
Parent:     4b7137ff8fb49d7bf22dfa248baa0d02ace2c43d
Author:     Herbert Xu <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 8 17:14:34 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Oct 10 16:54:53 2007 -0700

    [IPSEC] ah: Remove keys from ah_data structure
    
    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 <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 include/net/ah.h |    2 --
 net/ipv4/ah4.c   |    9 ++-------
 net/ipv6/ah6.c   |    9 ++-------
 3 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/include/net/ah.h b/include/net/ah.h
index 8f257c1..5e758c2 100644
--- a/include/net/ah.h
+++ b/include/net/ah.h
@@ -9,8 +9,6 @@
 
 struct ah_data
 {
-       u8                      *key;
-       int                     key_len;
        u8                      *work_icv;
        int                     icv_full_len;
        int                     icv_trunc_len;
diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c
index 39f6211..dc1d8e8 100644
--- a/net/ipv4/ah4.c
+++ b/net/ipv4/ah4.c
@@ -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;
 
        /*
diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c
index 53f46ab..69a2030 100644
--- a/net/ipv6/ah6.c
+++ b/net/ipv6/ah6.c
@@ -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;
 
        /*
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to