From patchwork Wed Dec 9 16:11:15 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Willi X-Patchwork-Id: 40733 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 92264B7B3E for ; Thu, 10 Dec 2009 03:11:45 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756133AbZLIQLY (ORCPT ); Wed, 9 Dec 2009 11:11:24 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756128AbZLIQLY (ORCPT ); Wed, 9 Dec 2009 11:11:24 -0500 Received: from zaes.ch ([213.133.111.41]:59257 "EHLO zaes.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756117AbZLIQLW (ORCPT ); Wed, 9 Dec 2009 11:11:22 -0500 Received: from 193-180.60-188.cust.bluewin.ch ([188.60.180.193] helo=localhost.localdomain) by zaes.ch with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1NIPRd-0008Qx-U3; Wed, 09 Dec 2009 17:31:18 +0100 From: Martin Willi To: David Miller Cc: netdev@vger.kernel.org, linux-crypto@vger.kernel.org, Herbert Xu Subject: [PATCH] xfrm: Fix truncation length of authentication algorithms installed via PF_KEY Date: Wed, 9 Dec 2009 17:11:15 +0100 Message-Id: <1260375075-16187-1-git-send-email-martin@strongswan.org> X-Mailer: git-send-email 1.6.3.3 X-RPR-Rewrite: reverse-path rewritten by zaes.ch Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 Acked-by: Herbert Xu --- net/key/af_key.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) 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; */ }