diff mbox

xfrm: Fix truncation length of authentication algorithms installed via PF_KEY

Message ID 1260375075-16187-1-git-send-email-martin@strongswan.org
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Martin Willi Dec. 9, 2009, 4:11 p.m. UTC
Commit 4447bb33f09444920a8f1d89e1540137429351b6 breaks installation of
authentication algorithms via PF_KEY, as the state specific truncation
length is not installed with the algorithms default truncation length.
This patch initializes state properly to the default if installed via
PF_KEY.

Signed-off-by: Martin Willi <martin@strongswan.org>
---
 net/key/af_key.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

Herbert Xu Dec. 11, 2009, 6:28 a.m. UTC | #1
On Wed, Dec 09, 2009 at 05:11:15PM +0100, Martin Willi wrote:
> Commit 4447bb33f09444920a8f1d89e1540137429351b6 breaks installation of
> authentication algorithms via PF_KEY, as the state specific truncation
> length is not installed with the algorithms default truncation length.
> This patch initializes state properly to the default if installed via
> PF_KEY.
> 
> Signed-off-by: Martin Willi <martin@strongswan.org>

Acked-by: Herbert Xu <herbert@gondor.apana.org.au>

Thanks,
David Miller Dec. 11, 2009, 11:15 p.m. UTC | #2
From: Martin Willi <martin@strongswan.org>
Date: Wed,  9 Dec 2009 17:11:15 +0100

> Commit 4447bb33f09444920a8f1d89e1540137429351b6 breaks installation of
> authentication algorithms via PF_KEY, as the state specific truncation
> length is not installed with the algorithms default truncation length.
> This patch initializes state properly to the default if installed via
> PF_KEY.
> 
> Signed-off-by: Martin Willi <martin@strongswan.org>

Applied.

Herbert, thanks for reviewing, I didn't miss your ACK.  :-)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/key/af_key.c b/net/key/af_key.c
index 84209fb..76fa6fe 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -1193,6 +1193,7 @@  static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net,
 			x->aalg->alg_key_len = key->sadb_key_bits;
 			memcpy(x->aalg->alg_key, key+1, keysize);
 		}
+		x->aalg->alg_trunc_len = a->uinfo.auth.icv_truncbits;
 		x->props.aalgo = sa->sadb_sa_auth;
 		/* x->algo.flags = sa->sadb_sa_flags; */
 	}